Lines Matching +full:sig +full:- +full:dir
1 // SPDX-License-Identifier: CDDL-1.0
5 * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
6 * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
10 * Common Development and Distribution License Version 1.0 (CDDL-1.0).
11 * You can obtain a copy of the license from the top-level file
12 * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
54 p1 = ((const struct launched_process_node *) x1)->pid; in _launched_process_node_compare()
55 p2 = ((const struct launched_process_node *) x2)->pid; in _launched_process_node_compare()
58 return (-1); in _launched_process_node_compare()
65 static pthread_t _reap_children_tid = (pthread_t)-1;
74 * Return a newly-allocated environment, or NULL on error.
114 * in directory [dir] is executed with the environment [env].
120 _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog, in _zed_exec_fork_child() argument
132 assert(dir != NULL); in _zed_exec_fork_child()
141 n = snprintf(path, sizeof (path), "%s/%s", dir, prog); in _zed_exec_fork_child()
162 (fd = open("/dev/null", O_RDWR | O_CLOEXEC)) != -1) { in _zed_exec_fork_child()
176 node->pid = pid; in _zed_exec_fork_child()
177 node->eid = eid; in _zed_exec_fork_child()
178 node->name = strdup(prog); in _zed_exec_fork_child()
179 if (node->name == NULL) { in _zed_exec_fork_child()
194 _nop(int sig) in _nop() argument
196 (void) sig; in _nop()
222 if (pid == 0 || pid == (pid_t)-1) { in _reap_children()
261 "time=%llu.%06us sig=%d/%s", in _reap_children()
290 if (_reap_children_tid == (pthread_t)-1) in zed_exec_fini()
298 free(node->name); in zed_exec_fini()
306 _reap_children_tid = (pthread_t)-1; in zed_exec_fini()
313 * Each executable in [zcp->zedlets] from the directory [zcp->zedlet_dir]
320 * The file descriptor [zcp->zevent_fd] is the zevent_fd used to track the
323 * Return 0 on success, -1 on error.
336 if (!zcp->zedlet_dir || !zcp->zedlets || !envs || zcp->zevent_fd < 0) in zed_exec_process()
337 return (-1); in zed_exec_process()
339 if (_reap_children_tid == (pthread_t)-1) { in zed_exec_process()
340 _launched_processes_limit = zcp->max_jobs; in zed_exec_process()
344 return (-1); in zed_exec_process()
367 for (z = zed_strings_first(zcp->zedlets); z; in zed_exec_process()
368 z = zed_strings_next(zcp->zedlets)) { in zed_exec_process()
372 _zed_exec_fork_child(eid, zcp->zedlet_dir, in zed_exec_process()
373 z, e, zcp->zevent_fd, zcp->do_foreground); in zed_exec_process()