public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/wait-refactor] Implement waitpid in terms of wait4
@ 2019-11-13 20:59 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2019-11-13 20:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b2e4fd27eaf30d7159cebeba7d1ad675b10d4ca5

commit b2e4fd27eaf30d7159cebeba7d1ad675b10d4ca5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-13 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 20:59 [glibc/azanella/wait-refactor] Implement waitpid in terms of wait4 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).