r1077 - in trunk/glibc-2.3-head: patches/fixes sysdeps/kfreebsd
Author: ps-guest
Date: 2006-01-19 16:44:23 +0000 (Thu, 19 Jan 2006)
New Revision: 1077
Removed:
trunk/glibc-2.3-head/patches/fixes/sys_wait_h.patch
Modified:
trunk/glibc-2.3-head/sysdeps/kfreebsd/Makefile
trunk/glibc-2.3-head/sysdeps/kfreebsd/Versions
trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list
trunk/glibc-2.3-head/sysdeps/kfreebsd/wait.c
trunk/glibc-2.3-head/sysdeps/kfreebsd/wait3.c
trunk/glibc-2.3-head/sysdeps/kfreebsd/waitpid.c
Log:
* black magic for wait4() attribute_hidden
Deleted: trunk/glibc-2.3-head/patches/fixes/sys_wait_h.patch
===================================================================
--- trunk/glibc-2.3-head/patches/fixes/sys_wait_h.patch 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/patches/fixes/sys_wait_h.patch 2006-01-19 16:44:23 UTC (rev 1077)
@@ -1,11 +0,0 @@
---- include/sys/wait.h~ 2005-12-28 09:31:34.000000000 +0100
-+++ include/sys/wait.h 2005-12-28 09:31:34.000000000 +0100
-@@ -13,6 +13,5 @@
- extern __pid_t __wait3 (__WAIT_STATUS __stat_loc,
- int __options, struct rusage * __usage);
- extern __pid_t __wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc,
-- int __options, struct rusage *__usage)
-- attribute_hidden;
-+ int __options, struct rusage *__usage);
- #endif
-
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/Makefile
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/Makefile 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/Makefile 2006-01-19 16:44:23 UTC (rev 1077)
@@ -76,7 +76,7 @@
# Other.
sysdep_routines += sys_aio_cancel sys_aio_error sys_aio_read sys_aio_return sys_aio_suspend sys_aio_waitcomplete sys_aio_write sys_lio_listio issetugid modfind modfnext modnext modstat obreak quotactl rfork sysarch undelete yield
# for INLINE_SYSCALL
-sysdep_routines += sys_fork sys_execve sys_sigaction sys_close sys_fcntl sys_wait4
+sysdep_routines += sys_fork sys_execve sys_sigaction sys_close sys_fcntl
sysdep_routines += sys_clock_getres sys_clock_gettime sys_clock_settime
endif
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/Versions
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/Versions 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/Versions 2006-01-19 16:44:23 UTC (rev 1077)
@@ -93,7 +93,7 @@
__syscall_clock_getres; __syscall_clock_gettime; __syscall_clock_settime;
# misc fixes for FreeBSD:
__syscall_lseek; __syscall_pread; __syscall_pwrite;
- __syscall_sigaction; __syscall_fcntl; __wait4;
+ __syscall_sigaction; __syscall_fcntl;
__syscall_bind; __syscall_connect; __syscall_sendto;
__sigprocmask; __futimes; __ioctl;
# global variable used in brk()
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/syscalls.list 2006-01-19 16:44:23 UTC (rev 1077)
@@ -131,8 +131,7 @@
utrace - utrace i:bn utrace
sys_writev - writev i:ipi __syscall_writev
yield - yield i: __syscall_yield
-wait4 - wait4 Ci:iWiP __wait4 wait4
-sys_wait4 - wait4 i:iWiP __syscall_wait4
+wait4 - wait4 i:iWiP __syscall_wait4 __wait4 wait4
sys_close - close i:i __syscall_close
sys_fcntl - fcntl i:iiF __syscall_fcntl
sys_write - write i:ibn __syscall_write
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/wait.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/wait.c 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/wait.c 2006-01-19 16:44:23 UTC (rev 1077)
@@ -1,36 +1 @@
-/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sys/wait.h>
-#include <errno.h>
-#include <sys/resource.h>
-#include <stddef.h>
-#include <sysdep-cancel.h>
-
-/* 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)
-{
- return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
-}
-
-weak_alias (__libc_wait, __wait)
-weak_alias (__libc_wait, wait)
-
-LIBC_CANCEL_HANDLED (); /* in __wait4 */
+#include <sysdeps/unix/sysv/linux/wait.c>
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/wait3.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/wait3.c 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/wait3.c 2006-01-19 16:44:23 UTC (rev 1077)
@@ -32,9 +32,7 @@
int options;
struct rusage *usage;
{
- return __wait4 (WAIT_ANY, stat_loc, options, usage);
+ return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, options, usage);
}
weak_alias (__wait3, wait3)
-
-LIBC_CANCEL_HANDLED (); /* in __wait4 */
Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/waitpid.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/waitpid.c 2006-01-19 14:33:56 UTC (rev 1076)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/waitpid.c 2006-01-19 16:44:23 UTC (rev 1077)
@@ -37,11 +37,20 @@
pid_t
__libc_waitpid (pid_t pid, int *stat_loc, int options)
{
- return __wait4 (pid, (union wait *) stat_loc, options, NULL);
+ if (SINGLE_THREAD_P)
+ {
+ return INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
+ int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+
+ LIBC_CANCEL_RESET (oldtype);
+
+ return result;
}
weak_alias (__libc_waitpid, __waitpid)
libc_hidden_weak (__waitpid)
weak_alias (__libc_waitpid, waitpid)
-
-LIBC_CANCEL_HANDLED (); /* in __wait4 */
Reply to: