summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix')
-rw-r--r--libc/sysdeps/unix/bsd/Implies3
-rw-r--r--libc/sysdeps/unix/bsd/bits/dirent.h32
-rw-r--r--libc/sysdeps/unix/bsd/bits/fcntl.h138
-rw-r--r--libc/sysdeps/unix/bsd/bsd4.4/isatty.c3
-rw-r--r--libc/sysdeps/unix/bsd/isatty.c31
-rw-r--r--libc/sysdeps/unix/bsd/tcdrain.c37
-rw-r--r--libc/sysdeps/unix/bsd/tcgetattr.c129
-rw-r--r--libc/sysdeps/unix/bsd/tcsetattr.c187
-rw-r--r--libc/sysdeps/unix/common/bits/dirent.h32
-rw-r--r--libc/sysdeps/unix/common/bits/fcntl.h119
-rw-r--r--libc/sysdeps/unix/common/syscalls.list15
-rw-r--r--libc/sysdeps/unix/syscalls.list12
-rw-r--r--libc/sysdeps/unix/sysv/linux/Implies3
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/ld.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/ld.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libBrokenLocale.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libBrokenLocale.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libanl.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libanl.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libc.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libcrypt.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libcrypt.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libdl.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libdl.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libm.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libm.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libnsl.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libnsl.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libpthread.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libresolv.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libresolv.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/librt.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/librt.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libthread_db.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libthread_db.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libutil.abilist (renamed from libc/sysdeps/unix/sysv/linux/x86_64/nptl/libutil.abilist)0
-rw-r--r--libc/sysdeps/unix/sysv/syscalls.list6
27 files changed, 12 insertions, 735 deletions
diff --git a/libc/sysdeps/unix/bsd/Implies b/libc/sysdeps/unix/bsd/Implies
index cfc44915d..c30979e17 100644
--- a/libc/sysdeps/unix/bsd/Implies
+++ b/libc/sysdeps/unix/bsd/Implies
@@ -1,5 +1,2 @@
-# The directory unix/common contains things which are common to both BSD
-# and SVR4.
-unix/common
# The directory unix/inet implements sockets and networking in the usual way.
unix/inet
diff --git a/libc/sysdeps/unix/bsd/bits/dirent.h b/libc/sysdeps/unix/bsd/bits/dirent.h
deleted file mode 100644
index e56efc43b..000000000
--- a/libc/sysdeps/unix/bsd/bits/dirent.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Directory entry structure `struct dirent'. 4.2BSD version.
- Copyright (C) 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _DIRENT_H
-# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
-#endif
-
-struct dirent
- {
- unsigned int d_fileno; /* 32 bits. */
- unsigned short int d_reclen; /* 16 bits. */
- unsigned short int d_namlen; /* 16 bits. */
- char d_name[1]; /* Variable length. */
- };
-
-#define _DIRENT_HAVE_D_RECLEN 1
-#define _DIRENT_HAVE_D_NAMLEN 1
diff --git a/libc/sysdeps/unix/bsd/bits/fcntl.h b/libc/sysdeps/unix/bsd/bits/fcntl.h
deleted file mode 100644
index df93999e7..000000000
--- a/libc/sysdeps/unix/bsd/bits/fcntl.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* O_*, F_*, FD_* bit values for 4.3 BSD.
- Copyright (C) 1991, 1992, 1997, 2004 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/>. */
-
-#ifndef _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-
-/* File access modes for `open' and `fcntl'. */
-#define O_RDONLY 0 /* Open read-only. */
-#define O_WRONLY 1 /* Open write-only. */
-#define O_RDWR 2 /* Open read/write. */
-
-
-/* Bits OR'd into the second argument to open. */
-#define O_CREAT 0x0200 /* Create file if it doesn't exist. */
-#define O_EXCL 0x0800 /* Fail if file already exists. */
-#define O_TRUNC 0x0400 /* Truncate file to zero length. */
-/* Apparently not assigning a controlling terminal is the default
- behavior in BSD, so no bit is required to request that behavior. */
-#define O_NOCTTY 0 /* Don't assign a controlling terminal. */
-#if defined __USE_BSD || defined __USE_SVID
-# define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */
-# define O_FSYNC 0x2000 /* Synchronous writes. */
-# define O_SYNC O_FSYNC
-#endif
-
-/* File status flags for `open' and `fcntl'. */
-#define O_APPEND 0x0008 /* Writes append to the file. */
-#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
-
-#ifdef __USE_BSD
-/* BSD before 4.4 doesn't support POSIX.1 O_NONBLOCK,
- but O_NDELAY is close. */
-# define O_NDELAY O_NONBLOCK
-#endif
-
-#ifdef __USE_BSD
-/* Bits in the file status flags returned by F_GETFL.
- These are all the O_* flags, plus FREAD and FWRITE, which are
- independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
- given to `open'. */
-# define FREAD 1
-# define FWRITE 2
-
-/* Traditional BSD names the O_* bits. */
-# define FASYNC O_ASYNC
-# define FCREAT O_CREAT
-# define FEXCL O_EXCL
-# define FTRUNC O_TRUNC
-# define FNOCTTY O_NOCTTY
-# define FFSYNC O_FSYNC
-# define FSYNC O_SYNC
-# define FAPPEND O_APPEND
-# define FNONBLOCK O_NONBLOCK
-# define FNDELAY O_NDELAY
-#endif
-
-/* Mask for file access modes. This is system-dependent in case
- some system ever wants to define some other flavor of access. */
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/* XXX missing */
-#define O_LARGEFILE 0
-
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
-#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW 9 /* Set record locking info (blocking). */
-
-/* XXX missing */
-#define F_GETLK64 7 /* Get record locking info. */
-#define F_SETLK64 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW64 9 /* Set record locking info (blocking). */
-
-/* File descriptor flags used with F_GETFD and F_SETFD. */
-#define FD_CLOEXEC 1 /* Close on exec. */
-
-
-#include <bits/types.h>
-
-/* The structure describing an advisory lock. This is the type of the third
- argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
-struct flock
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
-#ifndef __USE_FILE_OFFSET64
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
-#else
- __off64_t l_start; /* Offset where the lock begins. */
- __off64_t l_len; /* Size of the locked area; zero means until EOF. */
-#endif
- short int l_pid; /* Process holding the lock. */
- short int l_xxx; /* Reserved for future use. */
- };
-
-#ifdef __USE_LARGEFILE64
-struct flock64
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off64_t l_start; /* Offset where the lock begins. */
- __off64_t l_len; /* Size of the locked area; zero means until EOF. */
- short int l_pid; /* Process holding the lock. */
- short int l_xxx; /* Reserved for future use. */
- };
-#endif
-
-/* Values for the `l_type' field of a `struct flock'. */
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
diff --git a/libc/sysdeps/unix/bsd/bsd4.4/isatty.c b/libc/sysdeps/unix/bsd/bsd4.4/isatty.c
deleted file mode 100644
index 473368c93..000000000
--- a/libc/sysdeps/unix/bsd/bsd4.4/isatty.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* In a 4.4-derived world, tcgetattr is just one ioctl. */
-
-#include <sysdeps/posix/isatty.c>
diff --git a/libc/sysdeps/unix/bsd/isatty.c b/libc/sysdeps/unix/bsd/isatty.c
deleted file mode 100644
index e20b62f71..000000000
--- a/libc/sysdeps/unix/bsd/isatty.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 1991,95,96,97,2002 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 <unistd.h>
-#include <sys/ioctl.h>
-
-/* Return 1 if FD is a terminal, 0 if not. */
-int
-__isatty (fd)
- int fd;
-{
- struct sgttyb term;
-
- return __ioctl (fd, TIOCGETP, &term) == 0;
-}
-weak_alias (__isatty, isatty)
diff --git a/libc/sysdeps/unix/bsd/tcdrain.c b/libc/sysdeps/unix/bsd/tcdrain.c
deleted file mode 100644
index 5dc03cc30..000000000
--- a/libc/sysdeps/unix/bsd/tcdrain.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1991, 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <stddef.h>
-#include <termios.h>
-#include <unistd.h>
-
-#include "bsdtty.h"
-
-/* Wait for pending output to be written on FD. */
-int
-__libc_tcdrain (int fd)
-{
- /* The TIOCSETP control waits for pending output to be written before
- affecting its changes, so we use that without changing anything. */
- struct sgttyb b;
- if (__ioctl (fd, TIOCGETP, (void *) &b) < 0 ||
- __ioctl (fd, TIOCSETP, (void *) &b) < 0)
- return -1;
- return 0;
-}
-weak_alias (__libc_tcdrain, tcdrain)
diff --git a/libc/sysdeps/unix/bsd/tcgetattr.c b/libc/sysdeps/unix/bsd/tcgetattr.c
deleted file mode 100644
index b3a54e390..000000000
--- a/libc/sysdeps/unix/bsd/tcgetattr.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Copyright (C) 1991, 1992, 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <stddef.h>
-#include <termios.h>
-
-#include "bsdtty.h"
-
-extern const speed_t __bsd_speeds[]; /* Defined in tcsetattr.c. */
-
-/* Put the state of FD into *TERMIOS_P. */
-int
-__tcgetattr (fd, termios_p)
- int fd;
- struct termios *termios_p;
-{
- struct sgttyb buf;
- struct tchars tchars;
- struct ltchars ltchars;
- int local;
-#ifdef TIOCGETX
- int extra;
-#endif
-
- if (termios_p == NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (__ioctl(fd, TIOCGETP, &buf) < 0 ||
- __ioctl(fd, TIOCGETC, &tchars) < 0 ||
- __ioctl(fd, TIOCGLTC, &ltchars) < 0 ||
-#ifdef TIOCGETX
- __ioctl(fd, TIOCGETX, &extra) < 0 ||
-#endif
- __ioctl(fd, TIOCLGET, &local) < 0)
- return -1;
-
- termios_p->__ispeed = __bsd_speeds[(unsigned char) buf.sg_ispeed];
- termios_p->__ospeed = __bsd_speeds[(unsigned char) buf.sg_ospeed];
-
- termios_p->c_iflag = 0;
- termios_p->c_oflag = 0;
- termios_p->c_cflag = 0;
- termios_p->c_lflag = 0;
- termios_p->c_oflag |= CREAD | HUPCL;
-#ifdef LPASS8
- if (local & LPASS8)
- termios_p->c_oflag |= CS8;
- else
-#endif
- termios_p->c_oflag |= CS7;
- if (!(buf.sg_flags & RAW))
- {
- termios_p->c_iflag |= IXON;
- termios_p->c_cflag |= OPOST;
-#ifndef NOISIG
- termios_p->c_lflag |= ISIG;
-#endif
- }
- if ((buf.sg_flags & (CBREAK|RAW)) == 0)
- termios_p->c_lflag |= ICANON;
- if (!(buf.sg_flags & RAW) && !(local & LLITOUT))
- termios_p->c_oflag |= OPOST;
- if (buf.sg_flags & CRMOD)
- termios_p->c_iflag |= ICRNL;
- if (buf.sg_flags & TANDEM)
- termios_p->c_iflag |= IXOFF;
-#ifdef TIOCGETX
- if (!(extra & NOISIG))
- termios_p->c_lflag |= ISIG;
- if (extra & STOPB)
- termios_p->c_cflag |= CSTOPB;
-#endif
-
- switch (buf.sg_flags & (EVENP|ODDP))
- {
- case EVENP|ODDP:
- break;
- case ODDP:
- termios_p->c_cflag |= PARODD;
- default:
- termios_p->c_cflag |= PARENB;
- termios_p->c_iflag |= IGNPAR | INPCK;
- break;
- }
- if (buf.sg_flags & ECHO)
- termios_p->c_lflag |= _ECHO;
- if (local & LCRTERA)
- termios_p->c_lflag |= ECHOE;
- if (local & LCRTKIL)
- termios_p->c_lflag |= ECHOK;
- if (local & LTOSTOP)
- termios_p->c_lflag |= _TOSTOP;
- if (local & LNOFLSH)
- termios_p->c_lflag |= _NOFLSH;
-
- termios_p->c_cc[VEOF] = tchars.t_eofc;
- termios_p->c_cc[VEOL] = '\n';
- termios_p->c_cc[VERASE] = buf.sg_erase;
- termios_p->c_cc[VKILL] = buf.sg_kill;
- termios_p->c_cc[VINTR] = tchars.t_intrc;
- termios_p->c_cc[VQUIT] = tchars.t_quitc;
- termios_p->c_cc[VSTART] = tchars.t_startc;
- termios_p->c_cc[VSTOP] = tchars.t_stopc;
- termios_p->c_cc[VSUSP] = ltchars.t_suspc;
- termios_p->c_cc[VMIN] = -1;
- termios_p->c_cc[VTIME] = -1;
-
- return 0;
-}
-
-weak_alias (__tcgetattr, tcgetattr)
diff --git a/libc/sysdeps/unix/bsd/tcsetattr.c b/libc/sysdeps/unix/bsd/tcsetattr.c
deleted file mode 100644
index 0741c475e..000000000
--- a/libc/sysdeps/unix/bsd/tcsetattr.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Copyright (C) 1991, 1993, 1996, 1997, 2002 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 <stddef.h>
-#include <termios.h>
-
-#include "bsdtty.h"
-
-
-const speed_t __bsd_speeds[] =
- {
- 0,
- 50,
- 75,
- 110,
- 134,
- 150,
- 200,
- 300,
- 600,
- 1200,
- 1800,
- 2400,
- 4800,
- 9600,
- 19200,
- 38400,
- };
-
-
-/* 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 sgttyb buf;
- struct tchars tchars;
- struct ltchars ltchars;
- int local;
-#ifdef TIOCGETX
- int extra;
-#endif
- size_t i;
-
- if (__ioctl (fd, TIOCGETP, &buf) < 0 ||
- __ioctl (fd, TIOCGETC, &tchars) < 0 ||
- __ioctl (fd, TIOCGLTC, &ltchars) < 0 ||
-#ifdef TIOCGETX
- __ioctl (fd, TIOCGETX, &extra) < 0 ||
-#endif
- __ioctl (fd, TIOCLGET, &local) < 0)
- return -1;
-
- if (termios_p == NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
- switch (optional_actions)
- {
- case TCSANOW:
- break;
- case TCSADRAIN:
- if (tcdrain (fd) < 0)
- return -1;
- break;
- case TCSAFLUSH:
- if (tcflush (fd, TCIFLUSH) < 0)
- return -1;
- break;
- default:
- __set_errno (EINVAL);
- return -1;
- }
-
- buf.sg_ispeed = buf.sg_ospeed = -1;
- for (i = 0; i <= sizeof (__bsd_speeds) / sizeof (__bsd_speeds[0]); ++i)
- {
- if (__bsd_speeds[i] == termios_p->__ispeed)
- buf.sg_ispeed = i;
- if (__bsd_speeds[i] == termios_p->__ospeed)
- buf.sg_ospeed = i;
- }
- if (buf.sg_ispeed == -1 || buf.sg_ospeed == -1)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- buf.sg_flags &= ~(CBREAK|RAW);
- if (!(termios_p->c_lflag & ICANON))
- buf.sg_flags |= (termios_p->c_cflag & ISIG) ? CBREAK : RAW;
-#ifdef LPASS8
- if (termios_p->c_oflag & CS8)
- local |= LPASS8;
- else
- local &= ~LPASS8;
-#endif
- if (termios_p->c_lflag & _NOFLSH)
- local |= LNOFLSH;
- else
- local &= ~LNOFLSH;
- if (termios_p->c_oflag & OPOST)
- local &= ~LLITOUT;
- else
- local |= LLITOUT;
-#ifdef TIOCGETX
- if (termios_p->c_lflag & ISIG)
- extra &= ~NOISIG;
- else
- extra |= NOISIG;
- if (termios_p->c_cflag & CSTOPB)
- extra |= STOPB;
- else
- extra &= ~STOPB;
-#endif
- if (termios_p->c_iflag & ICRNL)
- buf.sg_flags |= CRMOD;
- else
- buf.sg_flags &= ~CRMOD;
- if (termios_p->c_iflag & IXOFF)
- buf.sg_flags |= TANDEM;
- else
- buf.sg_flags &= ~TANDEM;
-
- buf.sg_flags &= ~(ODDP|EVENP);
- if (!(termios_p->c_cflag & PARENB))
- buf.sg_flags |= ODDP | EVENP;
- else if (termios_p->c_cflag & PARODD)
- buf.sg_flags |= ODDP;
- else
- buf.sg_flags |= EVENP;
-
- if (termios_p->c_lflag & _ECHO)
- buf.sg_flags |= ECHO;
- else
- buf.sg_flags &= ~ECHO;
- if (termios_p->c_lflag & ECHOE)
- local |= LCRTERA;
- else
- local &= ~LCRTERA;
- if (termios_p->c_lflag & ECHOK)
- local |= LCRTKIL;
- else
- local &= ~LCRTKIL;
- if (termios_p->c_lflag & _TOSTOP)
- local |= LTOSTOP;
- else
- local &= ~LTOSTOP;
-
- buf.sg_erase = termios_p->c_cc[VERASE];
- buf.sg_kill = termios_p->c_cc[VKILL];
- tchars.t_eofc = termios_p->c_cc[VEOF];
- tchars.t_intrc = termios_p->c_cc[VINTR];
- tchars.t_quitc = termios_p->c_cc[VQUIT];
- ltchars.t_suspc = termios_p->c_cc[VSUSP];
- tchars.t_startc = termios_p->c_cc[VSTART];
- tchars.t_stopc = termios_p->c_cc[VSTOP];
-
- if (__ioctl (fd, TIOCSETP, &buf) < 0 ||
- __ioctl (fd, TIOCSETC, &tchars) < 0 ||
- __ioctl (fd, TIOCSLTC, &ltchars) < 0 ||
-#ifdef TIOCGETX
- __ioctl (fd, TIOCSETX, &extra) < 0 ||
-#endif
- __ioctl (fd, TIOCLSET, &local) < 0)
- return -1;
- return 0;
-}
-libc_hidden_def (tcsetattr)
diff --git a/libc/sysdeps/unix/common/bits/dirent.h b/libc/sysdeps/unix/common/bits/dirent.h
deleted file mode 100644
index 8be701d3d..000000000
--- a/libc/sysdeps/unix/common/bits/dirent.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Directory entry structure `struct dirent'. SVR4 version.
- Copyright (C) 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, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _DIRENT_H
-# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
-#endif
-
-struct dirent
- {
- unsigned int d_fileno;
- int d_off; /* Position in directory of following entry. */
- unsigned short int d_reclen;
- char d_name[1]; /* Variable length. */
- };
-
-#define _DIRENT_HAVE_D_RECLEN 1
-#define _DIRENT_HAVE_D_OFF 1
diff --git a/libc/sysdeps/unix/common/bits/fcntl.h b/libc/sysdeps/unix/common/bits/fcntl.h
deleted file mode 100644
index 8b77444c0..000000000
--- a/libc/sysdeps/unix/common/bits/fcntl.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* O_*, F_*, FD_* bit values for general Unix system.
- Copyright (C) 1991, 1992, 1995, 1997, 2000, 2004
- 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/>. */
-
-#ifndef _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-
-/* File access modes for `open' and `fcntl'. */
-#define O_RDONLY 0 /* Open read-only. */
-#define O_WRONLY 1 /* Open write-only. */
-#define O_RDWR 2 /* Open read/write. */
-
-
-/* Bits OR'd into the second argument to open. */
-#define O_CREAT 0x0100 /* Create file if it doesn't exist. */
-#define O_EXCL 0x0400 /* Fail if file already exists. */
-#define O_TRUNC 0x0200 /* Truncate file to zero length. */
-#define O_NOCTTY 0x0800 /* Don't assign a controlling terminal. */
-#ifdef __USE_MISC
-# define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */
-# define O_FSYNC 0x0010 /* Synchronous writes. */
-# define O_SYNC O_FSYNC
-#endif
-
-/* File status flags for `open' and `fcntl'. */
-#define O_APPEND 0x0008 /* Writes append to the file. */
-#define O_NONBLOCK 0x0080 /* Non-blocking I/O. */
-
-#ifdef __USE_MISC
-# define O_NDELAY 0x0004
-#endif
-
-#ifdef __USE_MISC
-/* Bits in the file status flags returned by F_GETFL.
- These are all the O_* flags, plus FREAD and FWRITE, which are
- independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
- given to `open'. */
-# define FREAD 1
-# define FWRITE 2
-
-/* Traditional Unix names the O_* bits. */
-# define FASYNC O_ASYNC
-# define FCREAT O_CREAT
-# define FEXCL O_EXCL
-# define FTRUNC O_TRUNC
-# define FNOCTTY O_NOCTTY
-# define FFSYNC O_FSYNC
-# define FSYNC O_SYNC
-# define FAPPEND O_APPEND
-# define FNONBLOCK O_NONBLOCK
-# define FNONBIO O_NONBLOCK
-# define FNDELAY O_NDELAY
-#endif
-
-/* Mask for file access modes. This is system-dependent in case
- some system ever wants to define some other flavor of access. */
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 23 /* Get owner (receiver of SIGIO). */
-# define F_SETOWN 24 /* Set owner (receiver of SIGIO). */
-#endif
-#define F_GETLK 14 /* Get record locking info. */
-#define F_SETLK 6 /* Set record locking info (non-blocking). */
-#define F_SETLKW 7 /* Set record locking info (blocking). */
-#ifdef __USE_SVID
-# define F_ALLOCSP 10 /* Allocate space in the file. */
-# define F_FREESP 11 /* Free space in the file. */
-# define F_RGETLK 20 /* Get remote record locking info. */
-# define F_RSETLK 21 /* Set remote locking info (non-blocking). */
-# define F_RSETLKW 22 /* Set remote locking info (blocking). */
-#endif
-
-/* File descriptor flags used with F_GETFD and F_SETFD. */
-#define FD_CLOEXEC 1 /* Close on exec. */
-
-
-#include <bits/types.h>
-
-/* The structure describing an advisory lock. This is the type of the third
- argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
-struct flock
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
- long int l_sysid; /* System ID where locking process resides. */
- __pid_t l_pid; /* Process holding the lock. */
- long int pad[4]; /* Reserved for future use. */
- };
-
-/* Values for the `l_type' field of a `struct flock'. */
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
diff --git a/libc/sysdeps/unix/common/syscalls.list b/libc/sysdeps/unix/common/syscalls.list
deleted file mode 100644
index f0a5ea0a6..000000000
--- a/libc/sysdeps/unix/common/syscalls.list
+++ /dev/null
@@ -1,15 +0,0 @@
-# File name Caller Syscall name # args Strong name Weak names
-
-adjtime - adjtime i:pp __adjtime adjtime
-fchmod - fchmod i:ii __fchmod fchmod
-fchown - fchown i:iii __fchown fchown
-ftruncate - ftruncate i:ii __ftruncate ftruncate
-getrusage - getrusage i:ip __getrusage getrusage
-gettimeofday - gettimeofday i:PP __gettimeofday gettimeofday __gettimeofday_internal
-settimeofday - settimeofday i:PP __settimeofday settimeofday
-setpgid - setpgrp i:ii __setpgid setpgid
-setregid - setregid i:ii __setregid setregid
-setreuid - setreuid i:ii __setreuid setreuid
-sigaction - sigaction i:ipp __sigaction sigaction
-truncate - truncate i:si __truncate truncate
-vhangup - vhangup i:i vhangup
diff --git a/libc/sysdeps/unix/syscalls.list b/libc/sysdeps/unix/syscalls.list
index 6f423bf44..5c696b31c 100644
--- a/libc/sysdeps/unix/syscalls.list
+++ b/libc/sysdeps/unix/syscalls.list
@@ -2,6 +2,7 @@
access - access i:si __access access
acct - acct i:S acct
+adjtime - adjtime i:pp __adjtime adjtime
chdir - chdir i:s __chdir chdir
chmod - chmod i:si __chmod chmod
chown - chown i:sii __chown __chown_internal chown
@@ -11,9 +12,12 @@ dup - dup i:i __dup dup
dup2 - dup2 i:ii __dup2 dup2
dup3 - dup3 i:iii dup3
fchdir - fchdir i:i __fchdir fchdir
+fchmod - fchmod i:ii __fchmod fchmod
+fchown - fchown i:iii __fchown fchown
fcntl - fcntl Ci:iiF __libc_fcntl __fcntl __fcntl_internal fcntl
fstatfs - fstatfs i:ip __fstatfs fstatfs
fsync - fsync Ci:i __libc_fsync fsync
+ftruncate - ftruncate i:ii __ftruncate ftruncate
getdomain - getdomainname i:si getdomainname
getgid - getgid Ei: __getgid getgid
getgroups - getgroups i:ip __getgroups getgroups
@@ -21,6 +25,8 @@ getitimer - getitimer i:ip __getitimer getitimer
getpid - getpid Ei: __getpid getpid
getpriority - getpriority i:ii getpriority
getrlimit - getrlimit i:ip __getrlimit getrlimit
+getrusage - getrusage i:ip __getrusage getrusage
+gettimeofday - gettimeofday i:PP __gettimeofday gettimeofday __gettimeofday_internal
getuid - getuid Ei: __getuid getuid
ioctl - ioctl i:iiI __ioctl ioctl
kill - kill i:ii __kill kill
@@ -48,11 +54,15 @@ seteuid - seteuid i:i __seteuid seteuid
setgid - setgid i:i __setgid setgid
setgroups - setgroups i:ip setgroups
setitimer - setitimer i:ipp __setitimer setitimer
+setpgid - setpgrp i:ii __setpgid setpgid
setpriority - setpriority i:iii setpriority
+setregid - setregid i:ii __setregid setregid
+setreuid - setreuid i:ii __setreuid setreuid
setrlimit - setrlimit i:ip __setrlimit setrlimit
setsid - setsid i: __setsid setsid
settimeofday - settimeofday i:PP __settimeofday settimeofday
setuid - setuid i:i __setuid setuid
+sigaction - sigaction i:ipp __sigaction sigaction
sigsuspend - sigsuspend Ci:p sigsuspend
sstk - sstk b:i sstk
statfs - statfs i:sp __statfs statfs
@@ -61,9 +71,11 @@ swapon - swapon i:s swapon
symlink - symlink i:ss __symlink symlink
sync - sync i: sync
syncfs - syncfs i:i syncfs
+truncate - truncate i:si __truncate truncate
umask - umask Ei:i __umask umask
uname - uname i:p __uname uname
unlink - unlink i:s __unlink unlink
utimes - utimes i:sp __utimes utimes
+vhangup - vhangup i:i vhangup
write - write Ci:ibn __libc_write __write write
writev - writev Ci:ipi __writev writev
diff --git a/libc/sysdeps/unix/sysv/linux/Implies b/libc/sysdeps/unix/sysv/linux/Implies
index ab04990ad..b04bb6b33 100644
--- a/libc/sysdeps/unix/sysv/linux/Implies
+++ b/libc/sysdeps/unix/sysv/linux/Implies
@@ -2,8 +2,5 @@
# Hurd-based GNU systems.
gnu
-# Linux shares most of the syscalls which are also common to BSD and SVR4.
-unix/common
-
# Linux has network support in the kernel.
unix/inet
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/ld.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/ld.abilist
index fb1e8d481..fb1e8d481 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/ld.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/ld.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libBrokenLocale.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libBrokenLocale.abilist
index be74b4bf0..be74b4bf0 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libBrokenLocale.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libBrokenLocale.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libanl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libanl.abilist
index a525e60f6..a525e60f6 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libanl.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libanl.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libc.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
index 6f15f00e1..6f15f00e1 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libc.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libcrypt.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libcrypt.abilist
index 23d4ce006..23d4ce006 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libcrypt.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libcrypt.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libdl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libdl.abilist
index 61c587b0b..61c587b0b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libdl.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libdl.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libm.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libm.abilist
index 7bf568c51..7bf568c51 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libm.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libm.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libnsl.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libnsl.abilist
index a6aa9125b..a6aa9125b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libnsl.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libnsl.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libpthread.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist
index 7c33f350d..7c33f350d 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libpthread.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libresolv.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libresolv.abilist
index 330393617..330393617 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libresolv.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libresolv.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/librt.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/librt.abilist
index 2bd7ff403..2bd7ff403 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/librt.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/librt.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libthread_db.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libthread_db.abilist
index eed6765bc..eed6765bc 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libthread_db.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libthread_db.abilist
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libutil.abilist b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libutil.abilist
index 78e6cf526..78e6cf526 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/nptl/libutil.abilist
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libutil.abilist
diff --git a/libc/sysdeps/unix/sysv/syscalls.list b/libc/sysdeps/unix/sysv/syscalls.list
index dc6a4311f..c508dd0ec 100644
--- a/libc/sysdeps/unix/sysv/syscalls.list
+++ b/libc/sysdeps/unix/sysv/syscalls.list
@@ -1,15 +1,9 @@
# File name Caller Syscall name # args Strong name Weak names
alarm - alarm i:i alarm
-ftime - ftime i:p ftime
-nice - nice i:i nice
pause - pause Ci: pause
-poll - poll Ci:pii poll
setrlimit - setrlimit i:ip __setrlimit setrlimit
settimeofday - settimeofday i:PP __settimeofday settimeofday
-signal - signal i:ii signal
stime - stime i:p stime
-time - time Ei:P time
-times - times Ei:p __times times
ulimit - ulimit i:ii ulimit
utime - utime i:sP utime