Index: posix/sys/wait.h =================================================================== RCS file: /egcs/carton/cvsfiles/libc/posix/sys/wait.h,v retrieving revision 1.23 diff -u -r1.23 wait.h --- wait.h 1997/12/22 17:58:03 1.23 +++ wait.h 1998/05/25 08:38:45 @@ -51,14 +51,14 @@ # define __WAIT_INT(status) (*(int *) &(status)) # endif -/* This is the type of the argument to `wait'. The funky union - causes redeclarations with ether `int *' or `union wait *' to be - allowed without complaint. __WAIT_STATUS_DEFN is the type used in - the actual function definitions. */ +/* __WAIT_STATUS is the type of the argument to `wait'. The funky + union causes invocations with either `int *' or `union wait *' to be + allowed without complaint. __WAIT_PTR(stat_loc) typecasts a + __WAIT_STATUS to an `int *'. */ # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus # define __WAIT_STATUS __ptr_t -# define __WAIT_STATUS_DEFN __ptr_t +# define __WAIT_PTR(stat_loc) ((int *) stat_loc) # else /* This works in GCC 2.6.1 and later. */ typedef union @@ -66,14 +66,14 @@ union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); -# define __WAIT_STATUS_DEFN int * -#endif +# define __WAIT_PTR(stat_loc) ((stat_loc).__iptr) +# endif #else /* Don't use BSD. */ # define __WAIT_INT(status) (status) # define __WAIT_STATUS int * -# define __WAIT_STATUS_DEFN int * +# define __WAIT_PTR(stat_loc) (stat_loc) #endif /* Use BSD. */ Index: sysdeps/generic/wait.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/generic/wait.c,v retrieving revision 1.2 diff -u -r1.2 wait.c --- wait.c 1997/12/08 02:51:20 1.2 +++ wait.c 1998/05/25 08:38:58 @@ -22,7 +22,7 @@ /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. */ __pid_t -__wait (__WAIT_STATUS_DEFN stat_loc) +__wait (__WAIT_STATUS stat_loc) { __set_errno (ENOSYS); return -1; Index: sysdeps/generic/wait3.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/generic/wait3.c,v retrieving revision 1.2 diff -u -r1.2 wait3.c --- wait3.c 1997/12/08 02:51:20 1.2 +++ wait3.c 1998/05/25 08:38:58 @@ -26,7 +26,7 @@ there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ pid_t -__wait3 (__WAIT_STATUS_DEFN stat_loc, int options, struct rusage *usage) +__wait3 (__WAIT_STATUS stat_loc, int options, struct rusage *usage) { if ((options & ~(WNOHANG|WUNTRACED)) != 0) { Index: sysdeps/mach/hurd/wait4.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/mach/hurd/wait4.c,v retrieving revision 1.14 diff -u -r1.14 wait4.c --- wait4.c 1997/05/26 22:25:17 1.14 +++ wait4.c 1998/05/25 08:39:14 @@ -25,7 +25,7 @@ pid_t __wait4 (pid, stat_loc, options, usage) pid_t pid; - __WAIT_STATUS_DEFN stat_loc; + __WAIT_STATUS stat_loc; int options; struct rusage *usage; { @@ -36,7 +36,7 @@ int dummy; err = __USEPORT (PROC, __proc_wait (port, pid, options, - stat_loc ?: &dummy, &sigcode, + __WAIT_PTR(stat_loc) ?: &dummy, &sigcode, usage ?: &ignored, &dead)); return err ? (pid_t) __hurd_fail (err) : dead; Index: sysdeps/posix/wait.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/posix/wait.c,v retrieving revision 1.6 diff -u -r1.6 wait.c --- wait.c 1997/06/23 21:52:35 1.6 +++ wait.c 1998/05/25 08:39:16 @@ -22,9 +22,9 @@ /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. */ __pid_t -__libc_wait (__WAIT_STATUS_DEFN stat_loc) +__libc_wait (__WAIT_STATUS stat_loc) { - return __waitpid (WAIT_ANY, (int *) stat_loc, 0); + return __waitpid (WAIT_ANY, __WAIT_PTR(stat_loc), 0); } weak_alias (__libc_wait, __wait) Index: sysdeps/posix/wait3.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/posix/wait3.c,v retrieving revision 1.7 diff -u -r1.7 wait3.c --- wait3.c 1997/06/23 21:52:36 1.7 +++ wait3.c 1998/05/25 08:39:17 @@ -28,7 +28,7 @@ children; otherwise don't. */ pid_t __wait3 (stat_loc, options, usage) - __WAIT_STATUS_DEFN stat_loc; + __WAIT_STATUS stat_loc; int options; struct rusage *usage; { Index: sysdeps/unix/bsd/bsd4.4/wait.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/unix/bsd/bsd4.4/wait.c,v retrieving revision 1.5 diff -u -r1.5 wait.c --- wait.c 1997/06/23 21:54:00 1.5 +++ wait.c 1998/05/25 08:39:20 @@ -24,7 +24,7 @@ /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. */ __pid_t -__libc_wait (__WAIT_STATUS_DEFN stat_loc) +__libc_wait (__WAIT_STATUS stat_loc) { return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL); } Index: sysdeps/unix/bsd/sun/sunos4/wait4.c =================================================================== RCS file: /egcs/carton/cvsfiles/libc/sysdeps/unix/bsd/sun/sunos4/wait4.c,v retrieving revision 1.8 diff -u -r1.8 wait4.c --- wait4.c 1997/05/26 22:27:21 1.8 +++ wait4.c 1998/05/25 08:39:22 @@ -23,13 +23,13 @@ #include #include -extern pid_t __wait4_syscall __P ((pid_t pid, __WAIT_STATUS_DEFN stat_loc, +extern pid_t __wait4_syscall __P ((pid_t pid, int *stat_loc, int options, struct rusage *usage)); pid_t __wait4 (pid, stat_loc, options, usage) pid_t pid; - __WAIT_STATUS_DEFN stat_loc; + __WAIT_STATUS stat_loc; int options; struct rusage *usage; { @@ -44,7 +44,7 @@ break; } - return __wait4_syscall (pid, stat_loc, options, usage); + return __wait4_syscall (pid, __WAIT_PTR(stat_loc), options, usage); } weak_alias (__wait4, wait4)