| /third_party/pulseaudio/src/pulsecore/ |
| D | pid.c | 4 Copyright 2004-2006 Lennart Poettering 22 #include <config.h> 25 #include <fcntl.h> 26 #include <unistd.h> 27 #include <errno.h> 28 #include <sys/types.h> 29 #include <sys/stat.h> 30 #include <string.h> 31 #include <stdio.h> 32 #include <stdlib.h> [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/waitpid/ |
| D | waitpid09.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * waitpid(pid, WNOHANG) should return 0 if there is a running child 10 * waitpid(pid, WNOHANG) should return the pid of the child if 13 * waitpid(-1, 0) should return -1 with ECHILD if 16 * waitpid(-1, WNOHANG) should return -1 with ECHILD if 21 #include <sys/types.h> 22 #include <signal.h> 23 #include <errno.h> 24 #include <sys/wait.h> 25 #include <stdlib.h> [all …]
|
| D | waitpid_common.h | 1 // SPDX-License-Identifier: GPL-2.0-or-later 9 #include <sys/types.h> 10 #include <errno.h> 11 #include <sys/wait.h> 12 #include <stdlib.h> 13 #include "tst_test.h" 26 MAP_SHARED | MAP_ANONYMOUS, -1, 0); in waitpid_setup() 70 return -1; in waitpid_errno_check() 85 return -1; in waitpid_ret_test() 88 if ((ret == -1) && waitpid_errno_check(errno, wp_errno)) in waitpid_ret_test() [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/fork/ |
| D | fork13.c | 2 * a race in pid generation that causes pids to be reused immediately 7 * the same pid repeated, especially when it competes with another 9 * implementation. Furthermore, many shell scripts assume that pid 16 * // pid == offset == n // pid == offset == n + 1 17 * test_and_set_bit(offset, map->page) 18 * test_and_set_bit(offset, map->page); 19 * pid_ns->last_pid = pid; 20 * pid_ns->last_pid = pid; 21 * // pid == n + 1 is freed (wait()) 24 * last = pid_ns->last_pid; // == n [all …]
|
| /third_party/ltp/testcases/kernel/sched/hyperthreading/ht_affinity/ |
| D | ht_affinity.c | 2 HTaffinity.c - description 3 ------------------- 15 #include "ht_utils.h" 16 #include <sys/syscall.h> 17 #include <sys/types.h> 18 #include <unistd.h> 19 #include <sys/wait.h> 20 #include <stdio.h> 21 #include <stdlib.h> 22 #include <string.h> [all …]
|
| /third_party/mbedtls/programs/ssl/ |
| D | ssl_fork_server.c | 5 * SPDX-License-Identifier: Apache-2.0 11 * http://www.apache.org/licenses/LICENSE-2.0 20 #include "mbedtls/build_info.h" 23 #include "mbedtls/platform.h" 25 #include <stdio.h> 26 #include <stdlib.h> 62 #include "mbedtls/entropy.h" 63 #include "mbedtls/ctr_drbg.h" 64 #include "test/certs.h" 65 #include "mbedtls/x509.h" [all …]
|
| /third_party/grpc/test/core/util/ |
| D | subprocess_posix.cc | 9 * http://www.apache.org/licenses/LICENSE-2.0 19 #include <grpc/support/port_platform.h> 23 #include <assert.h> 24 #include <errno.h> 25 #include <signal.h> 26 #include <stdbool.h> 27 #include <stdio.h> 28 #include <stdlib.h> 29 #include <string.h> 30 #include <sys/types.h> [all …]
|
| /third_party/ltp/testcases/kernel/containers/pidns/ |
| D | pidns06.c | 13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 * Testcase tries killing of the parent namespace pid by the container-init. 18 * It also tries killing of non-existent PID, by the container-init. 24 * 2. The pid of the parent namespace is passed to the container. 25 * 3. Container receieves the PID and passes SIGKILL to this PID. 38 #include <stdio.h> 39 #include <stdlib.h> 40 #include <sys/wait.h> 41 #include <assert.h> 42 #include <unistd.h> [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/fanotify/ |
| D | fanotify21.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 * NOTE: FAN_REPORT_PIDFD support was added in v5.15-rc1 in af579beb666a 20 #include <stdio.h> 21 #include <ctype.h> 22 #include <stdlib.h> 23 #include <string.h> 24 #include "tst_test.h" 25 #include "tst_safe_stdio.h" 26 #include "lapi/pidfd_open.h" 29 #include "fanotify.h" [all …]
|
| /third_party/ltp/testcases/lib/ |
| D | tst_timeout_kill.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 #include <stdio.h> 7 #include <signal.h> 8 #include <stdlib.h> 9 #include <unistd.h> 10 #include <errno.h> 11 #include <string.h> 15 fprintf(stderr, "usage: %s timeout pid\n", name); in print_help() 22 int timeout, pid, ret, i; in main() local 30 pid = atoi(argv[2]); in main() [all …]
|
| /third_party/musl/libc-test/src/functionalext/fortify/ |
| D | fcntl_ext.c | 7 * http://www.apache.org/licenses/LICENSE-2.0 15 #include <errno.h> 16 #include <fcntl.h> 17 #include <signal.h> 18 #include <string.h> 19 #include <sys/wait.h> 20 #include "fortify_test.h" 21 #include "test.h" 33 TEST(fd != -1); in open_0010() 53 int pid = fork(); in open_0020() local [all …]
|
| D | unistd.c | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 #include <fcntl.h> 17 #include <limits.h> 18 #include <unistd.h> 19 #include <signal.h> 20 #include <string.h> 21 #include <sys/wait.h> 22 #include "fortify_test.h" 23 #include "test.h" 41 int pid = fork(); in unistd_dynamic_chk_001() local [all …]
|
| /third_party/musl/libc-test/src/functional/ |
| D | vfork.c | 2 #include <unistd.h> 3 #include <sys/wait.h> 4 #include <errno.h> 5 #include <string.h> 6 #include "test.h" 10 static int w(pid_t pid) in w() argument 13 r = waitpid(pid, &s, 0); in w() 14 if (r == -1) in w() 16 else if (r != pid) in w() 17 t_error("child pid was %d, waitpid returned %d\n", pid, r); in w() [all …]
|
| /third_party/glib/tests/ |
| D | child-test.c | 1 /* GLIB - Library of useful routines for C programming 2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 19 * Modified by the GLib Team and others 1997-2000. See the AUTHORS 25 #include <sys/types.h> 26 #include <stdlib.h> 28 #include <glib.h> 31 #include <unistd.h> 35 #include <windows.h> 54 GPid pid; in get_a_child() local 65 cmdline = g_strdup_printf( "child-test -c%d", ttl); in get_a_child() [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/ptrace/ |
| D | spawn_ptrace_child.h | 2 * Spawn a child and set it up for ptrace()-ing 6 * Licensed under the GPL-2 or later 11 * - add this line after your normal includes: 12 * #include "spawn_ptrace_child.c" 13 * - add this line to the top of your main(): 15 * - access the child pid via the "pid" variable 18 #include <errno.h> /* errno */ 19 #include <signal.h> /* signal() */ 20 #include <stdbool.h> /* true */ 21 #include <string.h> /* strcmp() */ [all …]
|
| /third_party/flutter/skia/third_party/externals/sdl/visualtest/src/linux/ |
| D | linux_process.c | 9 #include <SDL.h> 10 #include <SDL_test.h> 11 #include <sys/types.h> 12 #include <sys/wait.h> 13 #include <unistd.h> 14 #include <errno.h> 16 #include "SDL_visualtest_process.h" 17 #include "SDL_visualtest_harness_argparser.h" 18 #include "SDL_visualtest_parsehelper.h" 34 pid_t pid; in SDL_LaunchProcess() local [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/madvise/ |
| D | madvise08.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright (c) 2016 Richard Palethorpe <richiejp@f-m.fm> 24 #include <sys/types.h> 25 #include <sys/wait.h> 26 #include <sys/prctl.h> 27 #include <fcntl.h> 28 #include <unistd.h> 29 #include <signal.h> 30 #include <stdlib.h> 31 #include <stdio.h> [all …]
|
| /third_party/ltp/include/ |
| D | tst_sched.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 9 #include <sched.h> 11 #include "lapi/syscalls.h" 15 if (tst_ret == -1 && errno == ENOSYS) { \ 21 static inline int sys_sched_setparam(pid_t pid, const struct sched_param *param) in sys_sched_setparam() argument 23 return tst_syscall(__NR_sched_setparam, pid, param); in sys_sched_setparam() 26 static inline int sys_sched_getparam(pid_t pid, struct sched_param *param) in sys_sched_getparam() argument 28 return tst_syscall(__NR_sched_getparam, pid, param); in sys_sched_getparam() 31 static inline int sys_sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) in sys_sched_setscheduler() argument 33 return tst_syscall(__NR_sched_setscheduler, pid, policy, param); in sys_sched_setscheduler() [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/wait4/ |
| D | wait401.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 4 * Copyright (c) 2012-2018 Cyril Hrubis <chrubis@suse.cz> 8 * wait401 - check that a call to wait4() correctly waits for a child 12 #include <stdlib.h> 13 #include <errno.h> 15 #include <sys/types.h> 16 #include <sys/resource.h> 17 #include <sys/wait.h> 18 #include "tst_test.h" 22 pid_t pid; in run() local [all …]
|
| /third_party/ltp/lib/ |
| D | tst_clone.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 #include <stddef.h> 10 #include "tst_test.h" 11 #include "lapi/clone.h" 16 .flags = tst_args->flags, in tst_clone() 17 .exit_signal = tst_args->exit_signal, in tst_clone() 20 pid_t pid = -1; in tst_clone() local 26 pid = syscall(__NR_clone3, &args, sizeof(args)); in tst_clone() 28 if (pid == -1 && errno != ENOSYS) in tst_clone() 29 return -1; in tst_clone() [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/ioctl/ |
| D | ioctl_ns05.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 9 * Child cloned with the CLONE_NEWPID flag is created in a new pid namespace. 10 * That's checked by comparing its /proc/self/ns/pid symlink and the parent's 11 * one. Also child thinks its pid is 1. 16 #include <errno.h> 17 #include <stdio.h> 18 #include <sched.h> 19 #include <stdlib.h> 20 #include "tst_test.h" 21 #include "lapi/ioctl_ns.h" [all …]
|
| /third_party/selinux/libselinux/src/ |
| D | procattr.c | 1 #include <sys/syscall.h> 2 #include <unistd.h> 3 #include <fcntl.h> 4 #include <pthread.h> 5 #include <string.h> 6 #include <stdlib.h> 7 #include <stdio.h> 8 #include <errno.h> 9 #include "selinux_internal.h" 10 #include "policy.h" [all …]
|
| /third_party/ltp/testcases/kernel/ipc/semaphore/ |
| D | sem02.c | 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 29 * Waiter, pid = <pid#> 30 * Poster, pid = <pid#>, posting 33 * Waiter waiting, pid = <pid#> 39 * -ported 41 * -ported to LTP 45 #include <stdio.h> 46 #include <stdlib.h> 47 #include <unistd.h> 48 #include <errno.h> [all …]
|
| /third_party/ltp/testcases/kernel/syscalls/pidfd_send_signal/ |
| D | pidfd_send_signal03.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * a signal to a new process which inherited the PID of the actual 10 * In order to do so it is necessary to start a process with a pre- 11 * determined PID. This is accomplished by writing to the 13 * By utilizing this, this test forks two children with the same PID. 19 #include <signal.h> 20 #include <stdio.h> 21 #include <unistd.h> 22 #include "lapi/pidfd_send_signal.h" 23 #include "tst_safe_pthread.h" [all …]
|
| /third_party/musl/libc-test/src/functionalext/supplement/linux/ |
| D | wait4.c | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <string.h> 19 #include <sys/time.h> 20 #include <sys/wait.h> 21 #include <unistd.h> 22 #include "test.h" 36 pid_t pid = fork(); in wait4_0100() local 37 if (pid > 0) { in wait4_0100() [all …]
|