glibc/posix/waitpid.c
Joseph Myers 2c46a66a3a Remove __libc_waitpid function name.
Continuing the removal of unused __libc_* function names, this patch
removes the __libc_waitpid name.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch; __waitpid, which is exported from
shared libc, changes from weak to strong on some configurations, which
is of no significance).

	* include/sys/wait.h (__libc_waitpid): Remove declaration.
	* posix/waitpid.c (__libc_waitpid): Rename to __waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/bsd/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
	* sysdeps/unix/sysv/linux/i386/syscalls.list (waitpid): Remove
	__libc_waitpid alias.
	* sysdeps/unix/sysv/linux/m68k/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/syscalls.list (waitpid):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/syscalls.list (waitpid): Likewise.
	* sysdeps/unix/sysv/linux/tile/waitpid.S (__libc_waitpid): Remove
	alias.
	* sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Rename to
	__waitpid.
	(__waitpid): Don't define as alias.  Use libc_hidden_def not
	libc_hidden_weak.
	(waitpid): Define as alias of __waitpid.
2014-11-07 01:27:16 +00:00

51 lines
1.8 KiB
C

/* Copyright (C) 1991-2014 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, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/wait.h>
#include <sys/types.h>
/* Wait for a child matching PID to die.
If PID is greater than 0, match any process whose process ID is PID.
If PID is (pid_t) -1, match any process.
If PID is (pid_t) 0, match any process with the
same process group as the current process.
If PID is less than -1, match any process whose
process group is the absolute value of PID.
If the WNOHANG bit is set in OPTIONS, and that child
is not already dead, return (pid_t) 0. If successful,
return PID and store the dead child's status in STAT_LOC.
Return (pid_t) -1 for errors. If the WUNTRACED bit is set in OPTIONS,
return status for stopped children; otherwise don't. */
pid_t
__waitpid (pid_t pid, int *stat_loc, int options)
{
if ((options & ~(WNOHANG|WUNTRACED)) != 0)
{
__set_errno (EINVAL);
return (pid_t) -1;
}
__set_errno (ENOSYS);
return (pid_t) -1;
}
libc_hidden_def (__waitpid)
weak_alias (__waitpid, waitpid)
stub_warning (waitpid)