/usr/src/./contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c:390 static void t_spawn_chdir_impl(bool chdir) .. tmpdir_fd = open(tmp_path, O_DIRECTORY | O_RDONLY); ATF_REQUIRE(tmpdir_fd > 0); ATF_REQUIRE(posix_spawn_file_actions_addfchdir_np(&fa, tmpdir_fd) == 0); } err = posix_spawn(&pid, bin_pwd, &fa, NULL, args, NULL); posix_spawn_file_actions_destroy(&fa); if (!chdir) close(tmpdir_fd); ATF_REQUIRE(err == 0); .. } /usr/src/./cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c:36 void go(void) { pid_t pid; (void) posix_spawn(&pid, "/bin/ls", NULL, NULL, NULL, NULL); (void) waitpid(pid, NULL, 0); } /usr/src/./cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:419 static void bootdof_add(void) .. NULL, }; pid_t child; int err, status; err = posix_spawnp(&child, "nextboot", NULL, NULL, nbargv, NULL); if (err != 0) { error("failed to execute nextboot: %s", strerror(err)); exit(E_ERROR); } .. } /usr/src/./contrib/libarchive/libarchive/filter_fork_posix.c:73 int __archive_create_child(const char *cmd, int *child_stdin, int *child_stdout, .. if (stdout_pipe[1] != 1 /* stdout */) { r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[1]); if (r != 0) goto actions_inited; } r = posix_spawnp(&child, cmdline->path, &actions, NULL, cmdline->argv, NULL); if (r != 0) goto actions_inited; posix_spawn_file_actions_destroy(&actions); .. } /usr/src/./contrib/file/src/compress.c:1048 file_private int uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, .. posix_spawn_file_actions_init(&fa); handledesc(&fa, fd, fdp); DPRINTF("Executing %s\n", compr[method].argv[0]); status = posix_spawnp(&pid, compr[method].argv[0], &fa, NULL, args, NULL); posix_spawn_file_actions_destroy(&fa); if (status == -1) { .. }