Lines Matching +full:sig +full:- +full:dir
4 * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
5 * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
9 * Common Development and Distribution License Version 1.0 (CDDL-1.0).
10 * You can obtain a copy of the license from the top-level file
11 * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
53 p1 = ((const struct launched_process_node *) x1)->pid; in _launched_process_node_compare()
54 p2 = ((const struct launched_process_node *) x2)->pid; in _launched_process_node_compare()
57 return (-1); in _launched_process_node_compare()
64 static pthread_t _reap_children_tid = (pthread_t)-1;
73 * Return a newly-allocated environment, or NULL on error.
113 * in directory [dir] is executed with the environment [env].
119 _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog, in _zed_exec_fork_child() argument
131 assert(dir != NULL); in _zed_exec_fork_child()
140 n = snprintf(path, sizeof (path), "%s/%s", dir, prog); in _zed_exec_fork_child()
161 (fd = open("/dev/null", O_RDWR | O_CLOEXEC)) != -1) { in _zed_exec_fork_child()
175 node->pid = pid; in _zed_exec_fork_child()
176 node->eid = eid; in _zed_exec_fork_child()
177 node->name = strdup(prog); in _zed_exec_fork_child()
178 if (node->name == NULL) { in _zed_exec_fork_child()
193 _nop(int sig) in _nop() argument
195 (void) sig; in _nop()
221 if (pid == 0 || pid == (pid_t)-1) { in _reap_children()
260 "time=%llu.%06us sig=%d/%s", in _reap_children()
289 if (_reap_children_tid == (pthread_t)-1) in zed_exec_fini()
297 free(node->name); in zed_exec_fini()
305 _reap_children_tid = (pthread_t)-1; in zed_exec_fini()
312 * Each executable in [zcp->zedlets] from the directory [zcp->zedlet_dir]
319 * The file descriptor [zcp->zevent_fd] is the zevent_fd used to track the
322 * Return 0 on success, -1 on error.
335 if (!zcp->zedlet_dir || !zcp->zedlets || !envs || zcp->zevent_fd < 0) in zed_exec_process()
336 return (-1); in zed_exec_process()
338 if (_reap_children_tid == (pthread_t)-1) { in zed_exec_process()
339 _launched_processes_limit = zcp->max_jobs; in zed_exec_process()
343 return (-1); in zed_exec_process()
366 for (z = zed_strings_first(zcp->zedlets); z; in zed_exec_process()
367 z = zed_strings_next(zcp->zedlets)) { in zed_exec_process()
371 _zed_exec_fork_child(eid, zcp->zedlet_dir, in zed_exec_process()
372 z, e, zcp->zevent_fd, zcp->do_foreground); in zed_exec_process()