summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv')
-rw-r--r--libc/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/chown.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ifaddrs.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ldsodefs.h23
-rw-r--r--libc/sysdeps/unix/sysv/linux/mmap64.c6
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h19
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h124
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h75
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h84
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c48
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c142
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c52
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c155
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c170
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h7
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/init-first.c16
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S2
-rw-r--r--libc/sysdeps/unix/sysv/linux/ptsname.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/sa_len.c5
-rw-r--r--libc/sysdeps/unix/sysv/linux/sa_len.c72
-rw-r--r--libc/sysdeps/unix/sysv/linux/socketcall.h2
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/tst-fanotify.c56
27 files changed, 106 insertions, 972 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/Makefile b/libc/sysdeps/unix/sysv/linux/Makefile
index 94916a2b1..234d5a747 100644
--- a/libc/sysdeps/unix/sysv/linux/Makefile
+++ b/libc/sysdeps/unix/sysv/linux/Makefile
@@ -38,7 +38,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
bits/mman-linux.h
-tests += tst-clone
+tests += tst-clone tst-fanotify
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
@@ -120,7 +120,7 @@ ifeq ($(subdir),socket)
sysdep_headers += net/if_ppp.h net/ppp-comp.h \
net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
net/if_slip.h net/if_packet.h net/if_shaper.h
-sysdep_routines += cmsg_nxthdr sa_len
+sysdep_routines += cmsg_nxthdr
endif
ifeq ($(subdir),sunrpc)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/chown.c b/libc/sysdeps/unix/sysv/linux/i386/chown.c
index 94f294007..5fa640285 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/chown.c
@@ -49,7 +49,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-/* Compiling for compatibiity. */
+/* Compiling for compatibility. */
int
attribute_compat_text_section
__chown_is_lchown (const char *file, uid_t owner, gid_t group)
diff --git a/libc/sysdeps/unix/sysv/linux/ifaddrs.c b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
index 5c1e380fc..89fda156a 100644
--- a/libc/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/libc/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -301,7 +301,7 @@ map_newlink (int index, struct ifaddrs_storage *ifas, int *map, int max)
return i;
}
- /* This means interfaces changed inbetween the reading of the
+ /* This means interfaces changed between the reading of the
RTM_GETLINK and RTM_GETADDR information. We have to repeat
everything. */
return -1;
diff --git a/libc/sysdeps/unix/sysv/linux/ldsodefs.h b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
index 18ff8528c..ef4866727 100644
--- a/libc/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/libc/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -18,14 +18,11 @@
#ifndef _LDSODEFS_H
-#include <libc-abis.h>
#include <kernel-features.h>
/* Get the real definitions. */
#include_next <ldsodefs.h>
-/* Now define our stuff. */
-
/* We have the auxiliary vector. */
#define HAVE_AUX_VECTOR
@@ -41,24 +38,4 @@
up the page size information. */
#define HAVE_AUX_PAGESIZE
-/* Accept binaries which identify the binary as using Linux extensions. */
-#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \
- || memcmp (hdr, expected2, size) == 0)
-#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
- || osabi == ELFOSABI_LINUX)
-#define VALID_ELF_ABIVERSION(osabi,ver) \
- (ver == 0 || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX))
-#define MORE_ELF_HEADER_DATA \
- static const unsigned char expected2[EI_PAD] = \
- { \
- [EI_MAG0] = ELFMAG0, \
- [EI_MAG1] = ELFMAG1, \
- [EI_MAG2] = ELFMAG2, \
- [EI_MAG3] = ELFMAG3, \
- [EI_CLASS] = ELFW(CLASS), \
- [EI_DATA] = byteorder, \
- [EI_VERSION] = EV_CURRENT, \
- [EI_OSABI] = ELFOSABI_LINUX \
- }
-
#endif /* ldsodefs.h */
diff --git a/libc/sysdeps/unix/sysv/linux/mmap64.c b/libc/sysdeps/unix/sysv/linux/mmap64.c
index e2dcdc4d9..7d367ca83 100644
--- a/libc/sysdeps/unix/sysv/linux/mmap64.c
+++ b/libc/sysdeps/unix/sysv/linux/mmap64.c
@@ -19,6 +19,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <string.h>
#include <sysdep.h>
#include <sys/syscall.h>
@@ -42,9 +43,8 @@ __mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
#if MMAP2_PAGE_SHIFT == -1
if (page_shift == 0)
{
- int page_size = getpagesize ();
- while ((1 << ++page_shift) != page_size)
- ;
+ int page_size = __getpagesize ();
+ page_shift = __ffs (page_size) - 1;
}
#endif
if (offset & ((1 << page_shift) - 1))
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
deleted file mode 100644
index c18e9fa4b..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "aix-types.h"
-
-struct aixdirent
- {
- aixino_t d_ino;
- aixoff_t d_off;
- unsigned short int d_reclen;
- unsigned short int d_namlen;
- char d_name[256]; /* We must not include limits.h! */
- };
-
-struct aixdirent64
- {
- aixino64_t d_ino;
- aixoff64_t d_off;
- unsigned short int d_reclen;
- unsigned short int d_namlen;
- char d_name[256]; /* We must not include limits.h! */
- };
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
deleted file mode 100644
index 38f6e210d..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright (C) 1999-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
- <http://www.gnu.org/licenses/>. */
-
-#define AIX_EPERM 1
-#define AIX_ENOENT 2
-#define AIX_ESRCH 3
-#define AIX_EINTR 4
-#define AIX_EIO 5
-#define AIX_ENXIO 6
-#define AIX_E2BIG 7
-#define AIX_ENOEXEC 8
-#define AIX_EBADF 9
-#define AIX_ECHILD 10
-#define AIX_EAGAIN 11
-#define AIX_ENOMEM 12
-#define AIX_EACCES 13
-#define AIX_EFAULT 14
-#define AIX_ENOTBLK 15
-#define AIX_EBUSY 16
-#define AIX_EEXIST 17
-#define AIX_EXDEV 18
-#define AIX_ENODEV 19
-#define AIX_ENOTDIR 20
-#define AIX_EISDIR 21
-#define AIX_EINVAL 22
-#define AIX_ENFILE 23
-#define AIX_EMFILE 24
-#define AIX_ENOTTY 25
-#define AIX_ETXTBSY 26
-#define AIX_EFBIG 27
-#define AIX_ENOSPC 28
-#define AIX_ESPIPE 29
-#define AIX_EROFS 30
-#define AIX_EMLINK 31
-#define AIX_EPIPE 32
-#define AIX_EDOM 33
-#define AIX_ERANGE 34
-#define AIX_ENOMSG 35
-#define AIX_EIDRM 36
-#define AIX_ECHRNG 37
-#define AIX_EL2NSYNC 38
-#define AIX_EL3HLT 39
-#define AIX_EL3RST 40
-#define AIX_ELNRNG 41
-#define AIX_EUNATCH 42
-#define AIX_ENOCSI 43
-#define AIX_EL2HLT 44
-#define AIX_EDEADLK 45
-#define AIX_ENOTREADY 46
-#define AIX_EWRPROTECT 47
-#define AIX_EFORMAT 48
-#define AIX_ENOLCK 49
-#define AIX_ENOCONNECT 50
-#define AIX_ESTALE 52
-#define AIX_EDIST 53
-#define AIX_EWOULDBLOCK 54
-#define AIX_EINPROGRESS 55
-#define AIX_EALREADY 56
-#define AIX_ENOTSOCK 57
-#define AIX_EDESTADDRREQ 58
-#define AIX_EMSGSIZE 59
-#define AIX_EPROTOTYPE 60
-#define AIX_ENOPROTOOPT 61
-#define AIX_EPROTONOSUPPORT 62
-#define AIX_ESOCKTNOSUPPORT 63
-#define AIX_EOPNOTSUPP 64
-#define AIX_EPFNOSUPPORT 65
-#define AIX_EAFNOSUPPORT 66
-#define AIX_EADDRINUSE 67
-#define AIX_EADDRNOTAVAIL 68
-#define AIX_ENETDOWN 69
-#define AIX_ENETUNREACH 70
-#define AIX_ENETRESET 71
-#define AIX_ECONNABORTED 72
-#define AIX_ECONNRESET 73
-#define AIX_ENOBUFS 74
-#define AIX_EISCONN 75
-#define AIX_ENOTCONN 76
-#define AIX_ESHUTDOWN 77
-#define AIX_ETIMEDOUT 78
-#define AIX_ECONNREFUSED 79
-#define AIX_EHOSTDOWN 80
-#define AIX_EHOSTUNREACH 81
-#define AIX_ERESTART 82
-#define AIX_EPROCLIM 83
-#define AIX_EUSERS 84
-#define AIX_ELOOP 85
-#define AIX_ENAMETOOLONG 86
-#define AIX_EDQUOT 88
-#define AIX_ECORRUPT 89
-#define AIX_EREMOTE 93
-#define AIX_ENOSYS 109
-#define AIX_EMEDIA 110
-#define AIX_ESOFT 111
-#define AIX_ENOATTR 112
-#define AIX_ESAD 113
-#define AIX_ENOTRUST 114
-#define AIX_ETOOMANYREFS 115
-#define AIX_EILSEQ 116
-#define AIX_ECANCELED 117
-#define AIX_ENOSR 118
-#define AIX_ETIME 119
-#define AIX_EBADMSG 120
-#define AIX_EPROTO 121
-#define AIX_ENODATA 122
-#define AIX_ENOSTR 123
-#define AIX_ENOTSUP 124
-#define AIX_EMULTIHOP 125
-#define AIX_ENOLINK 126
-#define AIX_EOVERFLOW 127
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
deleted file mode 100644
index 2b092c2b1..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (C) 1999-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
- <http://www.gnu.org/licenses/>. */
-
-struct aixstat
- {
- aixdev_t st_dev;
- aixino_t st_ino;
- aixmode_t st_mode;
- aixnlink_t st_nlink;
- unsigned short int st_flag;
- aixuid_t st_uid;
- aixgid_t st_gid;
- aixdev_t st_rdev;
- aixoff_t st_size;
- aixtime_t st_atime;
- unsigned long int __unused1;
- aixtime_t st_mtime;
- unsigned long int __unused2;
- aixtime_t st_ctime;
- unsigned long int __unused3;
- aixblksize_t st_blksize;
- aixblkcnt_t st_blocks;
- int st_vfstype;
- unsigned int st_vfs;
- unsigned int st_type;
- unsigned int st_gen;
-
-#define _STATBUF_RESERVED_SPACE 9
- unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
- };
-
-struct aixstat64
- {
- aixdev_t st_dev;
- aixino64_t st_ino;
- aixmode_t st_mode;
- aixnlink_t st_nlink;
- unsigned short int st_flag;
- aixuid_t st_uid;
- aixgid_t st_gid;
- aixdev_t st_rdev;
- int st_ssize;
- aixtime_t st_atime;
- unsigned long int __unused1;
- aixtime_t st_mtime;
- unsigned long int __unused2;
- aixtime_t st_ctime;
- unsigned long int __unused3;
- aixblksize_t st_blksize;
- aixblkcnt64_t st_blocks;
- int st_vfstype;
- unsigned int st_vfs;
- unsigned int st_type;
- unsigned int st_gen;
- unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
- unsigned int st_padto_ll;
- aixoff64_t st_size;
- };
-
-#define aix_major(x) (int) ((unsigned int) (x) >> 16)
-#define aix_minor(x) (int) ((x) & 0xFFFF)
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h b/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
deleted file mode 100644
index b4414e687..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-#include "aix-types.h"
-
-#define AIX_NCCS 16
-struct aixtermios
-{
- aixtcflag_t c_iflag;
- aixtcflag_t c_oflag;
- aixtcflag_t c_cflag;
- aixtcflag_t c_lflag;
- aixcc_t c_line;
- aixcc_t c_cc[AIX_NCCS];
- aixspeed_t c_ispeed;
- aixspeed_t c_ospeed;
-};
-
-#define AIX_VINTR 0
-#define AIX_VQUIT 1
-#define AIX_VERASE 2
-#define AIX_VKILL 3
-#define AIX_VEOF 4
-#define AIX_VEOL 5
-#define AIX_VEOL2 6
-#define AIX_VSTART 7
-#define AIX_VSTOP 8
-#define AIX_VSUSP 9
-#define AIX_VDSUSP 10
-#define AIX_VREPRINT 11
-#define AIX_VDISCRD 12
-#define AIX_VWERSE 13
-#define AIX_VLNEXT 14
-
-#define AIX_IUCLC 0x00000800
-#define AIX_IXANY 0x00001000
-#define AIX_IMAXBE 0x00010000
-
-#define AIX_OLCUC 0x00000002
-#define AIX_ONLCR 0x00000004
-#define AIX_TABDLY 0x00000c00
-#define AIX_TAB0 0x00000000
-#define AIX_TAB1 0x00000400
-#define AIX_TAB2 0x00000800
-#define AIX_TAB3 0x00000c00
-#define AIX_BSDLY 0x00001000
-#define AIX_BS0 0x00000000
-#define AIX_BS1 0x00001000
-#define AIX_FFDLY 0x00002000
-#define AIX_FF0 0x00000000
-#define AIX_FF1 0x00002000
-#define AIX_NLDLY 0x00004000
-#define AIX_NL0 0x00000000
-#define AIX_NL1 0x00004000
-#define AIX_VTDLY 0x00008000
-#define AIX_VT0 0x00000000
-#define AIX_VT1 0x00008000
-
-#define AIX_CBAUD 0x0000000f
-#define AIX_CSIZE 0x00000030
-#define AIX_CS5 0x00000000
-#define AIX_CS6 0x00000010
-#define AIX_CS7 0x00000020
-#define AIX_CS8 0x00000030
-#define AIX_CSTOPB 0x00000040
-#define AIX_CREAD 0x00000080
-#define AIX_PARENB 0x00000100
-#define AIX_PARODD 0x00000200
-#define AIX_HUPCL 0x00000400
-#define AIX_CLOCAL 0x00000800
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
deleted file mode 100644
index 315ebacbf..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-#include <dirent.h>
-#include <string.h>
-#include "linux-dirent.h"
-
-#ifndef DT_UNKNOWN
-# define DT_UNKNOWN 0
-#endif
-
-
-void
-__dirent_aix_to_linux (const struct aixdirent *aixdir,
- struct dirent *linuxdir)
-{
- linuxdir->d_ino = aixdir->d_ino;
- linuxdir->d_off = aixdir->d_off;
- linuxdir->d_reclen = aixdir->d_reclen;
- linuxdir->d_type = DT_UNKNOWN;
- memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
-}
-
-
-void
-__dirent64_aix_to_linux (const struct aixdirent64 *aixdir,
- struct dirent64 *linuxdir)
-{
- linuxdir->d_ino = aixdir->d_ino;
- linuxdir->d_off = aixdir->d_off;
- linuxdir->d_reclen = aixdir->d_reclen;
- linuxdir->d_type = DT_UNKNOWN;
- memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
deleted file mode 100644
index d543f1777..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Convert the error number the AIX kernel returns to what the Linux
- application expects.
- Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include "linux-errno.h"
-
-
-static int mapping[] =
-{
- [AIX_EPERM] = EPERM,
- [AIX_ENOENT] = ENOENT,
- [AIX_ESRCH] = ESRCH,
- [AIX_EINTR] = EINTR,
- [AIX_EIO] = EIO,
- [AIX_ENXIO] = ENXIO,
- [AIX_E2BIG] = E2BIG,
- [AIX_ENOEXEC] = ENOEXEC,
- [AIX_EBADF] = EBADF,
- [AIX_ECHILD] = ECHILD,
- [AIX_EAGAIN] = EAGAIN,
- [AIX_ENOMEM] = ENOMEM,
- [AIX_EACCES] = EACCES,
- [AIX_EFAULT] = EFAULT,
- [AIX_ENOTBLK] = ENOTBLK,
- [AIX_EBUSY] = EBUSY,
- [AIX_EEXIST] = EEXIST,
- [AIX_EXDEV] = EXDEV,
- [AIX_ENODEV] = ENODEV,
- [AIX_ENOTDIR] = ENOTDIR,
- [AIX_EISDIR] = EISDIR,
- [AIX_EINVAL] = EINVAL,
- [AIX_ENFILE] = ENFILE,
- [AIX_EMFILE] = EMFILE,
- [AIX_ENOTTY] = ENOTTY,
- [AIX_ETXTBSY] = ETXTBSY,
- [AIX_EFBIG] = EFBIG,
- [AIX_ENOSPC] = ENOSPC,
- [AIX_EIDRM] = EIDRM,
- [AIX_ECHRNG] = ECHRNG,
- [AIX_EL2NSYNC] = EL2NSYNC,
- [AIX_EL3HLT] = EL3HLT,
- [AIX_EL3RST] = EL3RST,
- [AIX_ELNRNG] = ELNRNG,
- [AIX_EUNATCH] = EUNATCH,
- [AIX_ENOCSI] = ENOCSI,
- [AIX_EL2HLT] = EL2HLT,
- [AIX_EDEADLK] = EDEADLK,
- [AIX_ENOTREADY] = ENOTREADY,
- // EWPROTECT: no Linux equivalent
- // EFORMAT: no Linux equivalent
- [AIX_ENOLCK] = ENOLCK,
- // ENOCONNECT: No Linux equivalent
- [AIX_ESTALE] = ESTALE,
- // EDIST: no Linux equivalent
- [54] = EAGAIN, // EWOULDBLOCK
- [AIX_EINPROGRESS] = EINPROGRESS,
- [AIX_EALREADY] = EALREADY,
- [AIX_ENOTSOCK] = ENOTSOCK,
- [AIX_EDESTADDRREQ] = EDESTADDRREQ,
- [AIX_EMSGSIZE] = EMSGSIZE,
- [AIX_EPROTOTYPE] = EPROTOTYPE,
- [AIX_ENOPROTOOPT] = ENOPROTOOPT,
- [AIX_EPROTONOSUPPORT] = EPROTONOSUPPORT,
- [AIX_ESOCKTNOSUPPORT] = ESOCKTNOSUPPORT,
- [AIX_EOPNOTSUPP] = EOPNOTSUPP,
- [AIX_EPFNOSUPPORT] = EPFNOSUPPORT,
- [AIX_EAFNOSUPPORT] = EAFNOSUPPORT,
- [AIX_EADDRINUSE] = EADDRINUSE,
- [AIX_EADDRNOTAVAIL] = EADDRNOTAVAIL,
- [AIX_ENETDOWN] = ENETDOWN,
- [AIX_ENETUNREACH] = ENETUNREACH,
- [AIX_ENETRESET] = ENETRESET,
- [AIX_ECONNABORTED] = ECONNABORTED,
- [AIX_ECONNRESET] = ECONNRESET,
- [AIX_ENOBUFS] = ENOBUFS,
- [AIX_EISCONN] = EISCONN,
- [AIX_ENOTCONN] = ENOTCONN,
- [AIX_ESHUTDOWN] = ESHUTDOWN,
- [AIX_ETIMEDOUT] = ETIMEDOUT,
- [AIX_ECONNREFUSED] = ECONNREFUSED,
- [AIX_EHOSTDOWN] = EHOSTDOWN,
- [AIX_EHOSTUNREACH] = EHOSTUNREACH,
- [AIX_ERESTART] = ERESTART,
- [AIX_EPROCLIM] = EPROCLIM,
- [AIX_EUSERS] = EUSERS,
- [AIX_ELOOP] = ELOOP,
- [AIX_ENAMETOOLONG] = ENAMETOOLONG,
- [87] = ENOTEMPTY, // ENOTEMPTY
- [AIX_EDQUOT] = EDQUOT,
- [AIX_ECORRUPT] = ECORRUPT,
- [AIX_EREMOTE] = EREMOTE,
- [AIX_ENOSYS] = ENOSYS,
- [AIX_EMEDIA] = EMEDIA,
- [AIX_ESOFT] = ESOFT,
- [AIX_ENOATTR] = ENOATTR,
- [AIX_ESAD] = ESAD,
- // ENOTRUST: no Linux equivalent
- [AIX_ETOOMANYREFS] = ETOOMANYREFS,
- [AIX_EILSEQ] = EILSEQ,
- [AIX_ECANCELED] = ECANCELED,
- [AIX_ENOSR] = ENOSR,
- [AIX_ETIME] = ETIME,
- [AIX_EBADMSG] = EBADMSG,
- [AIX_EPROTO] = EPROTO,
- [AIX_ENODATA] = ENODATA,
- [AIX_ENOSTR] = ENOSTR,
- [AIX_ENOTSUP] = ENOTSUP,
- [AIX_EMULTIHOP] = EMULTIHOP,
- [AIX_ENOLINK] = ENOLINK,
- [AIX_EOVERFLOW] = EOVERFLOW
-};
-
-
-int
-__errno_aix_to_linux (int err)
-{
- int conv;
-
- if (err >= 0 && err < (sizeof (mapping) / sizeof (mapping[0]))
- && ((conv = mapping[err]) != 0 || err == 0))
- return conv;
-
- /* The error value is not known. Create a special value which can
- be easily recognized as an invalid result. */
- return 512 + err;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
deleted file mode 100644
index a01cc0a20..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-void
-__stat_aix_to_linux (const struct aixstat *aixstat, struct stat *linuxstat)
-{
- linuxstat->st_dev = makedev (aix_major (aixstat->st_dev),
- aix_minor (aixstat->st_dev));
- linuxstat->st_ino = aixstat->st_ino;
- /* The following assumes that the mode values are the same on AIX
- and Linux which is true in the moment. */
- linuxstat->st_mode = aixstat->st_mode;
- linuxstat->st_nlink = aixstat->st_nlink;
- /* There is no st_flag field in Linux. */
- linuxstat->st_uid = aixstat->st_uid;
- linuxstat->st_gid = aixstat->st_gid;
- linuxstat->st_rdev = makedev (aix_major (aixstat->st_rdev),
- aix_minor (aixstat->st_rdev));
- linuxstat->st_size = aixstat->st_size;
- linuxstat->st_atime = aixstat->st_atime;
- linuxstat->st_mtime = aixstat->st_mtime;
- linuxstat->st_ctime = aixstat->st_ctime;
- linuxstat->st_blksize = aixstat->st_blksize;
- linuxstat->st_blocks = aixstat->st_blocks;
- /* There is no st_vfstype in Linux. */
- /* There is no st_vfs in Linux. */
- /* There is no st_type in Linux. */
- /* There is no st_gen in Linux. */
-
- /* File in the padding values with repeatable values. */
- linuxstat->__pad1 = 0;
- linuxstat->__pad2 = 0;
- linuxstat->__unused1 = 0;
- linuxstat->__unused2 = 0;
- linuxstat->__unused3 = 0;
- linuxstat->__unused4 = 0;
- linuxstat->__unused5 = 0;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c
deleted file mode 100644
index 5e281f661..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcgetattr.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <termios.h>
-#include "aix-termios.h"
-
-int
-tcgetattr (fd, linuxtermios_p)
- int fd;
- struct termios *linuxtermios_p;
-{
- struct aixtermios aixtermios;
- int result;
-
- result = /* make syscall */;
-
- if (result != -1)
- {
- /* Convert the result. */
-
- linuxtermios_p->c_cc[VINTR] = aixtermios.c_cc[AIX_VINTR];
- linuxtermios_p->c_cc[VQUIT] = aixtermios.c_cc[AIX_VQUIT];
- linuxtermios_p->c_cc[VERASE] = aixtermios.c_cc[AIX_VERASE];
- linuxtermios_p->c_cc[VKILL] = aixtermios.c_cc[AIX_VKILL];
- linuxtermios_p->c_cc[VEOF] = aixtermios.c_cc[AIX_VEOF];
- // XXX VMIN has the same value as VEOF !?
- linuxtermios_p->c_cc[VEOL] = aixtermios.c_cc[AIX_VEOL];
- // XXX VTIME has the same value as VEOL !?
- linuxtermios_p->c_cc[VEOL2] = aixtermios.c_cc[AIX_VEOL2];
- linuxtermios_p->c_cc[VSTART] = aixtermios.c_cc[AIX_VSTART];
- linuxtermios_p->c_cc[VSTOP] = aixtermios.c_cc[AIX_VSTOP];
- linuxtermios_p->c_cc[VSUSP] = aixtermios.c_cc[AIX_VSUSP];
- // XXX No Linux equivalent for VDSUSP !?
- linuxtermios_p->c_cc[VREPRINT] = aixtermios.c_cc[AIX_VREPRINT];
- linuxtermios_p->c_cc[VDISCARD] = aixtermios.c_cc[AIX_VDISCARD];
- linuxtermios_p->c_cc[VWERASE] = aixtermios.c_cc[AIX_VWERASE];
- linuxtermios_p->c_cc[VLNEXT] = aixtermios.c_cc[AIX_VLNEXT];
-
- linuxtermios_p->c_cflag = aixtermios.c_c_flag & AIX_CBAUD;
-
- /* Only the IUCLC, IXANY, and IMAXBEL values are different in the
- c_iflag member. */
- linuxtermios_p->c_iflag = aixtermios.c_iflag & 0x7ff;
- if (aixtermios.c_iflag & AIX_IXANY)
- linuxtermios_p->c_iflag |= IXANY;
- if (aixtermios.c_iflag & AIX_IUCLC)
- linuxtermios_p->c_iflag |= IUCLC;
- if (aixtermios.c_iflag & AIX_IMAXBEL)
- linuxtermios_p->c_iflag |= IMAXBEL;
-
- /* Many of the c_oflag files differ. Bummer. */
- linuxtermios_p->c_oflag = (aixtermios.c_oflag
- & (OPOST | OCRNL | ONOCR | ONLRET | OFILL
- | OFDEL | TABDLY));
- if (aixtermios.c_oflag & AIX_OLCUC)
- linuxtermios_p->c_oflag |= OLCUC;
- if (aixtermios.c_oflag & AIX_ONLCR)
- linuxtermios_p->c_oflag |= ONLCR;
- if (aixtermiosc_oflag & AIX_NLDLY)
- linuxtermios_p->c_oflag |= NL1;
-
- if (aixtermiosc_oflag.c_oflag & AIX_TABDLY)
- {
-#define offset 2
-#if AIX_TAB1 << offset != TAB1 || AIX_TAB3 << offset != TAB3
-# error "Check the offset"
-#endif
- linuxtermios_p->c_oflag |= (aixtermios.c_oflag >> offset) & TABDLY;
-#undef offset
- }
- if (aixtermios.c_oflag & AIX_FFDLY)
- linuxtermios_p->c_oflag |= FF1;
- if (aixtermios.c_oflag & AIX_BSDLY)
- linuxtermios_p->c_oflag |= BS1;
- if (aixtermios.c_oflag & AIX_VTDLY)
- linuxtermios_p->c_oflag |= VT1;
-
- /* A lot of the c_cflag member is also different. */
- if (aixtermios.c_cflag & AIX_CSIZE)
- {
-#define offset 4
-#if CSIZE >> offset != AIX_CSIZE
-# error "Check the offset"
-#endif
- linuxtermios_p->c_cflag |= (aixtermios.c_cflag >> offset) & CSIZE;
-#undef offset
- }
-
- if (aixtermios.c_cflag & AIX_STOPB)
- linuxtermios_p->c_cflag |= STOPB;
- if (aixtermios.c_cflag & AIX_CREAD)
- linuxtermios_p->c_cflag |= CREAD;
- if (aixtermios.cflag & AIX_PARENB)
- linuxtermios_p->c_cflag |= PARENB;
- if (aixtermios.cflag & AIX_PARODD)
- linuxtermios_p->c_cflag |= PARODD;
- if (aixtermios.c_cflag & AIX_HUPCL)
- linuxtermios_p->c_cflag |= HUPCL;
- if (aixtermios.c_cflag & AIX_CLOCAL)
- linuxtermios_p->c_cflag |= CLOCAL;
-
- /* The c_lflag is information is also different. */
- aixtermios.c_lflag = 0;
- if (aixtermios.c_lflag & AIX_ISIG)
- linuxtermios_p->c_lflag |= ISIG;
- if (aixtermios.c_lflag & AIX_ICANON)
- linuxtermios_p->c_lflag |= ICANON;
- if (aixtermios.c_lflag & AIX_XCASE)
- linuxtermios_p->c_lflag |= XCASE;
- if (aixtermios.c_lflag & AIX_ECHO)
- linuxtermios_p->c_lflag |= ECHO;
- if (aixtermios.c_lflag & AIX_ECHOE)
- linuxtermios_p->c_lflag |= ECHOE;
- if (aixtermios.c_lflag & AIX_ECHOK)
- linuxtermios_p->c_lflag |= ECHOK;
- if (aixtermios.c_lflag & AIX_ECHONL)
- linuxtermios_p->c_lflag |= ECHONL;
- if (aixtermios.c_lflag & AIX_NOFLSH)
- linuxtermios_p->c_lflag |= NOFLSH;
- if (aixtermios.c_lflag & AIX_TOSTOP)
- linuxtermios_p->c_lflag |= TOSTOP;
- if (aixtermios.c_lflag & AIX_ECHOCTL)
- linuxtermios_p->c_lflag |= ECHOCTL;
- if (aixtermios.c_lflag & AIX_ECHOPRT)
- linuxtermios_p->c_lflag |= ECHOPRT;
- if (aixtermios.c_lflag & AIX_ECHOKE)
- linuxtermios_p->c_lflag |= ECHOKE;
- if (aixtermios.c_lflag & AIX_FLUSHO)
- linuxtermios_p->c_lflag |= FLUSHO;
- if (aixtermios.c_lflag & AIX_PENDIN)
- linuxtermios_p->c_lflag |= PENDIN;
- if (aixtermios->c_lflag & AIX_IEXTEN)
- linuxtermios_p->c_lflag |= IEXTEN;
- }
- else
- // Convert error here or in syscall.
- ;
-
- return result;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c b/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
deleted file mode 100644
index b7330a3de..000000000
--- a/libc/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* Copyright (C) 2000-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
- <http://www.gnu.org/licenses/>. */
-
-#include <errno.h>
-#include <termios.h>
-#include "aix-termios.h"
-
-int
-tcsetattr (fd, optional_actions, linuxtermios_p)
- int fd;
- int optional_actions;
- const struct termios *linuxtermios_p;
-{
- struct aixtermios aixtermios;
- int result;
-
- /* `optional_actions' does not have to be changed, AIX uses the
- same values as Linux. */
-
- aixtermios.c_cc[AIX_VINTR] = linuxtermios_p->c_cc[VINTR];
- aixtermios.c_cc[AIX_VQUIT] = linuxtermios_p->c_cc[VQUIT];
- aixtermios.c_cc[AIX_VERASE] = linuxtermios_p->c_cc[VERASE];
- aixtermios.c_cc[AIX_VKILL] = linuxtermios_p->c_cc[VKILL];
- aixtermios.c_cc[AIX_VEOF] = linuxtermios_p->c_cc[VEOF];
- // XXX VMIN has the same value as VEOF !?
- aixtermios.c_cc[AIX_VEOL] = linuxtermios_p->c_cc[VEOL];
- // XXX VTIME has the same value as VEOL !?
- aixtermios.c_cc[AIX_VEOL2] = linuxtermios_p->c_cc[VEOL2];
- aixtermios.c_cc[AIX_VSTART] = linuxtermios_p->c_cc[VSTART];
- aixtermios.c_cc[AIX_VSTOP] = linuxtermios_p->c_cc[VSTOP];
- aixtermios.c_cc[AIX_VSUSP] = linuxtermios_p->c_cc[VSUSP];
- aixtermios.c_cc[AIX_VDSUSP] = 0; // XXX No Linux equivalent !?
- aixtermios.c_cc[AIX_VREPRINT] = linuxtermios_p->c_cc[VREPRINT];
- aixtermios.c_cc[AIX_VDISCARD] = linuxtermios_p->c_cc[VDISCARD];
- aixtermios.c_cc[AIX_VWERASE] = linuxtermios_p->c_cc[VWERASE];
- aixtermios.c_cc[AIX_VLNEXT] = linuxtermios_p->c_cc[VLNEXT];
-
- /* AIX has not all the speeds (the high one) Linux supports. The
- symbol names and values used for the speeds are fortunately the
- same. */
- if ((linuxtermios_p->c_cflag & CBAUD) > B38400)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- aixtermios.c_c_flag = linuxtermios_p->c_cflag & CBAUD;
-
- /* Only the IUCLC, IXANY, and IMAXBEL values are different in the
- c_iflag member. */
- aixtermios.c_iflag = linuxtermios_p->c_iflag & 0x7ff;
- if (linuxtermios_p->c_iflag & IXANY)
- aixtermios.c_iflag |= AIX_IXANY;
- if (linuxtermios_p->c_iflag & IUCLC)
- aixtermios.c_iflag |= AIX_IUCLC;
- if (linuxtermios_p->c_iflag & IMAXBEL)
- aixtermios.c_iflag |= AIX_IMAXBEL;
-
- /* Many of the c_oflag files differ. Bummer. */
- aixtermios.c_oflag = (linuxtermios_p->c_oflag
- & (OPOST | OCRNL | ONOCR | ONLRET | OFILL
- | OFDEL | TABDLY));
- if (linuxtermios_p->c_oflag & OLCUC)
- aixtermios.c_oflag |= AIX_OLCUC;
- if (linuxtermios_p->c_oflag & ONLCR)
- aixtermios.c_oflag |= AIX_ONLCR;
- if (linuxtermios_p->c_oflag & NLDLY)
- {
- if ((linuxtermios_p->c_oflag & NLDLY) >= NL2)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- if (linuxtermios_p->c_oflag & NLDLY)
- aixtermios.c_oflag |= AIX_NL1;
- }
- if (linuxtermios_p->c_oflag & TABDLY)
- {
-#define offset 2
-#if TAB1 >> offset != AIX_TAB1 || TAB3 >> offset != AIX_TAB3
-# error "Check the offset"
-#endif
- aixtermios.c_oflag |= (linuxtermios_p->c_oflag >> offset) & AIX_TABDLY;
-#undef offset
- }
- if (linuxtermios_p->c_oflag & FFDLY)
- aixtermios.c_oflag |= AIX_FF1;
- if (linuxtermios_p->c_oflag & BSDLY)
- aixtermios.c_oflag |= AIX_BS1;
- if (linuxtermios_p->c_oflag & VTDLY)
- aixtermios.c_oflag |= AIX_VT1;
-
- /* A lot of the c_cflag member is also different. */
- if (linuxtermios_p->c_cflag & CSIZE)
- {
-#define offset 4
-#if CSIZE >> offset != AIX_CSIZE
-# error "Check the offset"
-#endif
- aixtermios.c_cflag |= (linuxtermios_p->c_cflag >> offset) & AIX_CSIZE;
-#undef offset
- }
-
- if (linuxtermios_p->c_cflag & STOPB)
- aixtermios.c_cflag |= AIX_STOPB;
- if (linuxtermios_p->c_cflag & CREAD)
- aixtermios.c_cflag |= AIX_CREAD;
- if (linuxtermios_p->c_cflag & PARENB)
- aixtermios.c_cflag |= AIX_PARENB;
- if (linuxtermios_p->c_cflag & PARODD)
- aixtermios.c_cflag |= AIX_PARODD;
- if (linuxtermios_p->c_cflag & HUPCL)
- aixtermios.c_cflag |= AIX_HUPCL;
- if (linuxtermios_p->c_cflag & CLOCAL)
- aixtermios.c_cflag |= AIX_CLOCAL;
-
- /* The c_lflag is information is also different. */
- aixtermios.c_lflag = 0;
- if (linuxtermios_p->c_lflag & ISIG)
- aixtermios.c_lflag |= AIX_ISIG;
- if (linuxtermios_p->c_lflag & ICANON)
- aixtermios.c_lflag |= AIX_ICANON;
- if (linuxtermios_p->c_lflag & XCASE)
- aixtermios.c_lflag |= AIX_XCASE;
- if (linuxtermios_p->c_lflag & ECHO)
- aixtermios.c_lflag |= AIX_ECHO;
- if (linuxtermios_p->c_lflag & ECHOE)
- aixtermios.c_lflag |= AIX_ECHOE;
- if (linuxtermios_p->c_lflag & ECHOK)
- aixtermios.c_lflag |= AIX_ECHOK;
- if (linuxtermios_p->c_lflag & ECHONL)
- aixtermios.c_lflag |= AIX_ECHONL;
- if (linuxtermios_p->c_lflag & NOFLSH)
- aixtermios.c_lflag |= AIX_NOFLSH;
- if (linuxtermios_p->c_lflag & TOSTOP)
- aixtermios.c_lflag |= AIX_TOSTOP;
- if (linuxtermios_p->c_lflag & ECHOCTL)
- aixtermios.c_lflag |= AIX_ECHOCTL;
- if (linuxtermios_p->c_lflag & ECHOPRT)
- aixtermios.c_lflag |= AIX_ECHOPRT;
- if (linuxtermios_p->c_lflag & ECHOKE)
- aixtermios.c_lflag |= AIX_ECHOKE;
- if (linuxtermios_p->c_lflag & FLUSHO)
- aixtermios.c_lflag |= AIX_FLUSHO;
- if (linuxtermios_p->c_lflag & PENDIN)
- aixtermios.c_lflag |= AIX_PENDIN;
- if (linuxtermios_p->c_lflag & IEXTEN)
- aixtermios.c_lflag |= AIX_IEXTEN;
-
- result = /* XXX syscall */;
-
- // Convert error here or in syscall.
-
- return result;
-}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
index 8b195db1b..ba54de4eb 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
@@ -34,6 +34,13 @@ extern void *__vdso_getcpu;
extern void *__vdso_time;
+#if defined(__PPC64__) || defined(__powerpc64__)
+extern void *__vdso_sigtramp_rt64;
+#else
+extern void *__vdso_sigtramp32;
+extern void *__vdso_sigtramp_rt32;
+#endif
+
/* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO
symbol. This works because _dl_vdso_vsym always return the function
address, and no vDSO symbols use the TOC or chain pointers from the OPD
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c b/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
index f6f05f0ba..061715f87 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/init-first.c
@@ -29,6 +29,12 @@ void *__vdso_clock_getres;
void *__vdso_get_tbfreq;
void *__vdso_getcpu;
void *__vdso_time;
+#if defined(__PPC64__) || defined(__powerpc64__)
+void *__vdso_sigtramp_rt64;
+#else
+void *__vdso_sigtramp32;
+void *__vdso_sigtramp_rt32;
+#endif
static inline void
_libc_vdso_platform_setup (void)
@@ -46,6 +52,16 @@ _libc_vdso_platform_setup (void)
__vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
__vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615);
+
+ /* PPC64 uses only one signal trampoline symbol, while PPC32 will use
+ two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not
+ (__kernel_sigtramp32). */
+#if defined(__PPC64__) || defined(__powerpc64__)
+ __vdso_sigtramp_rt64 = _dl_vdso_vsym ("__kernel_sigtramp_rt64", &linux2615);
+#else
+ __vdso_sigtramp32 = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615);
+ __vdso_sigtramp_rt32 = _dl_vdso_vsym ("__kernel_sigtramp_rt32", &linux2615);
+#endif
}
# define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
index ba3dc5a18..0fd674a35 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
@@ -54,7 +54,7 @@ __libc_start_main (int argc, char **argv,
char **temp;
/* ...in which case, we have argc as the top thing on the
stack, followed by argv (NULL-terminated), envp (likewise),
- and the auxilary vector. */
+ and the auxiliary vector. */
/* 32/64-bit agnostic load from stack */
argc = *(long int *) stack_on_entry;
argv = stack_on_entry + 1;
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
index 9273238a1..926f34207 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
index 1f653bf50..fb7744839 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
index 086d15b91..7e0612595 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S
@@ -23,7 +23,7 @@
and if appropriate:
__CONTEXT_ENABLE_FPRS
__CONTEXT_ENABLE_VRS
- Any archecture that implements the Vector unit is assumed to also
+ Any architecture that implements the Vector unit is assumed to also
implement the floating unit. */
/* Stack frame offsets. */
diff --git a/libc/sysdeps/unix/sysv/linux/ptsname.c b/libc/sysdeps/unix/sysv/linux/ptsname.c
index ea6f0fed9..70f1f34be 100644
--- a/libc/sysdeps/unix/sysv/linux/ptsname.c
+++ b/libc/sysdeps/unix/sysv/linux/ptsname.c
@@ -56,7 +56,7 @@ extern const char __libc_ptyname2[] attribute_hidden;
static char buffer[sizeof (_PATH_DEVPTS) + 20];
-/* Return the pathname of the pseudo terminal slave assoicated with
+/* Return the pathname of the pseudo terminal slave associated with
the master FD is open on, or NULL on errors.
The returned storage is good until the next call to this function. */
char *
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
index cd0cb743b..7fbd28a25 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/chown.c
@@ -46,7 +46,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-/* Compiling for compatibiity. */
+/* Compiling for compatibility. */
int
attribute_compat_text_section
__chown_is_lchown (const char *file, uid_t owner, gid_t group)
diff --git a/libc/sysdeps/unix/sysv/linux/s390/sa_len.c b/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
index 6575b83e9..7b47aa8d6 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
+++ b/libc/sysdeps/unix/sysv/linux/s390/sa_len.c
@@ -1,2 +1,3 @@
-#define NEED_AF_IUCV 1
-#include "../sa_len.c"
+#define HAVE_NETIUCV_IUCV_H
+
+#include <sysdeps/unix/sysv/linux/sa_len.c>
diff --git a/libc/sysdeps/unix/sysv/linux/sa_len.c b/libc/sysdeps/unix/sysv/linux/sa_len.c
index 09fc8eb9b..0e657fa09 100644
--- a/libc/sysdeps/unix/sysv/linux/sa_len.c
+++ b/libc/sysdeps/unix/sysv/linux/sa_len.c
@@ -1,63 +1,9 @@
-/* Copyright (C) 1998-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
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-
-#include <netash/ash.h>
-#include <netatalk/at.h>
-#include <netax25/ax25.h>
-#include <neteconet/ec.h>
-#include <netinet/in.h>
-#include <netipx/ipx.h>
-#include <netpacket/packet.h>
-#include <netrose/rose.h>
-#include <netiucv/iucv.h>
-#include <sys/un.h>
-
-int
-__libc_sa_len (sa_family_t af)
-{
- switch (af)
- {
- case AF_APPLETALK:
- return sizeof (struct sockaddr_at);
- case AF_ASH:
- return sizeof (struct sockaddr_ash);
- case AF_AX25:
- return sizeof (struct sockaddr_ax25);
- case AF_ECONET:
- return sizeof (struct sockaddr_ec);
- case AF_INET:
- return sizeof (struct sockaddr_in);
- case AF_INET6:
- return sizeof (struct sockaddr_in6);
- case AF_IPX:
- return sizeof (struct sockaddr_ipx);
-#ifdef NEED_AF_IUCV
- case AF_IUCV:
- return sizeof (struct sockaddr_iucv);
-#endif
- case AF_LOCAL:
- return sizeof (struct sockaddr_un);
- case AF_PACKET:
- return sizeof (struct sockaddr_ll);
- case AF_ROSE:
- return sizeof (struct sockaddr_rose);
- }
- return 0;
-}
-libc_hidden_def (__libc_sa_len)
+#define HAVE_NETASH_ASH_H
+#define HAVE_NETATALK_AT_H
+#define HAVE_NETAX25_AX25_H
+#define HAVE_NETECONET_EC_H
+#define HAVE_NETIPX_IPX_H
+#define HAVE_NETPACKET_PACKET_H
+#define HAVE_NETROSE_ROSE_H
+
+#include <socket/sa_len.c>
diff --git a/libc/sysdeps/unix/sysv/linux/socketcall.h b/libc/sysdeps/unix/sysv/linux/socketcall.h
index d1dffa340..d15671720 100644
--- a/libc/sysdeps/unix/sysv/linux/socketcall.h
+++ b/libc/sysdeps/unix/sysv/linux/socketcall.h
@@ -22,7 +22,7 @@
/* Define unique numbers for the operations permitted on socket. Linux
uses a single system call for all these functions. The relevant code
file is /usr/include/linux/net.h.
- We cannot use a enum here because the values are used in assembler
+ We cannot use an enum here because the values are used in assembler
code. */
#define SOCKOP_socket 1
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
index bd3d4f925..5e64efa6a 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/makecontext.c
@@ -28,7 +28,7 @@
Returning to the correct parent context is pretty simple on
Sparc. We only need to link up the register windows correctly.
Since global registers are clobbered by calls, we need not be
- concernred about those, and thus is all could be worked out without
+ concerned about those, and thus is all could be worked out without
using a trampoline.
Except that we must deal with the signal mask, thus a trampoline
diff --git a/libc/sysdeps/unix/sysv/linux/tst-fanotify.c b/libc/sysdeps/unix/sysv/linux/tst-fanotify.c
new file mode 100644
index 000000000..b88995d6f
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -0,0 +1,56 @@
+/* Basic fanotify test.
+ Copyright (C) 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/fanotify.h>
+
+static int
+do_test (void)
+{
+ int fd, ret;
+
+ fd = fanotify_init (0, 0);
+ if (fd < 0)
+ {
+ if (errno == ENOSYS)
+ {
+ puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
+ return 0;
+ }
+
+ perror ("fanotify_init (0, 0) failed");
+ return 1;
+ }
+
+ ret = fanotify_mark (fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS
+ | FAN_MODIFY | FAN_OPEN | FAN_CLOSE | FAN_ONDIR
+ | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
+ if (ret)
+ {
+ perror ("fanotify_mark (...) failed");
+ return 1;
+ }
+
+ puts ("All OK");
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"