aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-03-21 15:43:53 -0700
committerElliott Hughes <enh@google.com>2013-03-21 16:14:06 -0700
commit17a8b0db63d54e9d79bf11112ace0c4fe9606289 (patch)
tree61b5f1d12776e4843e7ba70df5b20f97970be019 /libc/bionic
parent86c318497270c80a3791b4cd9835367653636377 (diff)
downloadandroid_bionic-17a8b0db63d54e9d79bf11112ace0c4fe9606289.tar.gz
android_bionic-17a8b0db63d54e9d79bf11112ace0c4fe9606289.tar.bz2
android_bionic-17a8b0db63d54e9d79bf11112ace0c4fe9606289.zip
Expose wait4 as wait4 rather than __wait4.
This helps strace(1) compile with one fewer hack. Change-Id: I5296d0cfec5546709cda990abd705ad33d7c4626
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/wait.cpp (renamed from libc/bionic/wait.c)31
1 files changed, 16 insertions, 15 deletions
diff --git a/libc/bionic/wait.c b/libc/bionic/wait.cpp
index f1db086db..7dbcec29a 100644
--- a/libc/bionic/wait.c
+++ b/libc/bionic/wait.cpp
@@ -25,29 +25,30 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#include <sys/wait.h>
#include <stddef.h>
-extern pid_t __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
-extern int __waitid(idtype_t which, id_t id, siginfo_t *info, int options, struct rusage *ru);
+extern "C" int __waitid(idtype_t which, id_t id, siginfo_t* info, int options, struct rusage* ru);
+
+pid_t wait(int* status) {
+ return wait4(-1, status, 0, NULL);
+}
-pid_t wait( int* status )
-{
- return __wait4( (pid_t)-1, status, 0, NULL );
+pid_t wait3(int* status, int options, struct rusage* rusage) {
+ return wait4(-1, status, options, rusage);
}
-pid_t wait3(int* status, int options, struct rusage* rusage)
-{
- return __wait4( (pid_t)-1, status, options, rusage );
+pid_t waitpid(pid_t pid, int* status, int options) {
+ return wait4(pid, status, options, NULL);
}
-pid_t waitpid(pid_t pid, int* status, int options)
-{
- return __wait4( pid, status, options, NULL );
+int waitid(idtype_t which, id_t id, siginfo_t* info, int options) {
+ /* the system call takes an option struct rusage that we don't need */
+ return __waitid(which, id, info, options, NULL);
}
-int waitid(idtype_t which, id_t id, siginfo_t *info, int options)
-{
- /* the system call takes an option struct rusage that we don't need */
- return __waitid(which, id, info, options, NULL);
+// TODO: remove this backward compatibility hack (for jb-mr1 strace binaries).
+extern "C" pid_t __wait4(pid_t pid, int* status, int options, struct rusage* rusage) {
+ return wait4(pid, status, options, rusage);
}