malloc/Makefile: Split and sort tests
[glibc.git] / sysdeps / unix / sysv / linux / wait3.c
bloba06ca44ea28a6a41f4fdf503a7146ef53466a1f9
1 /* Wait for process to change state, BSD style. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #include <sys/wait.h>
20 #include <sys/resource.h>
21 #include <sys/types.h>
23 pid_t
24 __wait3_time64 (int *stat_loc, int options, struct __rusage64 *usage)
26 return __wait4_time64 (WAIT_ANY, stat_loc, options, usage);
28 #if __TIMESIZE != 64
29 libc_hidden_def (__wait3_time64)
31 pid_t
32 __wait3 (int *stat_loc, int options, struct rusage *usage)
34 struct __rusage64 usage64;
35 pid_t ret = __wait3_time64 (stat_loc, options,
36 usage != NULL ? &usage64 : NULL);
37 if (ret > 0 && usage != NULL)
38 rusage64_to_rusage (&usage64, usage);
40 return ret;
42 #endif
44 weak_alias (__wait3, wait3)