From ef7344f09c5ce00eb519ed14598b2a8e39c68387 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 22 Dec 2013 14:49:48 +0000 Subject: Flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd. As discussed in and , it seems appropriate to flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd. The bulk of the patch is just moving files. The only other changes are: update paths in sysdeps/mach/hurd/Implies and sysdeps/unix/sysv/linux/wait3.c; merge the two syscalls.list files, with the removal of syscalls that were in sysdeps/unix/bsd/syscalls.list but overridden in the bsd4.4 directory by .c files there. Tested x86_64. The installed shared libraries are identical before and after the patch except for libc.so where the move of wait3.c (included by sysdeps/unix/sysv/linux/wait3.c) affects debug info, but the disassembly is unchanged. * sysdeps/mach/hurd/Implies: Change unix/bsd/bsd4.4 to unix/bsd. * sysdeps/unix/bsd/syscalls.list (chflags): Add entry from sysdeps/unix/bsd/bsd4.4/syscalls.list. (fchflags): Likewise. (revoke): Likewise. (setlogin): Likewise. (sigaltstack): Likewise. (wait4): Likewise. (sigblock): Remove. (sigsetmask): Likewise. (wait3): Likewise. (waitpid): Likewise. * sysdeps/unix/bsd/bsd4.4/syscalls.list: Remove file. * sysdeps/unix/sysv/linux/wait3.c: Update directory of included file. * sysdeps/unix/bsd/bsd4.4/Makefile: Move to ... * sysdeps/unix/bsd/Makefile: ... here. * sysdeps/unix/bsd/bsd4.4/Versions: Move to ... * sysdeps/unix/bsd/Versions: ... here. * sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h: Move to ... * sysdeps/unix/bsd/bits/sockaddr.h: ... here. * sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c: Move to ... * sysdeps/unix/bsd/cmsg_nxthdr.c: ... here. * sysdeps/unix/bsd/bsd4.4/sigblock.c: Move to ... * sysdeps/unix/bsd/sigblock.c: ... here. * sysdeps/unix/bsd/bsd4.4/sigsetmask.c: Move to ... * sysdeps/unix/bsd/sigsetmask.c: ... here. * sysdeps/unix/bsd/bsd4.4/sigvec.c: Move to ... * sysdeps/unix/bsd/sigvec.c: ... here. * sysdeps/unix/bsd/bsd4.4/tcdrain.c: Move to ... * sysdeps/unix/bsd/tcdrain.c: ... here. * sysdeps/unix/bsd/bsd4.4/tcgetattr.c: Move to ... * sysdeps/unix/bsd/tcgetattr.c: ... here. * sysdeps/unix/bsd/bsd4.4/tcsetattr.c: Move to ... * sysdeps/unix/bsd/tcsetattr.c: ... here. * sysdeps/unix/bsd/bsd4.4/wait.c: Move to ... * sysdeps/unix/bsd/wait.c: ... here. * sysdeps/unix/bsd/bsd4.4/wait3.c: Move to ... * sysdeps/unix/bsd/wait3.c: ... here. * sysdeps/unix/bsd/bsd4.4/waitpid.c: Move to ... * sysdeps/unix/bsd/waitpid.c: ... here. --- sysdeps/mach/hurd/Implies | 2 +- sysdeps/unix/bsd/Makefile | 3 ++ sysdeps/unix/bsd/Versions | 6 ++++ sysdeps/unix/bsd/bits/sockaddr.h | 42 ++++++++++++++++++++++ sysdeps/unix/bsd/bsd4.4/Makefile | 3 -- sysdeps/unix/bsd/bsd4.4/Versions | 6 ---- sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h | 42 ---------------------- sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c | 2 -- sysdeps/unix/bsd/bsd4.4/sigblock.c | 1 - sysdeps/unix/bsd/bsd4.4/sigsetmask.c | 1 - sysdeps/unix/bsd/bsd4.4/sigvec.c | 1 - sysdeps/unix/bsd/bsd4.4/syscalls.list | 8 ----- sysdeps/unix/bsd/bsd4.4/tcdrain.c | 27 -------------- sysdeps/unix/bsd/bsd4.4/tcgetattr.c | 40 --------------------- sysdeps/unix/bsd/bsd4.4/tcsetattr.c | 62 --------------------------------- sysdeps/unix/bsd/bsd4.4/wait.c | 32 ----------------- sysdeps/unix/bsd/bsd4.4/wait3.c | 36 ------------------- sysdeps/unix/bsd/bsd4.4/waitpid.c | 43 ----------------------- sysdeps/unix/bsd/cmsg_nxthdr.c | 2 ++ sysdeps/unix/bsd/sigblock.c | 1 + sysdeps/unix/bsd/sigsetmask.c | 1 + sysdeps/unix/bsd/sigvec.c | 1 + sysdeps/unix/bsd/syscalls.list | 10 +++--- sysdeps/unix/bsd/tcdrain.c | 27 ++++++++++++++ sysdeps/unix/bsd/tcgetattr.c | 40 +++++++++++++++++++++ sysdeps/unix/bsd/tcsetattr.c | 62 +++++++++++++++++++++++++++++++++ sysdeps/unix/bsd/wait.c | 32 +++++++++++++++++ sysdeps/unix/bsd/wait3.c | 36 +++++++++++++++++++ sysdeps/unix/bsd/waitpid.c | 43 +++++++++++++++++++++++ sysdeps/unix/sysv/linux/wait3.c | 2 +- 30 files changed, 304 insertions(+), 310 deletions(-) create mode 100644 sysdeps/unix/bsd/Makefile create mode 100644 sysdeps/unix/bsd/Versions create mode 100644 sysdeps/unix/bsd/bits/sockaddr.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/Makefile delete mode 100644 sysdeps/unix/bsd/bsd4.4/Versions delete mode 100644 sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h delete mode 100644 sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/sigblock.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/sigsetmask.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/sigvec.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/syscalls.list delete mode 100644 sysdeps/unix/bsd/bsd4.4/tcdrain.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/tcgetattr.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/tcsetattr.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/wait.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/wait3.c delete mode 100644 sysdeps/unix/bsd/bsd4.4/waitpid.c create mode 100644 sysdeps/unix/bsd/cmsg_nxthdr.c create mode 100644 sysdeps/unix/bsd/sigblock.c create mode 100644 sysdeps/unix/bsd/sigsetmask.c create mode 100644 sysdeps/unix/bsd/sigvec.c create mode 100644 sysdeps/unix/bsd/tcdrain.c create mode 100644 sysdeps/unix/bsd/tcgetattr.c create mode 100644 sysdeps/unix/bsd/tcsetattr.c create mode 100644 sysdeps/unix/bsd/wait.c create mode 100644 sysdeps/unix/bsd/wait3.c create mode 100644 sysdeps/unix/bsd/waitpid.c (limited to 'sysdeps') diff --git a/sysdeps/mach/hurd/Implies b/sysdeps/mach/hurd/Implies index b6063463ce..d2d5234c1f 100644 --- a/sysdeps/mach/hurd/Implies +++ b/sysdeps/mach/hurd/Implies @@ -2,4 +2,4 @@ # Hurd-based GNU systems. gnu # The Hurd provides a rough superset of the functionality of 4.4 BSD. -unix/bsd/bsd4.4 +unix/bsd diff --git a/sysdeps/unix/bsd/Makefile b/sysdeps/unix/bsd/Makefile new file mode 100644 index 0000000000..208fd24484 --- /dev/null +++ b/sysdeps/unix/bsd/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),socket) +sysdep_routines += cmsg_nxthdr +endif diff --git a/sysdeps/unix/bsd/Versions b/sysdeps/unix/bsd/Versions new file mode 100644 index 0000000000..99b386b670 --- /dev/null +++ b/sysdeps/unix/bsd/Versions @@ -0,0 +1,6 @@ +libc { + GLIBC_2.2.5 { + # functions used in inline functions or macros + __cmsg_nxthdr; + } +} diff --git a/sysdeps/unix/bsd/bits/sockaddr.h b/sysdeps/unix/bsd/bits/sockaddr.h new file mode 100644 index 0000000000..c2a1c9c2e4 --- /dev/null +++ b/sysdeps/unix/bsd/bits/sockaddr.h @@ -0,0 +1,42 @@ +/* Definition of `struct sockaddr_*' common members. 4.4 BSD version. + Copyright (C) 1995-2013 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 + . */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_SOCKADDR_H +#define _BITS_SOCKADDR_H 1 + + +/* POSIX.1g specifies this type name for the `sa_family' member. */ +typedef unsigned char sa_family_t; + +/* This macro is used to declare the initial common members + of the data types used for socket addresses, `struct sockaddr', + `struct sockaddr_in', `struct sockaddr_un', etc. */ + +#define __SOCKADDR_COMMON(sa_prefix) \ + unsigned char sa_prefix##len; \ + sa_family_t sa_prefix##family + +#define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char)) + +#define _HAVE_SA_LEN 1 /* We have the sa_len field. */ + +#endif /* bits/sockaddr.h */ diff --git a/sysdeps/unix/bsd/bsd4.4/Makefile b/sysdeps/unix/bsd/bsd4.4/Makefile deleted file mode 100644 index 208fd24484..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(subdir),socket) -sysdep_routines += cmsg_nxthdr -endif diff --git a/sysdeps/unix/bsd/bsd4.4/Versions b/sysdeps/unix/bsd/bsd4.4/Versions deleted file mode 100644 index 99b386b670..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/Versions +++ /dev/null @@ -1,6 +0,0 @@ -libc { - GLIBC_2.2.5 { - # functions used in inline functions or macros - __cmsg_nxthdr; - } -} diff --git a/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h b/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h deleted file mode 100644 index c2a1c9c2e4..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Definition of `struct sockaddr_*' common members. 4.4 BSD version. - Copyright (C) 1995-2013 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 - . */ - -/* - * Never include this file directly; use instead. - */ - -#ifndef _BITS_SOCKADDR_H -#define _BITS_SOCKADDR_H 1 - - -/* POSIX.1g specifies this type name for the `sa_family' member. */ -typedef unsigned char sa_family_t; - -/* This macro is used to declare the initial common members - of the data types used for socket addresses, `struct sockaddr', - `struct sockaddr_in', `struct sockaddr_un', etc. */ - -#define __SOCKADDR_COMMON(sa_prefix) \ - unsigned char sa_prefix##len; \ - sa_family_t sa_prefix##family - -#define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char)) - -#define _HAVE_SA_LEN 1 /* We have the sa_len field. */ - -#endif /* bits/sockaddr.h */ diff --git a/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c b/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c deleted file mode 100644 index 1a542fa01a..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c +++ /dev/null @@ -1,2 +0,0 @@ -/* The Linux version is perfectly usable on 4.4 BSD. */ -#include diff --git a/sysdeps/unix/bsd/bsd4.4/sigblock.c b/sysdeps/unix/bsd/bsd4.4/sigblock.c deleted file mode 100644 index 2647327db0..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/sigblock.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/bsd/bsd4.4/sigsetmask.c b/sysdeps/unix/bsd/bsd4.4/sigsetmask.c deleted file mode 100644 index 47f1e36a7f..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/sigsetmask.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/bsd/bsd4.4/sigvec.c b/sysdeps/unix/bsd/bsd4.4/sigvec.c deleted file mode 100644 index d03d9bb3df..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/sigvec.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/bsd/bsd4.4/syscalls.list b/sysdeps/unix/bsd/bsd4.4/syscalls.list deleted file mode 100644 index a4d3546854..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/syscalls.list +++ /dev/null @@ -1,8 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -chflags - chflags 2 chflags -fchflags - fchflags 2 fchflags -revoke - revoke 1 revoke -setlogin - setlogin 2 setlogin -sigaltstack - sigaltstack 2 __sigaltstack sigaltstack -wait4 - wait4 4 __wait4 wait4 diff --git a/sysdeps/unix/bsd/bsd4.4/tcdrain.c b/sysdeps/unix/bsd/bsd4.4/tcdrain.c deleted file mode 100644 index bc63a2485a..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/tcdrain.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1992-2013 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 - . */ - -#include -#include - -/* Wait for pending output to be written on FD. */ -int -__libc_tcdrain (int fd) -{ - return __ioctl (fd, TIOCDRAIN); -} -weak_alias (__libc_tcdrain, tcdrain) diff --git a/sysdeps/unix/bsd/bsd4.4/tcgetattr.c b/sysdeps/unix/bsd/bsd4.4/tcgetattr.c deleted file mode 100644 index e5402cddd0..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/tcgetattr.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1991-2013 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 - . */ - -#include -#include - -/* These are defined both in and in . - They should have the same values, but perhaps not written the same way. */ -#undef ECHO -#undef MDMBUF -#undef TOSTOP -#undef FLUSHO -#undef PENDIN -#undef NOFLSH -#include - -/* Put the state of FD into *TERMIOS_P. */ -int -__tcgetattr (fd, termios_p) - int fd; - struct termios *termios_p; -{ - return __ioctl (fd, TIOCGETA, termios_p); -} - -weak_alias (__tcgetattr, tcgetattr) diff --git a/sysdeps/unix/bsd/bsd4.4/tcsetattr.c b/sysdeps/unix/bsd/bsd4.4/tcsetattr.c deleted file mode 100644 index bd58771549..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/tcsetattr.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 1992-2013 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 - . */ - -#include -#include -#include - -/* These are defined both in and in . - They should have the same values, but perhaps not written the same way. */ -#undef ECHO -#undef MDMBUF -#undef TOSTOP -#undef FLUSHO -#undef PENDIN -#undef NOFLSH -#include - - -/* Set the state of FD to *TERMIOS_P. */ -int -tcsetattr (fd, optional_actions, termios_p) - int fd; - int optional_actions; - const struct termios *termios_p; -{ - struct termios myt; - - if (optional_actions & TCSASOFT) - { - myt = *termios_p; - myt.c_cflag |= CIGNORE; - termios_p = &myt; - optional_actions &= ~TCSASOFT; - } - - switch (optional_actions) - { - case TCSANOW: - return __ioctl (fd, TIOCSETA, termios_p); - - case TCSADRAIN: - return __ioctl (fd, TIOCSETAW, termios_p); - - default: - return __ioctl (fd, TIOCSETAF, termios_p); - } -} -libc_hidden_def (tcsetattr) diff --git a/sysdeps/unix/bsd/bsd4.4/wait.c b/sysdeps/unix/bsd/bsd4.4/wait.c deleted file mode 100644 index c561c60a81..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/wait.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1991-2013 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 - . */ - -#include -#include -#include -#include - -/* 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) diff --git a/sysdeps/unix/bsd/bsd4.4/wait3.c b/sysdeps/unix/bsd/bsd4.4/wait3.c deleted file mode 100644 index 4af9b4b916..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/wait3.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1991-2013 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 - . */ - -#include -#include -#include - -/* Wait for a child to exit. When one does, put its status in *STAT_LOC and - return its process ID. For errors return (pid_t) -1. If USAGE is not nil, - store information about the child's resource usage (as a `struct rusage') - there. If the WUNTRACED bit is set in OPTIONS, return status for stopped - children; otherwise don't. */ -pid_t -__wait3 (stat_loc, options, usage) - __WAIT_STATUS stat_loc; - int options; - struct rusage *usage; -{ - return __wait4 (WAIT_ANY, stat_loc, options, usage); -} - -weak_alias (__wait3, wait3) diff --git a/sysdeps/unix/bsd/bsd4.4/waitpid.c b/sysdeps/unix/bsd/bsd4.4/waitpid.c deleted file mode 100644 index f25110ba79..0000000000 --- a/sysdeps/unix/bsd/bsd4.4/waitpid.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1991-2013 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 - . */ - -#include -#include -#include -#include - -/* 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 -__libc_waitpid (pid_t pid, int *stat_loc, int options) -{ - return __wait4 (pid, (union wait *) stat_loc, options, NULL); -} - -weak_alias (__libc_waitpid, __waitpid) -libc_hidden_weak (__waitpid) -weak_alias (__libc_waitpid, waitpid) diff --git a/sysdeps/unix/bsd/cmsg_nxthdr.c b/sysdeps/unix/bsd/cmsg_nxthdr.c new file mode 100644 index 0000000000..1a542fa01a --- /dev/null +++ b/sysdeps/unix/bsd/cmsg_nxthdr.c @@ -0,0 +1,2 @@ +/* The Linux version is perfectly usable on 4.4 BSD. */ +#include diff --git a/sysdeps/unix/bsd/sigblock.c b/sysdeps/unix/bsd/sigblock.c new file mode 100644 index 0000000000..2647327db0 --- /dev/null +++ b/sysdeps/unix/bsd/sigblock.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/bsd/sigsetmask.c b/sysdeps/unix/bsd/sigsetmask.c new file mode 100644 index 0000000000..47f1e36a7f --- /dev/null +++ b/sysdeps/unix/bsd/sigsetmask.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/bsd/sigvec.c b/sysdeps/unix/bsd/sigvec.c new file mode 100644 index 0000000000..d03d9bb3df --- /dev/null +++ b/sysdeps/unix/bsd/sigvec.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/bsd/syscalls.list b/sysdeps/unix/bsd/syscalls.list index e84819dc1f..9f48a144d4 100644 --- a/sysdeps/unix/bsd/syscalls.list +++ b/sysdeps/unix/bsd/syscalls.list @@ -1,14 +1,16 @@ # File name Caller Syscall name # args Strong name Weak names +chflags - chflags 2 chflags +fchflags - fchflags 2 fchflags flock - flock 2 __flock flock getdents - getdirentries 4 __getdirentries getdirentries getdtsz - getdtablesize 0 __getdtablesize getdtablesize getpagesize - getpagesize 0 __getpagesize getpagesize killpg - killpg 2 killpg -sigblock - sigblock 1 __sigblock sigblock +revoke - revoke 1 revoke +setlogin - setlogin 2 setlogin +sigaltstack - sigaltstack 2 __sigaltstack sigaltstack sigpause - sigpause 1 __sigpause sigpause -sigsetmask - sigsetmask 1 __sigsetmask sigsetmask sigstack - sigstack 2 sigstack sigvec - sigvec 3 __sigvec sigvec -wait3 - wait3 3 __wait3 wait3 -waitpid - waitpid 3 __waitpid waitpid +wait4 - wait4 4 __wait4 wait4 diff --git a/sysdeps/unix/bsd/tcdrain.c b/sysdeps/unix/bsd/tcdrain.c new file mode 100644 index 0000000000..bc63a2485a --- /dev/null +++ b/sysdeps/unix/bsd/tcdrain.c @@ -0,0 +1,27 @@ +/* Copyright (C) 1992-2013 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 + . */ + +#include +#include + +/* Wait for pending output to be written on FD. */ +int +__libc_tcdrain (int fd) +{ + return __ioctl (fd, TIOCDRAIN); +} +weak_alias (__libc_tcdrain, tcdrain) diff --git a/sysdeps/unix/bsd/tcgetattr.c b/sysdeps/unix/bsd/tcgetattr.c new file mode 100644 index 0000000000..e5402cddd0 --- /dev/null +++ b/sysdeps/unix/bsd/tcgetattr.c @@ -0,0 +1,40 @@ +/* Copyright (C) 1991-2013 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 + . */ + +#include +#include + +/* These are defined both in and in . + They should have the same values, but perhaps not written the same way. */ +#undef ECHO +#undef MDMBUF +#undef TOSTOP +#undef FLUSHO +#undef PENDIN +#undef NOFLSH +#include + +/* Put the state of FD into *TERMIOS_P. */ +int +__tcgetattr (fd, termios_p) + int fd; + struct termios *termios_p; +{ + return __ioctl (fd, TIOCGETA, termios_p); +} + +weak_alias (__tcgetattr, tcgetattr) diff --git a/sysdeps/unix/bsd/tcsetattr.c b/sysdeps/unix/bsd/tcsetattr.c new file mode 100644 index 0000000000..bd58771549 --- /dev/null +++ b/sysdeps/unix/bsd/tcsetattr.c @@ -0,0 +1,62 @@ +/* Copyright (C) 1992-2013 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 + . */ + +#include +#include +#include + +/* These are defined both in and in . + They should have the same values, but perhaps not written the same way. */ +#undef ECHO +#undef MDMBUF +#undef TOSTOP +#undef FLUSHO +#undef PENDIN +#undef NOFLSH +#include + + +/* Set the state of FD to *TERMIOS_P. */ +int +tcsetattr (fd, optional_actions, termios_p) + int fd; + int optional_actions; + const struct termios *termios_p; +{ + struct termios myt; + + if (optional_actions & TCSASOFT) + { + myt = *termios_p; + myt.c_cflag |= CIGNORE; + termios_p = &myt; + optional_actions &= ~TCSASOFT; + } + + switch (optional_actions) + { + case TCSANOW: + return __ioctl (fd, TIOCSETA, termios_p); + + case TCSADRAIN: + return __ioctl (fd, TIOCSETAW, termios_p); + + default: + return __ioctl (fd, TIOCSETAF, termios_p); + } +} +libc_hidden_def (tcsetattr) diff --git a/sysdeps/unix/bsd/wait.c b/sysdeps/unix/bsd/wait.c new file mode 100644 index 0000000000..c561c60a81 --- /dev/null +++ b/sysdeps/unix/bsd/wait.c @@ -0,0 +1,32 @@ +/* Copyright (C) 1991-2013 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 + . */ + +#include +#include +#include +#include + +/* 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) diff --git a/sysdeps/unix/bsd/wait3.c b/sysdeps/unix/bsd/wait3.c new file mode 100644 index 0000000000..4af9b4b916 --- /dev/null +++ b/sysdeps/unix/bsd/wait3.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1991-2013 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 + . */ + +#include +#include +#include + +/* Wait for a child to exit. When one does, put its status in *STAT_LOC and + return its process ID. For errors return (pid_t) -1. If USAGE is not nil, + store information about the child's resource usage (as a `struct rusage') + there. If the WUNTRACED bit is set in OPTIONS, return status for stopped + children; otherwise don't. */ +pid_t +__wait3 (stat_loc, options, usage) + __WAIT_STATUS stat_loc; + int options; + struct rusage *usage; +{ + return __wait4 (WAIT_ANY, stat_loc, options, usage); +} + +weak_alias (__wait3, wait3) diff --git a/sysdeps/unix/bsd/waitpid.c b/sysdeps/unix/bsd/waitpid.c new file mode 100644 index 0000000000..f25110ba79 --- /dev/null +++ b/sysdeps/unix/bsd/waitpid.c @@ -0,0 +1,43 @@ +/* Copyright (C) 1991-2013 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 + . */ + +#include +#include +#include +#include + +/* 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 +__libc_waitpid (pid_t pid, int *stat_loc, int options) +{ + return __wait4 (pid, (union wait *) stat_loc, options, NULL); +} + +weak_alias (__libc_waitpid, __waitpid) +libc_hidden_weak (__waitpid) +weak_alias (__libc_waitpid, waitpid) diff --git a/sysdeps/unix/sysv/linux/wait3.c b/sysdeps/unix/sysv/linux/wait3.c index 0b3bdee771..2ff027f0e1 100644 --- a/sysdeps/unix/sysv/linux/wait3.c +++ b/sysdeps/unix/sysv/linux/wait3.c @@ -1 +1 @@ -#include +#include -- cgit v1.2.3