From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56404 invoked by alias); 13 Nov 2019 20:59:12 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 56385 invoked by uid 9943); 13 Nov 2019 20:59:12 -0000 Date: Wed, 13 Nov 2019 20:59:00 -0000 Message-ID: <20191113205912.56384.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/wait-refactor] Implement waitpid in terms of wait4 X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/wait-refactor X-Git-Oldrev: 64f9e324868d270883f1e5a0810b775b1cdd1229 X-Git-Newrev: b2e4fd27eaf30d7159cebeba7d1ad675b10d4ca5 X-SW-Source: 2019-q4/txt/msg00331.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b2e4fd27eaf30d7159cebeba7d1ad675b10d4ca5 commit b2e4fd27eaf30d7159cebeba7d1ad675b10d4ca5 Author: Adhemerval Zanella Date: Wed Nov 13 17:57:00 2019 -0300 Implement waitpid in terms of wait4 Checked on x86_64-linux-gnu. Diff: --- include/sys/wait.h | 1 + posix/wait4.c | 2 +- sysdeps/mach/hurd/wait4.c | 2 +- sysdeps/unix/sysv/linux/wait4.c | 1 + sysdeps/unix/sysv/linux/waitpid.c | 6 +----- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/sys/wait.h b/include/sys/wait.h index 5ac9cd6..39a327f 100644 --- a/include/sys/wait.h +++ b/include/sys/wait.h @@ -15,5 +15,6 @@ extern __pid_t __wait3 (int *__stat_loc, extern __pid_t __wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) attribute_hidden; +libc_hidden_proto (__wait4); #endif #endif diff --git a/posix/wait4.c b/posix/wait4.c index eb4f7fb..5857b4e 100644 --- a/posix/wait4.c +++ b/posix/wait4.c @@ -26,5 +26,5 @@ __wait4 (__pid_t pid, int *stat_loc, int options, struct rusage *usage) return (pid_t) -1; } stub_warning (wait4) - +libc_hidden_def (__wait4) weak_alias (__wait4, wait4) diff --git a/sysdeps/mach/hurd/wait4.c b/sysdeps/mach/hurd/wait4.c index 78ad33e..a013748 100644 --- a/sysdeps/mach/hurd/wait4.c +++ b/sysdeps/mach/hurd/wait4.c @@ -49,5 +49,5 @@ __wait4 (pid_t pid, int *stat_loc, int options, struct rusage *usage) return (pid_t) __hurd_fail (err); } } - +libc_hidden_def (__wait4) weak_alias (__wait4, wait4) diff --git a/sysdeps/unix/sysv/linux/wait4.c b/sysdeps/unix/sysv/linux/wait4.c index c722753..0a0e465 100644 --- a/sysdeps/unix/sysv/linux/wait4.c +++ b/sysdeps/unix/sysv/linux/wait4.c @@ -81,4 +81,5 @@ __wait4 (__pid_t pid, int *stat_loc, int options, struct rusage *usage) return infop.si_pid; #endif } +libc_hidden_def (__wait4); weak_alias (__wait4, wait4) diff --git a/sysdeps/unix/sysv/linux/waitpid.c b/sysdeps/unix/sysv/linux/waitpid.c index d35aac0..e0905ea 100644 --- a/sysdeps/unix/sysv/linux/waitpid.c +++ b/sysdeps/unix/sysv/linux/waitpid.c @@ -24,11 +24,7 @@ __pid_t __waitpid (__pid_t pid, int *stat_loc, int options) { -#ifdef __NR_waitpid - return SYSCALL_CANCEL (waitpid, pid, stat_loc, options); -#else - return SYSCALL_CANCEL (wait4, pid, stat_loc, options, NULL); -#endif + return __wait4 (pid, stat_loc, options, NULL); } libc_hidden_def (__waitpid) weak_alias (__waitpid, waitpid)