aboutsummaryrefslogtreecommitdiffstats
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/unix/sysv/linux
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadtermbaud-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
termbaud-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
termbaud-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/Dist85
-rw-r--r--sysdeps/unix/sysv/linux/Makefile16
-rw-r--r--sysdeps/unix/sysv/linux/Versions11
-rw-r--r--sysdeps/unix/sysv/linux/aio_sigqueue.c7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Dist19
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Implies3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile10
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Versions4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/adjtime.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/errno.h8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/fcntl.h55
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/resource.h15
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/termios.h85
-rw-r--r--sysdeps/unix/sysv/linux/alpha/clone.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/dl-sysdep.c9
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fxstatat.c99
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getcontext.S6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getitimer.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getrusage.S6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/gettimeofday.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/glob.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/msgctl.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/nldbl-abi.h8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/oldglob.c3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/select.S6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/semctl.c5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setitimer.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/settimeofday.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/shmctl.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigaction.c2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigsuspend.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscall.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/utimes.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/wait4.S4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/wordexp.c4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xstatconv.h4
-rw-r--r--sysdeps/unix/sysv/linux/arm/Dist14
-rw-r--r--sysdeps/unix/sysv/linux/arm/Makefile12
-rw-r--r--sysdeps/unix/sysv/linux/arm/Versions37
-rw-r--r--sysdeps/unix/sysv/linux/arm/alphasort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/armsigctx.h73
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/fcntl.h189
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/mman.h99
-rw-r--r--sysdeps/unix/sysv/linux/arm/brk.c (renamed from sysdeps/unix/sysv/linux/powerpc/gettimeofday.c)45
-rw-r--r--sysdeps/unix/sysv/linux/arm/chown.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/clone.S60
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-procinfo.c64
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-procinfo.h86
-rw-r--r--sysdeps/unix/sysv/linux/arm/fchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/fxstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/geteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/getresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/getuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/ioperm.c274
-rw-r--r--sysdeps/unix/sysv/linux/arm/lchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/lockf64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/mmap.S92
-rw-r--r--sysdeps/unix/sysv/linux/arm/mmap64.S80
-rw-r--r--sysdeps/unix/sysv/linux/arm/msgctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/profil-counter.h37
-rw-r--r--sysdeps/unix/sysv/linux/arm/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/register-dump.h166
-rw-r--r--sysdeps/unix/sysv/linux/arm/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/semctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setfsgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setfsuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/arm/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/shmctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigaction.c165
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigcontextinfo.h51
-rw-r--r--sysdeps/unix/sysv/linux/arm/sigrestorer.S33
-rw-r--r--sysdeps/unix/sysv/linux/arm/socket.S123
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/elf.h (renamed from sysdeps/unix/sysv/linux/powerpc/dl-vdso.h)15
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/io.h48
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/procfs.h123
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/ucontext.h (renamed from sysdeps/unix/sysv/linux/sh/sh3/sys/ucontext.h)32
-rw-r--r--sysdeps/unix/sysv/linux/arm/sys/user.h72
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list5
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.S34
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h236
-rw-r--r--sysdeps/unix/sysv/linux/arm/versionsort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/arm/vfork.S59
-rw-r--r--sysdeps/unix/sysv/linux/arm/xstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/bits/errno.h11
-rw-r--r--sysdeps/unix/sysv/linux/bits/in.h27
-rw-r--r--sysdeps/unix/sysv/linux/bits/poll.h6
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h15
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h12
-rw-r--r--sysdeps/unix/sysv/linux/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h12
-rw-r--r--sysdeps/unix/sysv/linux/bits/termios.h3
-rw-r--r--sysdeps/unix/sysv/linux/bits/uio.h10
-rw-r--r--sysdeps/unix/sysv/linux/bits/waitflags.h4
-rw-r--r--sysdeps/unix/sysv/linux/check_pf.c143
-rw-r--r--sysdeps/unix/sysv/linux/clock_getcpuclockid.c103
-rw-r--r--sysdeps/unix/sysv/linux/clock_getres.c185
-rw-r--r--sysdeps/unix/sysv/linux/clock_gettime.c185
-rw-r--r--sysdeps/unix/sysv/linux/clock_nanosleep.c23
-rw-r--r--sysdeps/unix/sysv/linux/clock_settime.c77
-rw-r--r--sysdeps/unix/sysv/linux/configure48
-rw-r--r--sysdeps/unix/sysv/linux/configure.in48
-rw-r--r--sysdeps/unix/sysv/linux/device-nrs.h6
-rw-r--r--sysdeps/unix/sysv/linux/dl-execstack.c28
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h226
-rw-r--r--sysdeps/unix/sysv/linux/dl-sbrk.c2
-rw-r--r--sysdeps/unix/sysv/linux/dl-sysdep.c6
-rw-r--r--sysdeps/unix/sysv/linux/faccessat.c143
-rw-r--r--sysdeps/unix/sysv/linux/fchmodat.c106
-rw-r--r--sysdeps/unix/sysv/linux/fchownat.c99
-rw-r--r--sysdeps/unix/sysv/linux/fstatvfs64.c5
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c7
-rw-r--r--sysdeps/unix/sysv/linux/futimes.c69
-rw-r--r--sysdeps/unix/sysv/linux/futimesat.c119
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat.c141
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat64.c167
-rw-r--r--sysdeps/unix/sysv/linux/gai_sigqueue.c4
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c7
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c8
-rw-r--r--sysdeps/unix/sysv/linux/gethostid.c6
-rw-r--r--sysdeps/unix/sysv/linux/getloadavg.c4
-rw-r--r--sysdeps/unix/sysv/linux/getsourcefilter.c28
-rw-r--r--sysdeps/unix/sysv/linux/getsysstats.c184
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Dist5
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/Versions25
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/errno.h51
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/fcntl.h181
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ioctls.h37
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ipc.h63
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/mman.h83
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/msq.h84
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/sem.h92
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/shm.h106
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/sigaction.h75
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/signum.h82
-rw-r--r--sysdeps/unix/sysv/linux/hppa/brk.c42
-rw-r--r--sysdeps/unix/sysv/linux/hppa/clone.S99
-rw-r--r--sysdeps/unix/sysv/linux/hppa/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h18
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_stat.h31
-rw-r--r--sysdeps/unix/sysv/linux/hppa/mmap.c50
-rw-r--r--sysdeps/unix/sysv/linux/hppa/profil-counter.h (renamed from sysdeps/unix/sysv/linux/alpha/bits/wordsize.h)21
-rw-r--r--sysdeps/unix/sysv/linux/hppa/socket.S10
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/procfs.h113
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sys/ucontext.h67
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscall.S19
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list37
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.c64
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.h419
-rw-r--r--sysdeps/unix/sysv/linux/hppa/umount.c31
-rw-r--r--sysdeps/unix/sysv/linux/i386/Dist17
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/fcntl.h54
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/i386/call_pselect6.S65
-rw-r--r--sysdeps/unix/sysv/linux/i386/chown.c5
-rw-r--r--sysdeps/unix/sysv/linux/i386/clone.S16
-rw-r--r--sysdeps/unix/sysv/linux/i386/dl-cache.h59
-rw-r--r--sysdeps/unix/sysv/linux/i386/fchown.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/fchownat.c110
-rw-r--r--sysdeps/unix/sysv/linux/i386/fcntl.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstat.c5
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstatat.c176
-rw-r--r--sysdeps/unix/sysv/linux/i386/getcontext.S8
-rw-r--r--sysdeps/unix/sysv/linux/i386/getegid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/geteuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getgid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getmsg.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getresgid.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/getresuid.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/getrlimit.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getrlimit64.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/getuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/glob64.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/lchown.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/lockf64.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/lxstat.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/makecontext.S8
-rw-r--r--sysdeps/unix/sysv/linux/i386/mmap.S25
-rw-r--r--sysdeps/unix/sysv/linux/i386/mmap64.S38
-rw-r--r--sysdeps/unix/sysv/linux/i386/msgctl.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/posix_fadvise64.S33
-rw-r--r--sysdeps/unix/sysv/linux/i386/pselect.c18
-rw-r--r--sysdeps/unix/sysv/linux/i386/putmsg.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/semctl.c5
-rw-r--r--sysdeps/unix/sysv/linux/i386/semtimedop.S14
-rw-r--r--sysdeps/unix/sysv/linux/i386/setcontext.S19
-rw-r--r--sysdeps/unix/sysv/linux/i386/setegid.c5
-rw-r--r--sysdeps/unix/sysv/linux/i386/seteuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsgid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setgroups.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setregid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresgid.c7
-rw-r--r--sysdeps/unix/sysv/linux/i386/setresuid.c7
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setrlimit.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/setuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/shmctl.c4
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/socket.S4
-rw-r--r--sysdeps/unix/sysv/linux/i386/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/i386/sync_file_range.S72
-rw-r--r--sysdeps/unix/sysv/linux/i386/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysconf.c61
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h112
-rw-r--r--sysdeps/unix/sysv/linux/i386/ucontext_i.h41
-rw-r--r--sysdeps/unix/sysv/linux/i386/ucontext_i.sym30
-rw-r--r--sysdeps/unix/sysv/linux/i386/vfork.S4
-rw-r--r--sysdeps/unix/sysv/linux/i386/xstat.c5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/Dist13
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__longjmp.S5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/fcntl.h54
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/setjmp.h7
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/shm.h7
-rw-r--r--sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c23
-rw-r--r--sysdeps/unix/sysv/linux/ia64/clone2.S6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-cache.h27
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-procinfo.c5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/dl-procinfo.h5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/has_cpuclock.c12
-rw-r--r--sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/setjmp.S20
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sigsuspend.c49
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sys/ptrace.h28
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep.h25
-rw-r--r--sysdeps/unix/sysv/linux/if_index.c12
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c138
-rw-r--r--sysdeps/unix/sysv/linux/ifreq.c3
-rw-r--r--sysdeps/unix/sysv/linux/ifreq.h41
-rw-r--r--sysdeps/unix/sysv/linux/init-first.c39
-rw-r--r--sysdeps/unix/sysv/linux/internal_statvfs.c29
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h163
-rw-r--r--sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h18
-rw-r--r--sysdeps/unix/sysv/linux/lddlibc4.c4
-rw-r--r--sysdeps/unix/sysv/linux/ldsodefs.h4
-rw-r--r--sysdeps/unix/sysv/linux/libc_fatal.c32
-rw-r--r--sysdeps/unix/sysv/linux/linkat.c115
-rw-r--r--sysdeps/unix/sysv/linux/linux_fsinfo.h5
-rw-r--r--sysdeps/unix/sysv/linux/local-setxid.h23
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/Dist9
-rw-r--r--sysdeps/unix/sysv/linux/m68k/Makefile17
-rw-r--r--sysdeps/unix/sysv/linux/m68k/Versions32
-rw-r--r--sysdeps/unix/sysv/linux/m68k/alphasort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/a.out.h3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/fcntl.h188
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/mman.h99
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/poll.h43
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/stat.h164
-rw-r--r--sysdeps/unix/sysv/linux/m68k/brk.c (renamed from sysdeps/unix/sysv/linux/posix_madvise.c)36
-rw-r--r--sysdeps/unix/sysv/linux/m68k/chown.c69
-rw-r--r--sysdeps/unix/sysv/linux/m68k/clone.S66
-rw-r--r--sysdeps/unix/sysv/linux/m68k/dl-librecon.h1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/fchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/fxstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getdents64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/geteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getmsg.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getpagesize.c (renamed from sysdeps/unix/sysv/linux/tst-clone.c)54
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getsysstats.c37
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/lchown.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/ldconfig.h1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/lockf64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mmap.S43
-rw-r--r--sysdeps/unix/sysv/linux/m68k/mremap.S29
-rw-r--r--sysdeps/unix/sysv/linux/m68k/msgctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/putmsg.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/readdir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/readdir64_r.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/register-dump.h214
-rw-r--r--sysdeps/unix/sysv/linux/m68k/scandir64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/semctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/semtimedop.S60
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setegid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/seteuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setfsgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setfsuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setgroups.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setregid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setresgid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setresuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setreuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setrlimit.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/setuid.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/shmctl.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h26
-rw-r--r--sysdeps/unix/sysv/linux/m68k/socket.S111
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/procfs.h126
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/reg.h89
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sys/ucontext.h109
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscall.S33
-rw-r--r--sysdeps/unix/sysv/linux/m68k/syscalls.list5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.S49
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h295
-rw-r--r--sysdeps/unix/sysv/linux/m68k/versionsort64.c1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/vfork.S76
-rw-r--r--sysdeps/unix/sysv/linux/m68k/xstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/Dist13
-rw-r--r--sysdeps/unix/sysv/linux/mips/Makefile56
-rw-r--r--sysdeps/unix/sysv/linux/mips/Versions31
-rw-r--r--sysdeps/unix/sysv/linux/mips/_test_and_set.c (renamed from sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h)24
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/endian.h16
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/errno.h48
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/fcntl.h194
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h76
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ipc.h55
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/mman.h92
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/msq.h74
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/poll.h48
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/resource.h214
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sem.h85
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/shm.h94
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigaction.h89
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigcontext.h105
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/siginfo.h309
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/signum.h79
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigstack.h55
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket.h316
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h209
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/statfs.h72
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/termios.h218
-rw-r--r--sysdeps/unix/sysv/linux/mips/brk.c56
-rw-r--r--sysdeps/unix/sysv/linux/mips/clone.S114
-rwxr-xr-xsysdeps/unix/sysv/linux/mips/configure76
-rw-r--r--sysdeps/unix/sysv/linux/mips/configure.in76
-rw-r--r--sysdeps/unix/sysv/linux/mips/dl-cache.h43
-rw-r--r--sysdeps/unix/sysv/linux/mips/entry.h5
-rw-r--r--sysdeps/unix/sysv/linux/mips/fcntl.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/ftruncate64.c76
-rw-r--r--sysdeps/unix/sysv/linux/mips/getmsg.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/getsysstats.c36
-rw-r--r--sysdeps/unix/sysv/linux/mips/ipc_priv.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_sigaction.h40
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_stat.h57
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_termios.h35
-rw-r--r--sysdeps/unix/sysv/linux/mips/lockf64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h36
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sysdep.h283
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/ldconfig.h26
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/llseek.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c (renamed from sysdeps/unix/sysv/linux/time.c)27
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h242
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c30
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S42
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h242
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/recv.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/send.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscall.S53
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscalls.list21
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/umount.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/pipe.S1
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread.c109
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread64.c107
-rw-r--r--sysdeps/unix/sysv/linux/mips/profil-counter.h2
-rw-r--r--sysdeps/unix/sysv/linux/mips/ptrace.c111
-rw-r--r--sysdeps/unix/sysv/linux/mips/putmsg.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite.c109
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite64.c108
-rw-r--r--sysdeps/unix/sysv/linux/mips/readelflib.c71
-rw-r--r--sysdeps/unix/sysv/linux/mips/register-dump.h108
-rw-r--r--sysdeps/unix/sysv/linux/mips/sigaction.c188
-rw-r--r--sysdeps/unix/sysv/linux/mips/sigcontextinfo.h43
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/cachectl.h42
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/procfs.h128
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/ptrace.h136
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/syscall.h42
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/sysmips.h43
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/tas.h67
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/ucontext.h109
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/user.h219
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list31
-rw-r--r--sysdeps/unix/sysv/linux/mips/truncate64.c76
-rw-r--r--sysdeps/unix/sysv/linux/mips/ustat.c (renamed from sysdeps/unix/sysv/linux/sync_file_range.c)34
-rw-r--r--sysdeps/unix/sysv/linux/mips/xmknod.c51
-rw-r--r--sysdeps/unix/sysv/linux/mips/xstatconv.c (renamed from sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c)80
-rw-r--r--sysdeps/unix/sysv/linux/mkdirat.c86
-rw-r--r--sysdeps/unix/sysv/linux/mmap64.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_close.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_getattr.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_notify.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_open.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_receive.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_send.c4
-rw-r--r--sysdeps/unix/sysv/linux/mq_unlink.c4
-rw-r--r--sysdeps/unix/sysv/linux/msgctl.c6
-rw-r--r--sysdeps/unix/sysv/linux/msgrcv.c8
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h10
-rw-r--r--sysdeps/unix/sysv/linux/netinet/if_tr.h78
-rw-r--r--sysdeps/unix/sysv/linux/netlinkaccess.h7
-rw-r--r--sysdeps/unix/sysv/linux/not-cancel.h47
-rw-r--r--sysdeps/unix/sysv/linux/nscd_setup_thread.c22
-rw-r--r--sysdeps/unix/sysv/linux/openat.c175
-rw-r--r--sysdeps/unix/sysv/linux/openat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/opendir.c4
-rw-r--r--sysdeps/unix/sysv/linux/paths.h2
-rw-r--r--sysdeps/unix/sysv/linux/poll.c5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Dist8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Implies4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Makefile8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Versions7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/Dist7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h54
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/shm.h5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/termios.h84
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h19
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/chown.c140
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/configure135
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/configure.in37
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-vdso.c59
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/fchownat.c110
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c117
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/libc-start.c130
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/nldbl-abi.h8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S24
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S17
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c12
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S286
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S369
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S20
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S293
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S396
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S26
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S517
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S695
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h138
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c15
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h43
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym26
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/Dist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S17
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S16
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ldsodefs.h77
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c8
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S26
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S20
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S25
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h150
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h60
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym50
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/umount.c2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/procfs.h21
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h20
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h4
-rw-r--r--sysdeps/unix/sysv/linux/ppoll.c76
-rw-r--r--sysdeps/unix/sysv/linux/pread.c4
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c5
-rw-r--r--sysdeps/unix/sysv/linux/prof-freq.c4
-rw-r--r--sysdeps/unix/sysv/linux/pselect.c100
-rw-r--r--sysdeps/unix/sysv/linux/ptrace.c16
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c4
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c5
-rw-r--r--sysdeps/unix/sysv/linux/readdir64.c2
-rw-r--r--sysdeps/unix/sysv/linux/readdir64_r.c2
-rw-r--r--sysdeps/unix/sysv/linux/readlinkat.c90
-rw-r--r--sysdeps/unix/sysv/linux/readonly-area.c17
-rw-r--r--sysdeps/unix/sysv/linux/renameat.c184
-rw-r--r--sysdeps/unix/sysv/linux/s390/Dist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/Implies3
-rw-r--r--sysdeps/unix/sysv/linux/s390/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h53
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/s390/fpu/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/s390/nldbl-abi.h8
-rw-r--r--sysdeps/unix/sysv/linux/s390/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/Dist7
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/chown.c4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/lchown.c4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c20
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/syscall.S9
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h47
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h (renamed from sysdeps/unix/sysv/linux/dl-sysdep.h)24
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c19
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c47
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/socket.S1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscall.S9
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h44
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h36
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/ptrace.h20
-rw-r--r--sysdeps/unix/sysv/linux/s390/sys/user.h63
-rw-r--r--sysdeps/unix/sysv/linux/s390/ucontext_i.sym23
-rw-r--r--sysdeps/unix/sysv/linux/sched_getaffinity.c9
-rw-r--r--sysdeps/unix/sysv/linux/sched_setaffinity.c4
-rw-r--r--sysdeps/unix/sysv/linux/segfault.c2
-rw-r--r--sysdeps/unix/sysv/linux/semctl.c6
-rw-r--r--sysdeps/unix/sysv/linux/setegid.c4
-rw-r--r--sysdeps/unix/sysv/linux/seteuid.c4
-rw-r--r--sysdeps/unix/sysv/linux/setsourcefilter.c9
-rw-r--r--sysdeps/unix/sysv/linux/sh/Dist8
-rw-r--r--sysdeps/unix/sysv/linux/sh/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/fcntl.h106
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/mman.h8
-rw-r--r--sysdeps/unix/sysv/linux/sh/chown.c70
-rw-r--r--sysdeps/unix/sysv/linux/sh/fchownat.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/sh/makecontext.S145
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread.c96
-rw-r--r--sysdeps/unix/sysv/linux/sh/pread64.c97
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite.c96
-rw-r--r--sysdeps/unix/sysv/linux/sh/pwrite64.c99
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/getcontext.S88
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/setcontext.S99
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/swapcontext.S132
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym38
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/getcontext.S131
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/setcontext.S139
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/swapcontext.S214
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym73
-rw-r--r--sysdeps/unix/sysv/linux/sh/socket.S10
-rw-r--r--sysdeps/unix/sysv/linux/sh/sys/ucontext.h (renamed from sysdeps/unix/sysv/linux/sh/sh4/sys/ucontext.h)12
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.S4
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.h35
-rw-r--r--sysdeps/unix/sysv/linux/shm_open.c9
-rw-r--r--sysdeps/unix/sysv/linux/shmctl.c6
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c8
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c5
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c4
-rw-r--r--sysdeps/unix/sysv/linux/sigqueue.c4
-rw-r--r--sysdeps/unix/sysv/linux/sigreturn.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigstack.c4
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c35
-rw-r--r--sysdeps/unix/sysv/linux/sigtimedwait.c4
-rw-r--r--sysdeps/unix/sysv/linux/sigwait.c15
-rw-r--r--sysdeps/unix/sysv/linux/sigwaitinfo.c4
-rw-r--r--sysdeps/unix/sysv/linux/sleep.c3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Dist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Versions7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/errno.h8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h52
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/mman.h11
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/poll.h9
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/resource.h15
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/setjmp.h19
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/stat.h41
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/termios.h88
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/wordsize.h20
-rw-r--r--sysdeps/unix/sysv/linux/sparc/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/rt-sysdep.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/Dist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/Implies3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/Makefile12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/chown.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/clone.S46
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.c64
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h75
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/fpu/Implies2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/nldbl-abi.h8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S26
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S39
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9b/Implies1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S16
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h177
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/Dist7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/brk.S8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/clone.S75
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.c64
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h76
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h46
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pause.c8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S16
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/socket.S39
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S17
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h157
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c9
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sys/ptrace.h24
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.S1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.c1
-rw-r--r--sysdeps/unix/sysv/linux/statvfs64.c4
-rw-r--r--sysdeps/unix/sysv/linux/symlinkat.c87
-rw-r--r--sysdeps/unix/sysv/linux/sys/epoll.h9
-rw-r--r--sysdeps/unix/sysv/linux/sys/inotify.h92
-rw-r--r--sysdeps/unix/sysv/linux/sys/kd.h10
-rw-r--r--sysdeps/unix/sysv/linux/sys/ptrace.h20
-rw-r--r--sysdeps/unix/sysv/linux/sys/quota.h91
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list17
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c24
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c3
-rw-r--r--sysdeps/unix/sysv/linux/syslog.c10
-rw-r--r--sysdeps/unix/sysv/linux/system.c3
-rw-r--r--sysdeps/unix/sysv/linux/tcflow.c32
-rw-r--r--sysdeps/unix/sysv/linux/tcflush.c32
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c47
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c32
-rw-r--r--sysdeps/unix/sysv/linux/testrtsig.h4
-rw-r--r--sysdeps/unix/sysv/linux/truncate64.c7
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.c29
-rw-r--r--sysdeps/unix/sysv/linux/ttyname_r.c32
-rw-r--r--sysdeps/unix/sysv/linux/unlinkat.c97
-rw-r--r--sysdeps/unix/sysv/linux/updwtmp.c4
-rw-r--r--sysdeps/unix/sysv/linux/utimes.c4
-rw-r--r--sysdeps/unix/sysv/linux/utmp_file.c4
-rw-r--r--sysdeps/unix/sysv/linux/vfork.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c109
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fxstatat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/getdents.c2
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/Dist11
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h54
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/brk.c43
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/clone.S8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/getcontext.S18
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/makecontext.c22
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/setcontext.S14
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigsuspend.c1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/swapcontext.S12
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/epoll.h9
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysconf.c54
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h39
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.h47
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym34
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/umount.c32
-rw-r--r--sysdeps/unix/sysv/linux/xmknodat.c95
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.h5
722 files changed, 16678 insertions, 11312 deletions
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
new file mode 100644
index 0000000000..e621041a24
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -0,0 +1,85 @@
+bits/initspin.h
+cmsg_nxthdr.c
+dl-brk.c
+dl-sbrk.c
+exit-thread.S
+fatal-prepare.h
+getdirentries.c
+getdirentries64.c
+ipc_priv.h
+kernel-features.h
+kernel_sigaction.h
+kernel_stat.h
+kernel_termios.h
+ldd-rewrite.sed
+lddlibc4.c
+linux_fsinfo.h
+llseek.c
+makedev.c
+ntp_gettime.c
+readahead.c
+s_pread64.c
+s_pwrite64.c
+siglist.h
+sizes.h
+socketcall.h
+sysctl.c
+termio.h
+netlinkaccess.h
+net/ethernet.h
+net/if_arp.h
+net/if_packet.h
+net/if_ppp.h
+net/if_shaper.h
+net/if_slip.h
+net/ppp-comp.h
+net/ppp_defs.h
+net/route.h
+netash/ash.h
+netatalk/at.h
+netax25/ax25.h
+neteconet/ec.h
+netinet/if_fddi.h
+netinet/if_tr.h
+netpacket/packet.h
+netipx/ipx.h
+netrom/netrom.h
+netrose/rose.h
+nfs/nfs.h
+pathconf.h
+rt_sigaction.c
+rt_sigpending.c
+rt_sigprocmask.c
+rt_sigqueueinfo.c
+rt_sigreturn.c
+rt_sigsuspend.c
+rt_sigtimedwait.c
+sa_len.c
+scsi/sg.h
+scsi/scsi.h
+scsi/scsi_ioctl.h
+sys/acct.h
+sys/epoll.h
+sys/fsuid.h
+sys/kd.h
+sys/kdaemon.h
+sys/klog.h
+sys/mount.h
+sys/pci.h
+sys/personality.h
+sys/prctl.h
+sys/procfs.h
+sys/quota.h
+sys/raw.h
+sys/soundcard.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/timex.h
+sys/ultrasound.h
+sys/user.h
+sys/vt.h
+xstatconv.c
+xstatconv.h
+getdents64.c
+umount.S
+umount2.S
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 8bec6cdb85..37be75e964 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -24,12 +24,10 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
sys/quota.h sys/fsuid.h \
scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
- bits/a.out.h sys/inotify.h
+ bits/a.out.h
install-others += $(inst_includedir)/bits/syscall.h
-tests += tst-clone
-
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
# For bi-arch platforms, the CPU/Makefile defines {32,64}bit-predefine and
# we generate a file that uses <bits/wordsize.h>.
@@ -109,6 +107,11 @@ ifeq ($(subdir),termios)
sysdep_headers += termio.h
endif
+ifeq ($(subdir),stdio-common)
+# Just disable the auto generation in sysdeps/generic
+inhibit-siglist := yes
+endif
+
ifeq ($(subdir),posix)
sysdep_headers += bits/initspin.h
@@ -149,11 +152,6 @@ CFLAGS-mq_receive.c += -fexceptions
endif
ifeq ($(subdir),nscd)
-CFLAGS-connections.c += -DHAVE_EPOLL -DHAVE_SENDFILE
-CFLAGS-pwdcache.c += -DHAVE_SENDFILE
-CFLAGS-grpcache.c += -DHAVE_SENDFILE
-CFLAGS-hstcache.c += -DHAVE_SENDFILE
-CFLAGS-aicache.c += -DHAVE_SENDFILE
-CFLAGS-initgrcache.c += -DHAVE_SENDFILE
+CFLAGS-connections.c += -DHAVE_EPOLL
CFLAGS-gai.c += -DNEED_NETLINK
endif
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 7c015b1d62..980724e519 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -115,17 +115,6 @@ libc {
GLIBC_2.3.4 {
sched_getaffinity; sched_setaffinity;
}
- GLIBC_2.4 {
- inotify_init; inotify_add_watch; inotify_rm_watch;
-
- unshare;
-
- #errlist-compat 132
- _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
- }
- GLIBC_2.5 {
- splice; sync_file_range; tee; vmsplice;
- }
GLIBC_PRIVATE {
# functions used in other libraries
__syscall_rt_sigqueueinfo;
diff --git a/sysdeps/unix/sysv/linux/aio_sigqueue.c b/sysdeps/unix/sysv/linux/aio_sigqueue.c
index 30e9fbf7e5..44ff22ea7d 100644
--- a/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2003,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2003 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
@@ -26,7 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <aio_misc.h>
+#include "aio_misc.h"
#ifdef __NR_rt_sigqueueinfo
@@ -53,5 +52,5 @@ __aio_sigqueue (sig, val, caller_pid)
sig, __ptrvalue (&info));
}
#else
-# include <rt/aio_sigqueue.c>
+# include <sysdeps/generic/aio_sigqueue.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist
new file mode 100644
index 0000000000..bba6642b42
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/Dist
@@ -0,0 +1,19 @@
+alpha/ptrace.h
+alpha/regdef.h
+clone.S
+dl-brk.S
+ieee_get_fp_control.S
+ieee_set_fp_control.S
+ioperm.c
+ipc_priv.h
+kernel_sigaction.h
+kernel_stat.h
+kernel_termios.h
+oldglob.c
+rt_sigaction.S
+sizes.h
+sys/acct.h
+sys/io.h
+sys/procfs.h
+sys/user.h
+xstatconv.c
diff --git a/sysdeps/unix/sysv/linux/alpha/Implies b/sysdeps/unix/sysv/linux/alpha/Implies
index 1616efecbe..8d91c80097 100644
--- a/sysdeps/unix/sysv/linux/alpha/Implies
+++ b/sysdeps/unix/sysv/linux/alpha/Implies
@@ -1,4 +1 @@
unix/sysv/linux/wordsize-64
-# These supply the ABI compatibility for when long double was double.
-ieee754/ldbl-64-128
-ieee754/ldbl-opt
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index f64f23fd7a..37a9214fe9 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -26,13 +26,3 @@ endif
ifeq ($(subdir),signal)
sysdep_routines += rt_sigaction
endif
-
-ifeq ($(subdir),math)
-# These 2 routines are normally in libgcc{.a,_s.so.1}.
-# However, alpha -mlong-double-128 libgcc relies on
-# glibc providing _Ots* routines and without these files
-# glibc relies on __multc3/__divtc3 only provided
-# by libgcc if configured with -mlong-double-128.
-# Provide these routines here as well.
-libm-routines += multc3 divtc3
-endif # math
diff --git a/sysdeps/unix/sysv/linux/alpha/Versions b/sysdeps/unix/sysv/linux/alpha/Versions
index 8709dd2a38..ca79c7e444 100644
--- a/sysdeps/unix/sysv/linux/alpha/Versions
+++ b/sysdeps/unix/sysv/linux/alpha/Versions
@@ -73,10 +73,6 @@ libc {
#errlist-compat 132
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
- GLIBC_2.4 {
- #errlist-compat 138
- _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
- }
GLIBC_PRIVATE {
__libc_alpha_cache_shape;
}
diff --git a/sysdeps/unix/sysv/linux/alpha/adjtime.c b/sysdeps/unix/sysv/linux/alpha/adjtime.c
index 1700524d34..e206cb4727 100644
--- a/sysdeps/unix/sysv/linux/alpha/adjtime.c
+++ b/sysdeps/unix/sysv/linux/alpha/adjtime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003, 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
@@ -19,7 +19,7 @@
#include <shlib-compat.h>
#include <sysdep.h>
#include <sys/time.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#if !defined __ASSUME_TIMEVAL64 || SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
struct timeval32
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
index 8b2f152a1c..9cdc167bf7 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux/Alpha specific version.
- Copyright (C) 1996,1997,1998,1999,2002,2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 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
@@ -31,12 +31,6 @@
# define ECANCELED 131
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
-# ifndef EOWNERDEAD
-# define EOWNERDEAD 136
-# define ENOTRECOVERABLE 137
-# endif
-
# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable. */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index f17dc2bdc1..ce4a5da37f 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995-2000, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 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
@@ -21,10 +21,8 @@
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
+
#include <sys/types.h>
-#ifdef __USE_GNU
-# include <bits/uio.h>
-#endif
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
@@ -46,9 +44,9 @@
#define O_ASYNC 020000 /* fcntl, for BSD compatibility */
#ifdef __USE_GNU
+# define O_DIRECT 040000 /* Direct disk access. */
# define O_DIRECTORY 0100000 /* Must be a directory. */
# define O_NOFOLLOW 0200000 /* Do not follow links. */
-# define O_DIRECT 02000000 /* Direct disk access. */
# define O_NOATIME 04000000 /* Do not set atime. */
#endif
@@ -94,7 +92,7 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
#endif
-/* for F_[GET|SET]FD */
+/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf() */
@@ -175,55 +173,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
-
-#ifdef __USE_GNU
-/* Flags for SYNC_FILE_RANGE. */
-# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
- in the range before performing the
- write. */
-# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
- dirty pages in the range which are
- not presently under writeback. */
-# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
- the range after performing the
- write. */
-
-/* Flags for SPLICE and VMSPLICE. */
-# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
-# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
- (but we may still block on the fd
- we splice from/to). */
-# define SPLICE_F_MORE 4 /* Expect more data. */
-# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
-#endif
-
__BEGIN_DECLS
-#ifdef __USE_GNU
-
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
-
-/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
- unsigned int __flags);
-
-
-/* Splice address range into a pipe. */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
-
-/* Splice two files together. */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
- __off64_t *__offout, size_t __len, unsigned int __flags)
- __THROW;
-
-/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-
-#endif
-
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/mman.h b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
index 2f0e564916..bb41887479 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/Alpha version.
- Copyright (C) 1997, 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2003 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
@@ -86,7 +86,6 @@
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
#endif
/* Advice to `madvise'. */
@@ -96,9 +95,6 @@
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define MADV_WILLNEED 3 /* Will need these pages. */
# define MADV_DONTNEED 6 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index 2163745840..54d6819412 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Alpha/Linux version.
- Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+ Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -89,18 +89,7 @@ enum __rlimit_resource
__RLIMIT_MSGQUEUE = 12,
#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
- /* Maximum nice priority allowed to raise to.
- Nice levels 19 .. -20 correspond to 0 .. 39
- values of this resource limit. */
- __RLIMIT_NICE = 13,
-#define RLIMIT_NICE __RLIMIT_NICE
-
- /* Maximum realtime priority allowed for non-priviledged
- processes. */
- __RLIMIT_RTPRIO = 14,
-#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
-
- __RLIMIT_NLIMITS = 15,
+ __RLIMIT_NLIMITS = 13,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
#define RLIM_NLIMITS __RLIM_NLIMITS
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/shm.h b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
index 35226c16ce..bbee434ea0 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/shm.h
@@ -71,7 +71,6 @@ struct shmid_ds
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
# define SHM_LOCKED 02000 /* segment will not be swapped */
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
-# define SHM_NORESERVE 010000 /* don't check for reservations */
struct shminfo
{
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
index 966ccf94da..f26e84c9f6 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2003, 2005
+ Copyright (C) 1993,1994,1995,1996,1997,1999,2003
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -91,42 +91,34 @@ struct termios
#define OFILL 00000100
#define OFDEL 00000200
-#if defined __USE_MISC || defined __USE_XOPEN
-# define NLDLY 00001400
-# define NL0 00000000
-# define NL1 00000400
-# define NL2 00001000
-# define NL3 00001400
-# define TABDLY 00006000
-# define TAB0 00000000
-# define TAB1 00002000
-# define TAB2 00004000
-# define TAB3 00006000
-# define CRDLY 00030000
-# define CR0 00000000
-# define CR1 00010000
-# define CR2 00020000
-# define CR3 00030000
-# define FFDLY 00040000
-# define FF0 00000000
-# define FF1 00040000
-# define BSDLY 00100000
-# define BS0 00000000
-# define BS1 00100000
-#endif
-
+#define NLDLY 00001400
+#define NL0 00000000
+#define NL1 00000400
+#define NL2 00001000
+#define NL3 00001400
+#define TABDLY 00006000
+#define TAB0 00000000
+#define TAB1 00002000
+#define TAB2 00004000
+#define TAB3 00006000
+#define CRDLY 00030000
+#define CR0 00000000
+#define CR1 00010000
+#define CR2 00020000
+#define CR3 00030000
+#define FFDLY 00040000
+#define FF0 00000000
+#define FF1 00040000
+#define BSDLY 00100000
+#define BS0 00000000
+#define BS1 00100000
#define VTDLY 00200000
#define VT0 00000000
#define VT1 00200000
-
-#ifdef __USE_MISC
-# define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
-#endif
+#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
/* c_cflag bit meaning */
-#ifdef __USE_MISC
-# define CBAUD 0000037
-#endif
+#define CBAUD 0000037
#define B0 0000000 /* hang up */
#define B50 0000001
#define B75 0000002
@@ -143,11 +135,9 @@ struct termios
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017
-#ifdef __USE_MISC
-# define EXTA B19200
-# define EXTB B38400
-# define CBAUDEX 0000000
-#endif
+#define EXTA B19200
+#define EXTB B38400
+#define CBAUDEX 0000000
#define B57600 00020
#define B115200 00021
#define B230400 00022
@@ -179,30 +169,23 @@ struct termios
#define HUPCL 00040000
#define CLOCAL 00100000
-#ifdef __USE_MISC
-# define CMSPAR 010000000000 /* mark or space (stick) parity */
-# define CRTSCTS 020000000000 /* flow control */
-#endif
+#define CRTSCTS 020000000000 /* flow control */
/* c_lflag bits */
#define ISIG 0x00000080
#define ICANON 0x00000100
-#if defined __USE_MISC || defined __USE_XOPEN
-# define XCASE 0x00004000
-#endif
+#define XCASE 0x00004000
#define ECHO 0x00000008
#define ECHOE 0x00000002
#define ECHOK 0x00000004
#define ECHONL 0x00000010
#define NOFLSH 0x80000000
#define TOSTOP 0x00400000
-#ifdef __USE_MISC
-# define ECHOCTL 0x00000040
-# define ECHOPRT 0x00000020
-# define ECHOKE 0x00000001
-# define FLUSHO 0x00800000
-# define PENDIN 0x20000000
-#endif
+#define ECHOCTL 0x00000040
+#define ECHOPRT 0x00000020
+#define ECHOKE 0x00000001
+#define FLUSHO 0x00800000
+#define PENDIN 0x20000000
#define IEXTEN 0x00000400
/* Values for the ACTION argument to `tcflow'. */
diff --git a/sysdeps/unix/sysv/linux/alpha/clone.S b/sysdeps/unix/sysv/linux/alpha/clone.S
index 5e0b21ea15..1c450d1737 100644
--- a/sysdeps/unix/sysv/linux/alpha/clone.S
+++ b/sysdeps/unix/sysv/linux/alpha/clone.S
@@ -146,4 +146,4 @@ thread_start:
.end thread_start
-weak_alias (__clone, clone)
+weak_alias(__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c b/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
index d95e46f6f1..a0214b0072 100644
--- a/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
@@ -1,5 +1,5 @@
-/* Operating system support for run-time dynamic linker. Linux/Alpha version.
- Copyright (C) 1997, 1998, 2001, 2003, 2006 Free Software Foundation, Inc.
+/* Operating system support for run-time dynamic linker. Linux/PPC version.
+ Copyright (C) 1997, 1998, 2001, 2003 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
@@ -17,8 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <config.h>
-#include <kernel-features.h>
+
+#include "config.h"
+#include "kernel-features.h"
#include <ldsodefs.h>
extern long __libc_alpha_cache_shape[4];
diff --git a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c
index 5e63be5cc7..07f055886e 100644
--- a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c
+++ b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -19,7 +19,7 @@
#include <fenv_libc.h>
#include <sysdep.h>
#include <float.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include "kernel_sysinfo.h"
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c
deleted file mode 100644
index 497694619a..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#define __fxstatat64 __fxstatat64_disable
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <kernel_stat.h>
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <xstatconv.h>
-
-#undef __fxstatat64
-
-
-/* Get information about the file NAME in BUF. */
-int
-__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
-{
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
- struct kernel_stat kst;
-
- if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, file, st);
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, file, st);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
- if (errno_out != ENOSYS)
- goto fail;
- __libc_missing_axp_stat64 = 1;
- }
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
- else
- result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kst, st);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __atfct_seterrno (errno_out, fd, buf);
-
- return -1;
-}
-libc_hidden_def (__fxstatat)
-strong_alias (__fxstatat, __fxstatat64);
-libc_hidden_ver(__fxstatat, __fxstatat64);
diff --git a/sysdeps/unix/sysv/linux/alpha/getcontext.S b/sysdeps/unix/sysv/linux/alpha/getcontext.S
index f010f337e6..3566890cf9 100644
--- a/sysdeps/unix/sysv/linux/alpha/getcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -41,7 +41,7 @@ ENTRY (__getcontext)
ret
END(__getcontext)
-weak_alias (__getcontext, getcontext)
+weak_alias(__getcontext, getcontext)
/* An internal routine used by getcontext and setcontext.
@@ -57,8 +57,6 @@ weak_alias (__getcontext, getcontext)
__getcontext_x:
cfi_register (64, 0)
- .set noat
-
/* Return value of getcontext. $0 is the only register
whose value is not preserved. */
stq $31, UC_SIGCTX+SC_REGS($16)
diff --git a/sysdeps/unix/sysv/linux/alpha/getitimer.S b/sysdeps/unix/sysv/linux/alpha/getitimer.S
index 6644a5c36d..c2bc565afc 100644
--- a/sysdeps/unix/sysv/linux/alpha/getitimer.S
+++ b/sysdeps/unix/sysv/linux/alpha/getitimer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/getrusage.S b/sysdeps/unix/sysv/linux/alpha/getrusage.S
index 0bca4b5f23..2c34e98ce6 100644
--- a/sysdeps/unix/sysv/linux/alpha/getrusage.S
+++ b/sysdeps/unix/sysv/linux/alpha/getrusage.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
@@ -145,5 +145,5 @@ strong_alias(__getrusage_tv64, ____getrusage_tv64)
default_symbol_version (____getrusage_tv64, __getrusage, GLIBC_2.1)
default_symbol_version (__getrusage_tv64, getrusage, GLIBC_2.1)
#else
-weak_alias (__getrusage, getrusage)
+weak_alias(__getrusage, getrusage)
#endif
diff --git a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
index 7c9183a4fe..1a6f88b03a 100644
--- a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
+++ b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2002, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2002, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/glob.c b/sysdeps/unix/sysv/linux/alpha/glob.c
index 84573899d6..a51020d51f 100644
--- a/sysdeps/unix/sysv/linux/alpha/glob.c
+++ b/sysdeps/unix/sysv/linux/alpha/glob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 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
@@ -35,7 +35,7 @@ extern int __new_glob (const char *__pattern, int __flags,
glob_t *__pglob);
extern void __new_globfree (glob_t *__pglob);
-#include <posix/glob.c>
+#include <sysdeps/generic/glob.c>
#undef glob
#undef globfree
diff --git a/sysdeps/unix/sysv/linux/alpha/msgctl.c b/sysdeps/unix/sysv/linux/alpha/msgctl.c
index a59911fe40..1b75af2b80 100644
--- a/sysdeps/unix/sysv/linux/alpha/msgctl.c
+++ b/sysdeps/unix/sysv/linux/alpha/msgctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -26,7 +26,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
struct __old_msqid_ds
{
diff --git a/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h b/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h
deleted file mode 100644
index bd985cc59c..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/nldbl-abi.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* ABI version for long double switch.
- This is used by the Versions and math_ldbl_opt.h files in
- sysdeps/ieee754/ldbl-opt/. It gives the ABI version where
- long double == double was replaced with proper long double
- for libm *l functions and libc functions using long double. */
-
-#define NLDBL_VERSION GLIBC_2.4
-#define LONG_DOUBLE_COMPAT_VERSION GLIBC_2_4
diff --git a/sysdeps/unix/sysv/linux/alpha/oldglob.c b/sysdeps/unix/sysv/linux/alpha/oldglob.c
index 6d9b79f2c3..9d39176f6b 100644
--- a/sysdeps/unix/sysv/linux/alpha/oldglob.c
+++ b/sysdeps/unix/sysv/linux/alpha/oldglob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 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
@@ -91,7 +91,6 @@ __old_globfree (old_glob_t *pglob)
/* We only need these two symbols. */
correct.gl_pathc = pglob->gl_pathc;
correct.gl_pathv = pglob->gl_pathv;
- correct.gl_offs = pglob->gl_offs;
globfree (&correct);
}
diff --git a/sysdeps/unix/sysv/linux/alpha/select.S b/sysdeps/unix/sysv/linux/alpha/select.S
index 35a81e949f..458cda9246 100644
--- a/sysdeps/unix/sysv/linux/alpha/select.S
+++ b/sysdeps/unix/sysv/linux/alpha/select.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2002,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2002, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep-cancel.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
@@ -63,7 +63,7 @@ LEAF(SELECT, 64)
ldl t0, __libc_missing_axp_tv64
#endif
- /* Save timeout early, since we'll need to recover this after
+ /* Save timeout early, since we'll need to recover this after
the system call. */
stq a4, 48(sp)
diff --git a/sysdeps/unix/sysv/linux/alpha/semctl.c b/sysdeps/unix/sysv/linux/alpha/semctl.c
index 9957f983bf..6925c3f058 100644
--- a/sysdeps/unix/sysv/linux/alpha/semctl.c
+++ b/sysdeps/unix/sysv/linux/alpha/semctl.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -27,7 +26,7 @@
#include <string.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
struct __old_semid_ds
{
diff --git a/sysdeps/unix/sysv/linux/alpha/setcontext.S b/sysdeps/unix/sysv/linux/alpha/setcontext.S
index 27abfd0c12..7d443d41c7 100644
--- a/sysdeps/unix/sysv/linux/alpha/setcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/setcontext.S
@@ -32,4 +32,4 @@
PSEUDO(__setcontext, sigreturn, 1)
ret
PSEUDO_END(__setcontext)
-weak_alias (__setcontext, setcontext)
+weak_alias(__setcontext, setcontext)
diff --git a/sysdeps/unix/sysv/linux/alpha/setitimer.S b/sysdeps/unix/sysv/linux/alpha/setitimer.S
index 59caeac680..16bbd2227f 100644
--- a/sysdeps/unix/sysv/linux/alpha/setitimer.S
+++ b/sysdeps/unix/sysv/linux/alpha/setitimer.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/settimeofday.S b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
index e39eadc208..b49c770a0a 100644
--- a/sysdeps/unix/sysv/linux/alpha/settimeofday.S
+++ b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/shmctl.c b/sysdeps/unix/sysv/linux/alpha/shmctl.c
index e63211fa00..4a9d9445ef 100644
--- a/sysdeps/unix/sysv/linux/alpha/shmctl.c
+++ b/sysdeps/unix/sysv/linux/alpha/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -27,7 +27,7 @@
#include <bits/wordsize.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
struct __old_shmid_ds
{
diff --git a/sysdeps/unix/sysv/linux/alpha/sigaction.c b/sysdeps/unix/sysv/linux/alpha/sigaction.c
index 26b081d9a3..21a2063c30 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigaction.c
+++ b/sysdeps/unix/sysv/linux/alpha/sigaction.c
@@ -17,8 +17,6 @@
02111-1307 USA. */
#include <sysdep.h>
-#include <sys/cdefs.h>
-#include <stddef.h>
/*
* In order to get the hidden arguments for rt_sigaction set up
diff --git a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S b/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
index 48c3f271c7..e5de55faeb 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
+++ b/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
@@ -29,5 +29,5 @@ PSEUDO(__sigsuspend, sigsuspend, 1)
ret
PSEUDO_END(__sigsuspend)
libc_hidden_def (__sigsuspend)
-weak_alias (__sigsuspend, sigsuspend)
+weak_alias(__sigsuspend, sigsuspend)
strong_alias (__sigsuspend, __libc_sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/alpha/swapcontext.S b/sysdeps/unix/sysv/linux/alpha/swapcontext.S
index 1221f67f78..5f6615e0b6 100644
--- a/sysdeps/unix/sysv/linux/alpha/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/alpha/swapcontext.S
@@ -48,4 +48,4 @@ ENTRY(__swapcontext)
#endif
END(__swapcontext)
-weak_alias (__swapcontext, swapcontext)
+weak_alias(__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/alpha/syscall.S b/sysdeps/unix/sysv/linux/alpha/syscall.S
index 0c4081363a..10a32d5dc8 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscall.S
+++ b/sysdeps/unix/sysv/linux/alpha/syscall.S
@@ -74,4 +74,4 @@ $error:
END(__syscall)
-weak_alias (__syscall, syscall)
+weak_alias(__syscall, syscall)
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 7b3f233566..3bbce1c6fd 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -16,6 +16,7 @@ oldsemctl EXTRA semctl i:iiii __old_semctl semctl@GLIBC_2.0
sigstack - sigstack 2 sigstack
vfork - vfork 0 __vfork vfork
+getpeername - getpeername i:ipp __getpeername getpeername
getpriority - getpriority i:ii __getpriority getpriority
open - open Ci:siv __libc_open __open open !__libc_open64 __open64 open64
open64 open -
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index a22da71d60..c3de78f4bb 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -22,8 +22,10 @@
#define _LINUX_ALPHA_SYSDEP_H 1
#ifdef __ASSEMBLER__
+
#include <asm/pal.h>
#include <alpha/regdef.h>
+
#endif
/* There is some commonality. */
diff --git a/sysdeps/unix/sysv/linux/alpha/utimes.S b/sysdeps/unix/sysv/linux/alpha/utimes.S
index 0dd0a9372b..c210e1d12f 100644
--- a/sysdeps/unix/sysv/linux/alpha/utimes.S
+++ b/sysdeps/unix/sysv/linux/alpha/utimes.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/wait4.S b/sysdeps/unix/sysv/linux/alpha/wait4.S
index 634993deb8..8d89e3d46e 100644
--- a/sysdeps/unix/sysv/linux/alpha/wait4.S
+++ b/sysdeps/unix/sysv/linux/alpha/wait4.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2003 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
@@ -19,7 +19,7 @@
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
.text
diff --git a/sysdeps/unix/sysv/linux/alpha/wordexp.c b/sysdeps/unix/sysv/linux/alpha/wordexp.c
index c2972e40c2..1921a03388 100644
--- a/sysdeps/unix/sysv/linux/alpha/wordexp.c
+++ b/sysdeps/unix/sysv/linux/alpha/wordexp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 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
@@ -22,7 +22,7 @@
#define wordexp(words, pwordexp, flags) \
__new_wordexp (words, pwordexp, flags)
-#include <posix/wordexp.c>
+#include <sysdeps/generic/wordexp.c>
versioned_symbol (libc, __new_wordexp, wordexp, GLIBC_2_2_2);
diff --git a/sysdeps/unix/sysv/linux/alpha/xstatconv.h b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
index 094d11e5c9..846bb02994 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstatconv.h
+++ b/sysdeps/unix/sysv/linux/alpha/xstatconv.h
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <kernel-features.h>
+#include "kernel-features.h"
extern int __libc_missing_axp_stat64 attribute_hidden;
extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
diff --git a/sysdeps/unix/sysv/linux/arm/Dist b/sysdeps/unix/sysv/linux/arm/Dist
new file mode 100644
index 0000000000..aa9eb1a227
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/Dist
@@ -0,0 +1,14 @@
+clone.S
+dl-procinfo.h
+ioperm.c
+setresuid.c
+setresgid.c
+setfsuid.c
+setfsgid.c
+sigrestorer.S
+bits/armsigctx.h
+sys/elf.h
+sys/io.h
+sys/procfs.h
+sys/user.h
+oldgetrlimit64.c
diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile
new file mode 100644
index 0000000000..0ccdbe81f6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/Makefile
@@ -0,0 +1,12 @@
+ifeq ($(subdir),misc)
+sysdep_routines += ioperm
+sysdep_headers += sys/elf.h sys/io.h
+endif
+
+ifeq ($(subdir),signal)
+sysdep_routines += sigrestorer
+endif
+
+ifeq ($(subdir),resource)
+sysdep_routines += oldgetrlimit64
+endif
diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions
new file mode 100644
index 0000000000..2ddb2af2b7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/Versions
@@ -0,0 +1,37 @@
+libc {
+ GLIBC_2.0 {
+ # Exception handling support functions from libgcc
+ __register_frame; __register_frame_table; __deregister_frame;
+ __frame_state_for; __register_frame_info_table;
+ }
+ GLIBC_2.1 {
+ ioperm; iopl;
+ inb; inw; inl;
+ outb; outw; outl;
+ }
+ GLIBC_2.2 {
+ # functions used in other libraries
+ __xstat64; __fxstat64; __lxstat64;
+
+ # a*
+ alphasort64;
+
+ # g*
+ glob64;
+
+ # New rlimit interface
+ getrlimit; setrlimit; getrlimit64;
+
+ # r*
+ readdir64; readdir64_r;
+
+ # s*
+ scandir64;
+
+ # v*
+ versionsort64;
+ }
+ GLIBC_2.3.3 {
+ posix_fadvise64; posix_fallocate64;
+ }
+}
diff --git a/sysdeps/unix/sysv/linux/arm/alphasort64.c b/sysdeps/unix/sysv/linux/arm/alphasort64.c
new file mode 100644
index 0000000000..0b5ae47d2f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/alphasort64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/alphasort64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h b/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h
new file mode 100644
index 0000000000..4530cdbda9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h
@@ -0,0 +1,73 @@
+/* Definition of `struct sigcontext' for Linux/ARM
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* The format of struct sigcontext changed between 2.0 and 2.1 kernels.
+ Fortunately 2.0 puts a magic number in the first word and this is not
+ a legal value for `trap_no', so we can tell them apart. */
+
+/* Early 2.2 and 2.3 kernels do not have the `fault_address' member in
+ the sigcontext structure. Unfortunately there is no reliable way
+ to test for its presence and this word will contain garbage for too-old
+ kernels. Versions 2.2.14 and 2.3.35 (plus later versions) are known to
+ include this element. */
+
+#ifndef __ARMSIGCTX_H
+#define __ARMSIGCTX_H 1
+
+#include <asm/ptrace.h>
+
+union k_sigcontext
+ {
+ struct
+ {
+ unsigned long int trap_no;
+ unsigned long int error_code;
+ unsigned long int oldmask;
+ unsigned long int arm_r0;
+ unsigned long int arm_r1;
+ unsigned long int arm_r2;
+ unsigned long int arm_r3;
+ unsigned long int arm_r4;
+ unsigned long int arm_r5;
+ unsigned long int arm_r6;
+ unsigned long int arm_r7;
+ unsigned long int arm_r8;
+ unsigned long int arm_r9;
+ unsigned long int arm_r10;
+ unsigned long int arm_fp;
+ unsigned long int arm_ip;
+ unsigned long int arm_sp;
+ unsigned long int arm_lr;
+ unsigned long int arm_pc;
+ unsigned long int arm_cpsr;
+ unsigned long fault_address;
+ } v21;
+ struct
+ {
+ unsigned long int magic;
+ struct pt_regs reg;
+ unsigned long int trap_no;
+ unsigned long int error_code;
+ unsigned long int oldmask;
+ } v20;
+};
+
+#define SIGCONTEXT_2_0_MAGIC 0x4B534154
+
+#endif /* bits/armsigctx.h */
diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
new file mode 100644
index 0000000000..3574e750ff
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
@@ -0,0 +1,189 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995-1998, 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECTORY 040000 /* Must be a directory. */
+# define O_NOFOLLOW 0100000 /* Do not follow links. */
+# define O_DIRECT 0200000 /* Direct disk access. */
+# define O_NOATIME 01000000 /* Do not set atime. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0400000
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+/* 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. */
+
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+#endif
+#define F_GETLK64 12 /* Get record locking info. */
+#define F_SETLK64 13 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 14 /* Set record locking info (blocking). */
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+#endif
+
+/* For F_[GET|SET]FL. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+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
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#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. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+__BEGIN_DECLS
+
+/* Provide kernel hint to read ahead. */
+extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+ __THROW;
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/arm/bits/mman.h b/sysdeps/unix/sysv/linux/arm/bits/mman.h
new file mode 100644
index 0000000000..4ec6839685
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/bits/mman.h
@@ -0,0 +1,99 @@
+/* Definitions for POSIX memory map interface. Linux/ARM version.
+ Copyright (C) 1997, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never include this file directly. Use <sys/mman.h> instead"
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific. */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x02000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
+# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
+# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Flags for `mlockall'. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/arm/brk.c
index b381baa285..153d89358a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/arm/brk.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* brk system call for Linux/ARM.
+ Copyright (C) 1995, 1996 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
@@ -16,27 +17,33 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <errno.h>
+#include <unistd.h>
#include <sysdep.h>
-#include <bp-checks.h>
-#include <stddef.h>
-#include <sys/time.h>
-#include <time.h>
-#include <hp-timing.h>
-#undef __gettimeofday
-#include <bits/libc-vdso.h>
-
-/* Get the current time of day and timezone information,
- putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
- Returns 0 on success, -1 on errors. */
+/* This must be initialized data because commons can't have aliases. */
+void *__curbrk = 0;
int
-__gettimeofday (tv, tz)
- struct timeval *tv;
- struct timezone *tz;
+__brk (void *addr)
{
- return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
-}
+ void *newbrk;
+
+ asm ("mov a1, %1\n" /* save the argment in r0 */
+ "swi %2\n" /* do the system call */
+ "mov %0, a1;" /* keep the return value */
+ : "=r"(newbrk)
+ : "r"(addr), "i" (SYS_ify (brk))
+ : "a1");
-INTDEF (__gettimeofday)
-weak_alias (__gettimeofday, gettimeofday)
+ __curbrk = newbrk;
+
+ if (newbrk < addr)
+ {
+ __set_errno (ENOMEM);
+ return -1;
+ }
+
+ return 0;
+}
+weak_alias (__brk, brk)
diff --git a/sysdeps/unix/sysv/linux/arm/chown.c b/sysdeps/unix/sysv/linux/arm/chown.c
new file mode 100644
index 0000000000..1961622564
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/chown.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/m68k/chown.c>
diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S
new file mode 100644
index 0000000000..bf07fb3952
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/clone.S
@@ -0,0 +1,60 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Pat Beirne <patb@corelcomputer.com>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* clone() is even more special than fork() as it mucks with stacks
+ and invokes a function in the right context after its all over. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
+
+ .text
+ENTRY(__clone)
+ @ sanity check args
+ cmp r0, #0
+ cmpne r1, #0
+ moveq r0, #-EINVAL
+ beq PLTJMP(syscall_error)
+
+ @ insert the args onto the new stack
+ str r3, [r1, #-4]!
+ str r0, [r1, #-4]!
+
+ @ do the system call
+ @ get flags
+ mov r0, r2
+ @ new sp is already in r1
+ swi SYS_ify(clone)
+ movs a1, a1
+ blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
+ RETINSTR(ne, lr)
+
+ @ pick the function arg and call address off the stack and execute
+ ldr r0, [sp, #4]
+ mov lr, pc
+ ldr pc, [sp]
+
+ @ and we are done, passing the return value through r0
+ b PLTJMP(_exit)
+
+PSEUDO_END (__clone)
+
+weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.c b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c
new file mode 100644
index 0000000000..9b87a2003d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c
@@ -0,0 +1,64 @@
+/* Data for Linux/ARM version of processor capability information.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <philb@gnu.org>, 2001.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This information must be kept in sync with the _DL_HWCAP_COUNT and
+ _DL_PLATFORM_COUNT definitions in procinfo.h.
+
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+ All the #ifdefs in the definitions ar equite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+ - PROCINFO_DECL is defined. This means we are only interested in
+ declarations.
+
+ - PROCINFO_DECL is not defined:
+
+ + if SHARED is defined the file is included in an array
+ initializer. The .element = { ... } syntax is needed.
+
+ + if SHARED is not defined a normal array initialization is
+ needed.
+ */
+
+#ifndef PROCINFO_CLASS
+#define PROCINFO_CLASS
+#endif
+
+#if !defined PROCINFO_DECL && defined SHARED
+ ._dl_arm_cap_flags
+#else
+PROCINFO_CLASS const char _dl_arm_cap_flags[8][10]
+#endif
+#ifndef PROCINFO_DECL
+= {
+ "swp", "half", "thumb", "26bit", "fast-mult", "fpa", "vfp", "edsp",
+ }
+#endif
+#if !defined SHARED || defined PROCINFO_DECL
+;
+#else
+,
+#endif
+
+#undef PROCINFO_DECL
+#undef PROCINFO_CLASS
diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
new file mode 100644
index 0000000000..35b333479b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
@@ -0,0 +1,86 @@
+/* Linux/ARM version of processor capability information handling macros.
+ Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <philb@gnu.org>, 2001.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DL_PROCINFO_H
+#define _DL_PROCINFO_H 1
+
+#include <ldsodefs.h>
+
+#define _DL_HWCAP_COUNT 8
+
+/* The kernel provides platform data but it is not interesting. */
+#define _DL_HWCAP_PLATFORM 0
+
+
+static inline int
+__attribute__ ((unused))
+_dl_procinfo (int word)
+{
+ int i;
+
+ _dl_printf ("AT_HWCAP: ");
+
+ for (i = 0; i < _DL_HWCAP_COUNT; ++i)
+ if (word & (1 << i))
+ _dl_printf (" %s", GLRO(dl_arm_cap_flags)[i]);
+
+ _dl_printf ("\n");
+
+ return 0;
+}
+
+static inline const char *
+__attribute__ ((unused))
+_dl_hwcap_string (int idx)
+{
+ return GLRO(dl_arm_cap_flags)[idx];
+};
+
+enum
+{
+ HWCAP_ARM_SWP = 1 << 0,
+ HWCAP_ARM_HALF = 1 << 1,
+ HWCAP_ARM_THUMB = 1 << 2,
+ HWCAP_ARM_26BIT = 1 << 3,
+ HWCAP_ARM_FAST_MULT = 1 << 4,
+ HWCAP_ARM_FPA = 1 << 5,
+ HWCAP_ARM_VFP = 1 << 6,
+ HWCAP_ARM_EDSP = 1 << 7,
+
+ HWCAP_IMPORTANT = (HWCAP_ARM_HALF | HWCAP_ARM_FAST_MULT)
+};
+
+static inline int
+__attribute__ ((unused))
+_dl_string_hwcap (const char *str)
+{
+ int i;
+
+ for (i = 0; i < _DL_HWCAP_COUNT; i++)
+ {
+ if (strcmp (str, GLRO(dl_arm_cap_flags)[i]) == 0)
+ return i;
+ }
+ return -1;
+};
+
+#define _dl_string_platform(str) (-1)
+
+#endif /* dl-procinfo.h */
diff --git a/sysdeps/unix/sysv/linux/arm/fchown.c b/sysdeps/unix/sysv/linux/arm/fchown.c
new file mode 100644
index 0000000000..3a69ecc9e7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/fchown.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fchown.c>
diff --git a/sysdeps/unix/sysv/linux/arm/fcntl.c b/sysdeps/unix/sysv/linux/arm/fcntl.c
new file mode 100644
index 0000000000..ea951bc4f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/fcntl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/arm/fxstat.c b/sysdeps/unix/sysv/linux/arm/fxstat.c
new file mode 100644
index 0000000000..4f219f0b9d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/fxstat.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fxstat.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getdents64.c b/sysdeps/unix/sysv/linux/arm/getdents64.c
new file mode 100644
index 0000000000..0c75fb5a06
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getdents64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getegid.c b/sysdeps/unix/sysv/linux/arm/getegid.c
new file mode 100644
index 0000000000..37b4b4a530
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getegid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getegid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/geteuid.c b/sysdeps/unix/sysv/linux/arm/geteuid.c
new file mode 100644
index 0000000000..ebcb555b5e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/geteuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/geteuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getgid.c b/sysdeps/unix/sysv/linux/arm/getgid.c
new file mode 100644
index 0000000000..0a4d6061f0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getgid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getgroups.c b/sysdeps/unix/sysv/linux/arm/getgroups.c
new file mode 100644
index 0000000000..102ea24e14
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getgroups.c
@@ -0,0 +1,2 @@
+/* We also have to rewrite the kernel gid_t to the user land type. */
+#include <sysdeps/unix/sysv/linux/i386/getgroups.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getresgid.c b/sysdeps/unix/sysv/linux/arm/getresgid.c
new file mode 100644
index 0000000000..b703a414cc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getresgid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getresgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getresuid.c b/sysdeps/unix/sysv/linux/arm/getresuid.c
new file mode 100644
index 0000000000..0b14cefe34
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getresuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getresuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit.c b/sysdeps/unix/sysv/linux/arm/getrlimit.c
new file mode 100644
index 0000000000..fc06dbd641
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getrlimit.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getrlimit64.c b/sysdeps/unix/sysv/linux/arm/getrlimit64.c
new file mode 100644
index 0000000000..fef018f471
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getrlimit64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/getuid.c b/sysdeps/unix/sysv/linux/arm/getuid.c
new file mode 100644
index 0000000000..d682c79a49
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/getuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/glob64.c b/sysdeps/unix/sysv/linux/arm/glob64.c
new file mode 100644
index 0000000000..82a9a296a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/glob64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/glob64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/ioperm.c b/sysdeps/unix/sysv/linux/arm/ioperm.c
new file mode 100644
index 0000000000..558b485b61
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/ioperm.c
@@ -0,0 +1,274 @@
+/* Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Phil Blundell, based on the Alpha version by
+ David Mosberger.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* I/O port access on the ARM is something of a fiction. What we do is to
+ map an appropriate area of /dev/mem into user space so that a program
+ can blast away at the hardware in such a way as to generate I/O cycles
+ on the bus. To insulate user code from dependencies on particular
+ hardware we don't allow calls to inb() and friends to be inlined, but
+ force them to come through code in here every time. Performance-critical
+ registers tend to be memory mapped these days so this should be no big
+ problem. */
+
+/* Once upon a time this file used mprotect to enable and disable
+ access to particular areas of I/O space. Unfortunately the
+ mprotect syscall also has the side effect of enabling caching for
+ the area affected (this is a kernel limitation). So we now just
+ enable all the ports all of the time. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/mman.h>
+
+#include <asm/page.h>
+#include <sys/sysctl.h>
+
+#define PATH_ARM_SYSTYPE "/etc/arm_systype"
+#define PATH_CPUINFO "/proc/cpuinfo"
+
+#define MAX_PORT 0x10000
+
+static struct {
+ unsigned long int base;
+ unsigned long int io_base;
+ unsigned int shift;
+ unsigned int initdone; /* since all the above could be 0 */
+} io;
+
+#define IO_BASE_FOOTBRIDGE 0x7c000000
+#define IO_SHIFT_FOOTBRIDGE 0
+
+static struct platform {
+ const char *name;
+ unsigned long int io_base;
+ unsigned int shift;
+} platform[] = {
+ /* All currently supported platforms are in fact the same. :-) */
+ {"Chalice-CATS", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"DEC-EBSA285", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"Corel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+ {"Rebel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
+};
+
+#define IO_ADDR(port) (io.base + ((port) << io.shift))
+
+/*
+ * Initialize I/O system. There are several ways to get the information
+ * we need. Each is tried in turn until one succeeds.
+ *
+ * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method
+ * but not all kernels support it.
+ *
+ * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
+ * - If it matches one of the entries in the table above, use the
+ * corresponding values.
+ * - If it begins with a number, assume this is a previously
+ * unsupported system and the values encode, in order,
+ * "<io_base>,<port_shift>".
+ *
+ * 3. Lookup the "system type" field in /proc/cpuinfo. Again, if it
+ * matches an entry in the platform[] table, use the corresponding
+ * values.
+ */
+
+static int
+init_iosys (void)
+{
+ char systype[256];
+ int i, n;
+ static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
+ static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+ size_t len = sizeof(io.base);
+
+ if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
+ && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
+ {
+ io.initdone = 1;
+ return 0;
+ }
+
+ n = readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
+ if (n > 0)
+ {
+ systype[n] = '\0';
+ if (isdigit (systype[0]))
+ {
+ if (sscanf (systype, "%li,%i", &io.io_base, &io.shift) == 2)
+ {
+ io.initdone = 1;
+ return 0;
+ }
+ /* else we're likely going to fail with the system match below */
+ }
+ }
+ else
+ {
+ FILE * fp;
+
+ fp = fopen (PATH_CPUINFO, "r");
+ if (! fp)
+ return -1;
+ while ((n = fscanf (fp, "Hardware\t: %256[^\n]\n", systype))
+ != EOF)
+ {
+ if (n == 1)
+ break;
+ else
+ fgets (systype, 256, fp);
+ }
+ fclose (fp);
+
+ if (n == EOF)
+ {
+ /* this can happen if the format of /proc/cpuinfo changes... */
+ fprintf (stderr,
+ "ioperm: Unable to determine system type.\n"
+ "\t(May need " PATH_ARM_SYSTYPE " symlink?)\n");
+ __set_errno (ENODEV);
+ return -1;
+ }
+ }
+
+ /* translate systype name into i/o system: */
+ for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i)
+ {
+ if (strcmp (platform[i].name, systype) == 0)
+ {
+ io.shift = platform[i].shift;
+ io.io_base = platform[i].io_base;
+ io.initdone = 1;
+ return 0;
+ }
+ }
+
+ /* systype is not a known platform name... */
+ __set_errno (ENODEV);
+ return -1;
+}
+
+int
+_ioperm (unsigned long int from, unsigned long int num, int turn_on)
+{
+ if (! io.initdone && init_iosys () < 0)
+ return -1;
+
+ /* this test isn't as silly as it may look like; consider overflows! */
+ if (from >= MAX_PORT || from + num > MAX_PORT)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ if (turn_on)
+ {
+ if (! io.base)
+ {
+ int fd;
+
+ fd = open ("/dev/mem", O_RDWR);
+ if (fd < 0)
+ return -1;
+
+ io.base =
+ (unsigned long int) __mmap (0, MAX_PORT << io.shift,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, io.io_base);
+ close (fd);
+ if ((long) io.base == -1)
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+int
+_iopl (unsigned int level)
+{
+ if (level > 3)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+ if (level)
+ {
+ return _ioperm (0, MAX_PORT, 1);
+ }
+ return 0;
+}
+
+
+void
+_outb (unsigned char b, unsigned long int port)
+{
+ *((volatile unsigned char *)(IO_ADDR (port))) = b;
+}
+
+
+void
+_outw (unsigned short b, unsigned long int port)
+{
+ *((volatile unsigned short *)(IO_ADDR (port))) = b;
+}
+
+
+void
+_outl (unsigned int b, unsigned long int port)
+{
+ *((volatile unsigned long *)(IO_ADDR (port))) = b;
+}
+
+
+unsigned int
+_inb (unsigned long int port)
+{
+ return *((volatile unsigned char *)(IO_ADDR (port)));
+}
+
+
+unsigned int
+_inw (unsigned long int port)
+{
+ return *((volatile unsigned short *)(IO_ADDR (port)));
+}
+
+
+unsigned int
+_inl (unsigned long int port)
+{
+ return *((volatile unsigned long *)(IO_ADDR (port)));
+}
+
+weak_alias (_ioperm, ioperm);
+weak_alias (_iopl, iopl);
+weak_alias (_inb, inb);
+weak_alias (_inw, inw);
+weak_alias (_inl, inl);
+weak_alias (_outb, outb);
+weak_alias (_outw, outw);
+weak_alias (_outl, outl);
diff --git a/sysdeps/unix/sysv/linux/arm/lchown.c b/sysdeps/unix/sysv/linux/arm/lchown.c
new file mode 100644
index 0000000000..c89de99ba2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/lchown.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/lchown.c>
diff --git a/sysdeps/unix/sysv/linux/arm/lockf64.c b/sysdeps/unix/sysv/linux/arm/lockf64.c
new file mode 100644
index 0000000000..a88f5a784a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/lockf64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/lockf64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/lxstat.c b/sysdeps/unix/sysv/linux/arm/lxstat.c
new file mode 100644
index 0000000000..2371cd9719
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/lxstat.c
@@ -0,0 +1,2 @@
+#include <sysdeps/unix/sysv/linux/i386/lxstat.c>
+
diff --git a/sysdeps/unix/sysv/linux/arm/mmap.S b/sysdeps/unix/sysv/linux/arm/mmap.S
new file mode 100644
index 0000000000..cf6f253378
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -0,0 +1,92 @@
+/* Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <kernel-features.h>
+
+#define EINVAL 22
+
+ .text
+
+ENTRY (__mmap)
+# ifdef __ASSUME_MMAP2_SYSCALL
+ /* This code is actually a couple of cycles slower than the
+ sys_mmap version below, so it might seem like a loss. But the
+ code path inside the kernel is sufficiently much shorter to
+ make it a net gain to use mmap2 when it's known to be
+ available. */
+
+ /* shuffle args */
+ str r5, [sp, #-4]!
+ ldr r5, [sp, #8]
+ str r4, [sp, #-4]!
+ ldr r4, [sp, #8]
+
+ /* convert offset to pages */
+ movs ip, r5, lsl #20
+ bne .Linval
+ mov r5, r5, lsr #12
+
+ /* do the syscall */
+ swi SYS_ify (mmap2)
+
+ /* restore registers */
+2:
+ ldr r4, [sp], #4
+ ldr r5, [sp], #4
+
+ cmn r0, $4096
+ RETINSTR(cc, lr)
+ b PLTJMP(syscall_error)
+
+.Linval:
+ mov r0, #-EINVAL
+ b 2b
+# else
+ /* Because we can only get five args through the syscall interface, and
+ mmap() takes six, we need to build a parameter block and pass its
+ address instead. The 386 port does a similar trick. */
+
+ /* This code previously moved sp into ip and stored the args using
+ stmdb ip!, {a1-a4}. It did not modify sp, so the stack never had
+ to be restored after the syscall completed. It saved an
+ instruction and meant no stack cleanup work was required.
+
+ This will not work in the case of a mmap call being interrupted
+ by a signal. If the signal handler uses any stack the arguments
+ to mmap will be trashed. The results of a restart of mmap are
+ then unpredictable. */
+
+ /* store args on the stack */
+ stmdb sp!, {a1-a4}
+
+ /* do the syscall */
+ mov a1, sp
+ swi SYS_ify (mmap)
+
+ /* pop args off the stack. */
+ add sp, sp, #16
+
+ cmn r0, $4096
+ RETINSTR(cc, lr)
+ b PLTJMP(syscall_error);
+#endif
+
+PSEUDO_END (__mmap)
+
+weak_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/arm/mmap64.S b/sysdeps/unix/sysv/linux/arm/mmap64.S
new file mode 100644
index 0000000000..b4b712c2f2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/mmap64.S
@@ -0,0 +1,80 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+#define EINVAL 22
+#define ENOSYS 38
+
+#include "kernel-features.h"
+
+ /* The mmap2 system call takes six arguments, all in registers. */
+ .text
+ENTRY (__mmap64)
+#ifdef __NR_mmap2
+ ldr ip, [sp, $4] @ offset low part
+ str r5, [sp, #-4]!
+ ldr r5, [sp, $12] @ offset high part
+ str r4, [sp, #-4]!
+ movs r4, ip, lsl $20 @ check that offset is page-aligned
+ mov ip, ip, lsr $12
+ moveqs r4, r5, lsr $12 @ check for overflow
+ bne .Linval
+ ldr r4, [sp, $8] @ load fd
+ orr r5, ip, r5, lsl $20 @ compose page offset
+ mov ip, r0
+ swi SYS_ify (mmap2)
+ cmn r0, $4096
+# ifdef __ASSUME_MMAP2_SYSCALL
+ ldr r4, [sp], #4
+ ldr r5, [sp], #4
+ RETINSTR(cc, lr)
+ b PLTJMP(syscall_error)
+# else
+ ldrcc r4, [sp], #4
+ ldrcc r5, [sp], #4
+ RETINSTR(cc, lr)
+ cmn r0, $ENOSYS
+ bne .Lerror
+ /* The current kernel does not support mmap2. Fall back to plain
+ mmap if the offset is small enough. */
+ ldr r5, [sp, $16]
+ mov r0, ip @ first arg was clobbered
+ teq r5, $0
+ ldreq r4, [sp], #4
+ ldreq r5, [sp], #4
+ beq PLTJMP(__mmap)
+# endif
+.Linval:
+ mov r0, $-EINVAL
+.Lerror:
+ ldr r4, [sp], #4
+ ldr r5, [sp], #4
+ b PLTJMP(syscall_error)
+#else
+ /* The kernel headers do not support mmap2. Fall back to plain
+ mmap if the offset is small enough. */
+ ldr ip, [sp, $8]
+ teq ip, $0
+ beq PLTJMP(__mmap)
+ mov r0, $-EINVAL
+ b PLTJMP(syscall_error)
+#endif
+PSEUDO_END (__mmap64)
+
+weak_alias (__mmap64, mmap64)
diff --git a/sysdeps/unix/sysv/linux/arm/msgctl.c b/sysdeps/unix/sysv/linux/arm/msgctl.c
new file mode 100644
index 0000000000..9f9b8431a3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/msgctl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/msgctl.c>
diff --git a/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c
new file mode 100644
index 0000000000..4c27e957bf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/profil-counter.h b/sysdeps/unix/sysv/linux/arm/profil-counter.h
new file mode 100644
index 0000000000..7639883f10
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/profil-counter.h
@@ -0,0 +1,37 @@
+/* Low-level statistical profiling support function. Linux/ARM version.
+ Copyright (C) 1996, 1997, 1998, 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <signal.h>
+#include <bits/armsigctx.h>
+
+void
+profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc)
+{
+ void *pc;
+ if (sc.v20.magic == SIGCONTEXT_2_0_MAGIC)
+ pc = (void *) sc.v20.reg.ARM_pc;
+ else
+ pc = (void *) sc.v21.arm_pc;
+ profil_count (pc);
+
+ /* This is a hack to prevent the compiler from implementing the
+ above function call as a sibcall. The sibcall would overwrite
+ the signal context. */
+ asm volatile ("");
+}
diff --git a/sysdeps/unix/sysv/linux/arm/readdir64.c b/sysdeps/unix/sysv/linux/arm/readdir64.c
new file mode 100644
index 0000000000..2ea26dd409
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/readdir64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/readdir64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/readdir64_r.c b/sysdeps/unix/sysv/linux/arm/readdir64_r.c
new file mode 100644
index 0000000000..9f54f897e3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/readdir64_r.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>
diff --git a/sysdeps/unix/sysv/linux/arm/register-dump.h b/sysdeps/unix/sysv/linux/arm/register-dump.h
new file mode 100644
index 0000000000..2baccb2cb7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/register-dump.h
@@ -0,0 +1,166 @@
+/* Dump registers.
+ Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <pb@nexus.co.uk>, 1998.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sys/uio.h>
+#include <stdio-common/_itoa.h>
+#include <bits/armsigctx.h>
+
+/* We will print the register dump in this format:
+
+ R0: XXXXXXXX R1: XXXXXXXX R2: XXXXXXXX R3: XXXXXXXX
+ R4: XXXXXXXX R5: XXXXXXXX R6: XXXXXXXX R7: XXXXXXXX
+ R8: XXXXXXXX R9: XXXXXXXX SL: XXXXXXXX FP: XXXXXXXX
+ IP: XXXXXXXX SP: XXXXXXXX LR: XXXXXXXX PC: XXXXXXXX
+
+ CPSR: XXXXXXXX
+
+ Trap: XXXXXXXX Error: XXXXXXXX OldMask: XXXXXXXX
+ Addr: XXXXXXXX
+
+ */
+
+static void
+hexvalue (unsigned long int value, char *buf, size_t len)
+{
+ char *cp = _itoa_word (value, buf + len, 16, 0);
+ while (cp > buf)
+ *--cp = '0';
+}
+
+static void
+register_dump (int fd, union k_sigcontext *ctx)
+{
+ char regs[21][8];
+ struct iovec iov[97];
+ size_t nr = 0;
+
+#define ADD_STRING(str) \
+ iov[nr].iov_base = (char *) str; \
+ iov[nr].iov_len = strlen (str); \
+ ++nr
+#define ADD_MEM(str, len) \
+ iov[nr].iov_base = str; \
+ iov[nr].iov_len = len; \
+ ++nr
+
+ /* Generate strings of register contents. */
+ if (ctx->v20.magic == SIGCONTEXT_2_0_MAGIC)
+ {
+ hexvalue (ctx->v20.reg.ARM_r0, regs[0], 8);
+ hexvalue (ctx->v20.reg.ARM_r1, regs[1], 8);
+ hexvalue (ctx->v20.reg.ARM_r2, regs[2], 8);
+ hexvalue (ctx->v20.reg.ARM_r3, regs[3], 8);
+ hexvalue (ctx->v20.reg.ARM_r4, regs[4], 8);
+ hexvalue (ctx->v20.reg.ARM_r5, regs[5], 8);
+ hexvalue (ctx->v20.reg.ARM_r6, regs[6], 8);
+ hexvalue (ctx->v20.reg.ARM_r7, regs[7], 8);
+ hexvalue (ctx->v20.reg.ARM_r8, regs[8], 8);
+ hexvalue (ctx->v20.reg.ARM_r9, regs[9], 8);
+ hexvalue (ctx->v20.reg.ARM_r10, regs[10], 8);
+ hexvalue (ctx->v20.reg.ARM_fp, regs[11], 8);
+ hexvalue (ctx->v20.reg.ARM_ip, regs[12], 8);
+ hexvalue (ctx->v20.reg.ARM_sp, regs[13], 8);
+ hexvalue (ctx->v20.reg.ARM_lr, regs[14], 8);
+ hexvalue (ctx->v20.reg.ARM_pc, regs[15], 8);
+ hexvalue (ctx->v20.reg.ARM_cpsr, regs[16], 8);
+ hexvalue (ctx->v20.trap_no, regs[17], 8);
+ hexvalue (ctx->v20.error_code, regs[18], 8);
+ hexvalue (ctx->v20.oldmask, regs[19], 8);
+ }
+ else
+ {
+ hexvalue (ctx->v21.arm_r0, regs[0], 8);
+ hexvalue (ctx->v21.arm_r1, regs[1], 8);
+ hexvalue (ctx->v21.arm_r2, regs[2], 8);
+ hexvalue (ctx->v21.arm_r3, regs[3], 8);
+ hexvalue (ctx->v21.arm_r4, regs[4], 8);
+ hexvalue (ctx->v21.arm_r5, regs[5], 8);
+ hexvalue (ctx->v21.arm_r6, regs[6], 8);
+ hexvalue (ctx->v21.arm_r7, regs[7], 8);
+ hexvalue (ctx->v21.arm_r8, regs[8], 8);
+ hexvalue (ctx->v21.arm_r9, regs[9], 8);
+ hexvalue (ctx->v21.arm_r10, regs[10], 8);
+ hexvalue (ctx->v21.arm_fp, regs[11], 8);
+ hexvalue (ctx->v21.arm_ip, regs[12], 8);
+ hexvalue (ctx->v21.arm_sp, regs[13], 8);
+ hexvalue (ctx->v21.arm_lr, regs[14], 8);
+ hexvalue (ctx->v21.arm_pc, regs[15], 8);
+ hexvalue (ctx->v21.arm_cpsr, regs[16], 8);
+ hexvalue (ctx->v21.trap_no, regs[17], 8);
+ hexvalue (ctx->v21.error_code, regs[18], 8);
+ hexvalue (ctx->v21.oldmask, regs[19], 8);
+ hexvalue (ctx->v21.fault_address, regs[20], 8);
+ }
+
+ /* Generate the output. */
+ ADD_STRING ("Register dump:\n\n R0: ");
+ ADD_MEM (regs[0], 8);
+ ADD_STRING (" R1: ");
+ ADD_MEM (regs[1], 8);
+ ADD_STRING (" R2: ");
+ ADD_MEM (regs[2], 8);
+ ADD_STRING (" R3: ");
+ ADD_MEM (regs[3], 8);
+ ADD_STRING ("\n R4: ");
+ ADD_MEM (regs[4], 8);
+ ADD_STRING (" R5: ");
+ ADD_MEM (regs[5], 8);
+ ADD_STRING (" R6: ");
+ ADD_MEM (regs[6], 8);
+ ADD_STRING (" R7: ");
+ ADD_MEM (regs[7], 8);
+ ADD_STRING ("\n R8: ");
+ ADD_MEM (regs[8], 8);
+ ADD_STRING (" R9: ");
+ ADD_MEM (regs[9], 8);
+ ADD_STRING (" SL: ");
+ ADD_MEM (regs[10], 8);
+ ADD_STRING (" FP: ");
+ ADD_MEM (regs[11], 8);
+ ADD_STRING ("\n IP: ");
+ ADD_MEM (regs[12], 8);
+ ADD_STRING (" SP: ");
+ ADD_MEM (regs[13], 8);
+ ADD_STRING (" LR: ");
+ ADD_MEM (regs[14], 8);
+ ADD_STRING (" PC: ");
+ ADD_MEM (regs[15], 8);
+ ADD_STRING ("\n\n CPSR: ");
+ ADD_MEM (regs[16], 8);
+ ADD_STRING ("\n\n Trap: ");
+ ADD_MEM (regs[17], 8);
+ ADD_STRING (" Error: ");
+ ADD_MEM (regs[18], 8);
+ ADD_STRING (" OldMask: ");
+ ADD_MEM (regs[19], 8);
+ if (ctx->v20.magic != SIGCONTEXT_2_0_MAGIC)
+ {
+ ADD_STRING ("\n Addr: ");
+ ADD_MEM (regs[20], 8);
+ }
+
+ ADD_STRING ("\n");
+
+ /* Write the stuff out. */
+ writev (fd, iov, nr);
+}
+
+
+#define REGISTER_DUMP register_dump (fd, &ctx)
diff --git a/sysdeps/unix/sysv/linux/arm/scandir64.c b/sysdeps/unix/sysv/linux/arm/scandir64.c
new file mode 100644
index 0000000000..506fd8877c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/scandir64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/scandir64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/semctl.c b/sysdeps/unix/sysv/linux/arm/semctl.c
new file mode 100644
index 0000000000..e9b1a483c9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/semctl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/semctl.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setegid.c b/sysdeps/unix/sysv/linux/arm/setegid.c
new file mode 100644
index 0000000000..2e3a54c893
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setegid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setegid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/seteuid.c b/sysdeps/unix/sysv/linux/arm/seteuid.c
new file mode 100644
index 0000000000..18e41d08c1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/seteuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setfsgid.c b/sysdeps/unix/sysv/linux/arm/setfsgid.c
new file mode 100644
index 0000000000..0886712569
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setfsgid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setfsgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setfsuid.c b/sysdeps/unix/sysv/linux/arm/setfsuid.c
new file mode 100644
index 0000000000..a9f22eb8ab
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setfsuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setfsuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setgid.c b/sysdeps/unix/sysv/linux/arm/setgid.c
new file mode 100644
index 0000000000..377021d9ec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setgid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setgroups.c b/sysdeps/unix/sysv/linux/arm/setgroups.c
new file mode 100644
index 0000000000..0e7086278f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setgroups.c
@@ -0,0 +1,2 @@
+/* We also have to rewrite the kernel gid_t to the user land type. */
+#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setregid.c b/sysdeps/unix/sysv/linux/arm/setregid.c
new file mode 100644
index 0000000000..99c57ad20f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setregid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setregid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setresgid.c b/sysdeps/unix/sysv/linux/arm/setresgid.c
new file mode 100644
index 0000000000..daca1a4833
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setresgid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setresuid.c b/sysdeps/unix/sysv/linux/arm/setresuid.c
new file mode 100644
index 0000000000..3aeabe9ad7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setresuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setreuid.c b/sysdeps/unix/sysv/linux/arm/setreuid.c
new file mode 100644
index 0000000000..8ad61226e9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setreuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setrlimit.c b/sysdeps/unix/sysv/linux/arm/setrlimit.c
new file mode 100644
index 0000000000..bfaef74c38
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setrlimit.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
diff --git a/sysdeps/unix/sysv/linux/arm/setuid.c b/sysdeps/unix/sysv/linux/arm/setuid.c
new file mode 100644
index 0000000000..de394379be
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/setuid.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/setuid.c>
diff --git a/sysdeps/unix/sysv/linux/arm/shmctl.c b/sysdeps/unix/sysv/linux/arm/shmctl.c
new file mode 100644
index 0000000000..7eac6380dd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/shmctl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/shmctl.c>
diff --git a/sysdeps/unix/sysv/linux/arm/sigaction.c b/sysdeps/unix/sysv/linux/arm/sigaction.c
new file mode 100644
index 0000000000..81b29adb2b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sigaction.c
@@ -0,0 +1,165 @@
+/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
+
+/* The difference here is that the sigaction structure used in the
+ kernel is not the same as we use in the libc. Therefore we must
+ translate it here. */
+#include <kernel_sigaction.h>
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+int __libc_missing_rt_sigs;
+
+#define SA_RESTORER 0x04000000
+
+extern void __default_sa_restorer(void);
+extern void __default_rt_sa_restorer(void);
+
+/* When RT signals are in use we need to use a different return stub. */
+#ifdef __NR_rt_sigreturn
+#define choose_restorer(flags) \
+ (flags & SA_SIGINFO) ? __default_rt_sa_restorer \
+ : __default_sa_restorer
+#else
+#define choose_restorer(flags) \
+ __default_sa_restorer
+#endif
+
+/* If ACT is not NULL, change the action for SIG to *ACT.
+ If OACT is not NULL, put the old action for SIG in *OACT. */
+int
+__libc_sigaction (sig, act, oact)
+ int sig;
+ const struct sigaction *act;
+ struct sigaction *oact;
+{
+#ifndef __ASSUME_REALTIME_SIGNALS
+ struct old_kernel_sigaction k_sigact, k_osigact;
+#endif
+ int result;
+
+#ifdef __NR_rt_sigaction
+ /* First try the RT signals. */
+# ifndef __ASSUME_REALTIME_SIGNALS
+ if (!__libc_missing_rt_sigs)
+# endif
+ {
+ struct kernel_sigaction kact, koact;
+# ifndef __ASSUME_REALTIME_SIGNALS
+ int saved_errno = errno;
+# endif
+
+ if (act)
+ {
+ kact.k_sa_handler = act->sa_handler;
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+ kact.sa_flags = act->sa_flags;
+# ifdef HAVE_SA_RESTORER
+ /* If the user specified SA_ONSTACK this means she is trying to
+ use the old-style stack switching. Unfortunately this
+ requires the sa_restorer field so we cannot install our own
+ handler. (In fact the user is likely to be out of luck anyway
+ since the kernel currently only supports stack switching via
+ the X/Open sigaltstack interface, but we allow for the
+ possibility that this might change in the future.) */
+ if (kact.sa_flags & (SA_RESTORER | SA_ONSTACK))
+ kact.sa_restorer = act->sa_restorer;
+ else
+ {
+ kact.sa_restorer = choose_restorer (kact.sa_flags);
+ kact.sa_flags |= SA_RESTORER;
+ }
+# endif
+ }
+
+ /* XXX The size argument hopefully will have to be changed to the
+ real size of the user-level sigset_t. */
+ result = INLINE_SYSCALL (rt_sigaction, 4, sig,
+ act ? __ptrvalue (&kact) : NULL,
+ oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+
+# ifndef __ASSUME_REALTIME_SIGNALS
+ if (result >= 0 || errno != ENOSYS)
+# endif
+ {
+ if (oact && result >= 0)
+ {
+ oact->sa_handler = koact.k_sa_handler;
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+ oact->sa_flags = koact.sa_flags;
+# ifdef HAVE_SA_RESTORER
+ oact->sa_restorer = koact.sa_restorer;
+# endif
+ }
+ return result;
+ }
+
+# ifndef __ASSUME_REALTIME_SIGNALS
+ __set_errno (saved_errno);
+ __libc_missing_rt_sigs = 1;
+# endif
+ }
+#endif
+
+#ifndef __ASSUME_REALTIME_SIGNALS
+ if (act)
+ {
+ k_sigact.k_sa_handler = act->sa_handler;
+ k_sigact.sa_mask = act->sa_mask.__val[0];
+ k_sigact.sa_flags = act->sa_flags;
+# ifdef HAVE_SA_RESTORER
+ /* See the comments above for why we test SA_ONSTACK. */
+ if (k_sigact.sa_flags & (SA_RESTORER | SA_ONSTACK))
+ k_sigact.sa_restorer = act->sa_restorer;
+ else
+ {
+ k_sigact.sa_restorer = choose_restorer (k_sigact.sa_flags);
+ k_sigact.sa_flags |= SA_RESTORER;
+ }
+# endif
+ }
+ result = INLINE_SYSCALL (sigaction, 3, sig,
+ act ? __ptrvalue (&k_sigact) : NULL,
+ oact ? __ptrvalue (&k_osigact) : NULL);
+ if (oact && result >= 0)
+ {
+ oact->sa_handler = k_osigact.k_sa_handler;
+ oact->sa_mask.__val[0] = k_osigact.sa_mask;
+ oact->sa_flags = k_osigact.sa_flags;
+# ifdef HAVE_SA_RESTORER
+ oact->sa_restorer = k_osigact.sa_restorer;
+# endif
+ }
+ return result;
+#endif
+}
+libc_hidden_def (__libc_sigaction)
+
+#ifndef LIBC_SIGACTION
+weak_alias (__libc_sigaction, __sigaction)
+libc_hidden_weak (__sigaction)
+weak_alias (__libc_sigaction, sigaction)
+#endif
diff --git a/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
new file mode 100644
index 0000000000..30c2e3a6ce
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <philb@gnu.org>, 1999.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <bits/armsigctx.h>
+#include "kernel-features.h"
+
+#define SIGCONTEXT int _a2, int _a3, int _a4, union k_sigcontext
+#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
+
+/* The sigcontext structure changed between 2.0 and 2.1 kernels. On any
+ modern system we should be able to assume that the "new" format will be
+ in use. */
+#if __LINUX_KERNEL_VERSION > 131328
+
+#define GET_PC(ctx) ((void *) ctx.v21.arm_pc)
+#define GET_FRAME(ctx) ADVANCE_STACK_FRAME ((void *) ctx.v21.arm_fp)
+#define GET_STACK(ctx) ((void *) ctx.v21.arm_sp)
+
+#else
+
+#define GET_PC(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_pc : ctx.v21.arm_pc))
+#define GET_FRAME(ctx) \
+ ADVANCE_STACK_FRAME((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_fp : ctx.v21.arm_fp))
+#define GET_STACK(ctx) ((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
+ ctx.v20.reg.ARM_sp : ctx.v21.arm_sp))
+
+#endif
+
+#define ADVANCE_STACK_FRAME(frm) \
+ ((struct layout *)frm - 1)
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/arm/sigrestorer.S b/sysdeps/unix/sysv/linux/arm/sigrestorer.S
new file mode 100644
index 0000000000..98e33cb8bc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sigrestorer.S
@@ -0,0 +1,33 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+/* If no SA_RESTORER function was specified by the application we use
+ one of these. This avoids the need for the kernel to synthesise a return
+ instruction on the stack, which would involve expensive cache flushes. */
+
+ENTRY(__default_sa_restorer)
+ swi SYS_ify(sigreturn)
+
+#ifdef __NR_rt_sigreturn
+
+ENTRY(__default_rt_sa_restorer)
+ swi SYS_ify(rt_sigreturn)
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/arm/socket.S b/sysdeps/unix/sysv/linux/arm/socket.S
new file mode 100644
index 0000000000..212a489afe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/socket.S
@@ -0,0 +1,123 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep-cancel.h>
+#include <socketcall.h>
+
+#define P(a, b) P2(a, b)
+#define P2(a, b) a##b
+
+ .text
+/* The socket-oriented system calls are handled unusally in Linux.
+ They are all gated through the single `socketcall' system call number.
+ `socketcall' takes two arguments: the first is the subcode, specifying
+ which socket function is being called; and the second is a pointer to
+ the arguments to the specific function.
+
+ The .S files for the other calls just #define socket and #include this. */
+
+#ifndef __socket
+#define __socket P(__,socket)
+#endif
+
+#define PUSHARGS_1 str a1, [sp, $-4]!
+#define PUSHARGS_2 stmfd sp!, {a1, a2}
+#define PUSHARGS_3 stmfd sp!, {a1, a2, a3}
+#define PUSHARGS_4 stmfd sp!, {a1, a2, a3, a4}
+#define PUSHARGS_5 stmfd sp!, {a1, a2, a3, a4} /* Caller has already pushed arg 5 */
+#define PUSHARGS_6 stmfd sp!, {a1, a2, a3, a4}
+
+#define POPARGS_1 add sp, sp, #4
+#define POPARGS_2 add sp, sp, #8
+#define POPARGS_3 add sp, sp, #12
+#define POPARGS_4 add sp, sp, #16
+#define POPARGS_5 add sp, sp, #16
+#define POPARGS_6 add sp, sp, #16
+
+#ifndef NARGS
+#define NARGS 3 /* If we were called with no wrapper, this is really socket() */
+#endif
+
+#if defined NEED_CANCELLATION && defined CENABLE
+ PSEUDO_PROLOGUE
+#endif
+
+.globl __socket
+ENTRY (__socket)
+ /* This code previously moved sp into ip and stored the args using
+ stmdb ip!, {a1-a4}. It did not modify sp, so the stack never had
+ to be restored after the syscall completed. It saved an
+ instruction and meant no stack cleanup work was required.
+
+ This will not work in the case of a socket call being interrupted
+ by a signal. If the signal handler uses any stack the arguments
+ to socket will be trashed. The results of a restart of any
+ socket call are then unpredictable. */
+
+ /* Push args onto the stack. */
+ P(PUSHARGS_,NARGS)
+
+#if defined NEED_CANCELLATION && defined CENABLE
+#ifdef PIC
+ SINGLE_THREAD_P_PIC(r3)
+#else
+ SINGLE_THREAD_P
+#endif
+ bne 1f
+#endif
+
+ /* Do the system call trap. */
+ mov a1, $P(SOCKOP_,socket)
+ mov a2, sp
+ swi SYS_ify(socketcall)
+
+ /* Pop args off the stack */
+ P(POPARGS_,NARGS)
+
+ /* r0 is < 0 if there was an error. */
+ cmn r0, $124
+ RETINSTR(cc, r14)
+ b PLTJMP(SYSCALL_ERROR)
+
+#if defined NEED_CANCELLATION && defined CENABLE
+1:
+ str lr, [sp, #-4]!
+ CENABLE
+ mov ip, r0
+
+ mov r0, #P(SOCKOP_,socket)
+ add r1, sp, #4
+ swi SYS_ify(socketcall)
+
+ str r0, [sp, #-4]!
+ mov r0, ip
+ CDISABLE
+ ldr r0, [sp], #4
+ ldr lr, [sp], #4
+
+ P(POPARGS_,NARGS)
+
+ /* r0 is < 0 if there was an error. */
+ cmn r0, $124
+ RETINSTR(cc, r14)
+ b PLTJMP(SYSCALL_ERROR)
+#endif
+
+PSEUDO_END (__socket)
+
+weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-vdso.h b/sysdeps/unix/sysv/linux/arm/sys/elf.h
index a7dcb2e5ff..faa7310682 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-vdso.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/elf.h
@@ -1,5 +1,4 @@
-/* ELF symbol resolve functions for VDSO objects.
- Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2001 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
@@ -17,11 +16,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _DL_VDSO_H
-#define _DL_VDSO_H 1
+#ifndef _SYS_ELF_H
+#define _SYS_ELF_H 1
-/* Functions for resolving symbols in the VDSO link map. */
-extern void *_dl_vdso_vsym (const char *name, const char *version)
- internal_function attribute_hidden;
+#warning "This header is obsolete; use <sys/procfs.h> instead."
-#endif /* dl-vdso.h */
+#include <sys/procfs.h>
+
+#endif /* sys/elf.h */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/io.h b/sysdeps/unix/sysv/linux/arm/sys/io.h
new file mode 100644
index 0000000000..68639902c7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sys/io.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IO_H
+
+#define _SYS_IO_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+ port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O
+ permission off for that range. This call requires root privileges. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+ int __turn_on) __THROW;
+
+/* Set the I/O privilege level to LEVEL. If LEVEL is nonzero,
+ permission to access any I/O port is granted. This call requires
+ root privileges. */
+extern int iopl (int __level) __THROW;
+
+/* The functions that actually perform reads and writes. */
+extern unsigned char inb (unsigned long int port) __THROW;
+extern unsigned short int inw (unsigned long int port) __THROW;
+extern unsigned long int inl (unsigned long int port) __THROW;
+
+extern void outb (unsigned char value, unsigned long int port) __THROW;
+extern void outw (unsigned short value, unsigned long int port) __THROW;
+extern void outl (unsigned long value, unsigned long int port) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_IO_H */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/procfs.h b/sysdeps/unix/sysv/linux/arm/sys/procfs.h
new file mode 100644
index 0000000000..3b3736324f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sys/procfs.h
@@ -0,0 +1,123 @@
+/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. It doesn't have anything to do with the /proc file
+ system, even though Linux has one.
+
+ Anyway, the whole purpose of this file is for GDB and GDB only.
+ Don't read too much into it. Don't use it for anything other than
+ GDB unless you know what you are doing. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* Type for a general-purpose register. */
+typedef unsigned long elf_greg_t;
+
+/* And the whole bunch of them. We could have used `struct
+ user_regs' directly in the typedef, but tradition says that
+ the register set is an array, which does have some peculiar
+ semantics, so leave it that way. */
+#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers. */
+typedef struct user_fpregs elf_fpregset_t;
+
+/* Signal info. */
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with Linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ GDB doesn't really use excluded. */
+
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args. */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+ unsigned short int pr_uid;
+ unsigned short int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+/* The rest of this file provides the types for emulation of the
+ Solaris <proc_service.h> interfaces that should be implemented by
+ users of libthread_db. */
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore have only one PID type. */
+typedef __pid_t lwpid_t;
+
+/* Process status and info. In the end we do provide typedefs for them. */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/sys/ucontext.h b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
index 946df0dfd6..6d6c8e3990 100644
--- a/sysdeps/unix/sysv/linux/sh/sh3/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001 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
@@ -16,28 +16,23 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-/* Where is System V/SH ABI? */
+/* System V/ARM ABI compliant context switching support. */
#ifndef _SYS_UCONTEXT_H
#define _SYS_UCONTEXT_H 1
#include <features.h>
#include <signal.h>
-
-/* We need the signal context definitions even if they are not used
- included in <signal.h>. */
-#include <bits/sigcontext.h>
-
+#include <sys/procfs.h>
typedef int greg_t;
/* Number of general registers. */
-#define NFPREG 16
+#define NGREG 16
/* Container for all general registers. */
-typedef greg_t gregset_t[NFPREG];
+typedef elf_gregset_t gregset_t;
-#ifdef __USE_GNU
/* Number of each register is the `gregset_t' array. */
enum
{
@@ -71,22 +66,18 @@ enum
#define R13 R13
R14 = 14,
#define R14 R14
- R15 = 15,
+ R15 = 15
#define R15 R15
};
-#endif
+
+/* Structure to describe FPU registers. */
+typedef elf_fpregset_t fpregset_t;
/* Context to describe whole processor state. */
typedef struct
{
- unsigned int oldmask;
gregset_t gregs;
- unsigned int pc;
- unsigned int pr;
- unsigned int sr;
- unsigned int gbr;
- unsigned int mach;
- unsigned int macl;
+ fpregset_t fpregs;
} mcontext_t;
/* Userlevel context. */
@@ -94,9 +85,10 @@ typedef struct ucontext
{
unsigned long int uc_flags;
struct ucontext *uc_link;
+ __sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
- __sigset_t uc_sigmask;
+ long int uc_filler[5];
} ucontext_t;
#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/user.h b/sysdeps/unix/sysv/linux/arm/sys/user.h
new file mode 100644
index 0000000000..3fae43f83f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sys/user.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H 1
+
+/* The whole purpose of this file is for GDB and GDB only. Don't read
+ too much into it. Don't use it for anything other than GDB unless
+ you know what you are doing. */
+
+struct user_fpregs
+{
+ struct fp_reg
+ {
+ unsigned int sign1:1;
+ unsigned int unused:15;
+ unsigned int sign2:1;
+ unsigned int exponent:14;
+ unsigned int j:1;
+ unsigned int mantissa1:31;
+ unsigned int mantissa0:32;
+ } fpregs[8];
+ unsigned int fpsr:32;
+ unsigned int fpcr:32;
+ unsigned char ftype[8];
+ unsigned int init_flag;
+};
+
+struct user_regs
+{
+ unsigned long int uregs[18];
+};
+
+struct user
+{
+ struct user_regs regs; /* General registers */
+ int u_fpvalid; /* True if math co-processor being used. */
+
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack. */
+
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ struct user_regs *u_ar0; /* help gdb to find the general registers. */
+
+ unsigned long magic; /* uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ int u_debugreg[8];
+ struct user_fpregs u_fp; /* Floating point registers */
+ struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
+};
+
+#endif /* sys/user.h */
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
new file mode 100644
index 0000000000..1db0030b5b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -0,0 +1,5 @@
+# File name Caller Syscall name # args Strong name Weak names
+
+syscall - syscall 7 syscall
+oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
+oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.S b/sysdeps/unix/sysv/linux/arm/sysdep.S
new file mode 100644
index 0000000000..1a4de2adb3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.S
@@ -0,0 +1,34 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+ .text
+
+/* The syscall stubs jump here when they detect an error.
+ The code for Linux is almost identical to the canonical Unix
+ code, except that the error number in R0 is negated. */
+
+#undef CALL_MCOUNT
+#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers R0. */
+
+ENTRY (__syscall_error)
+ rsb r0, r0, $0
+
+#define __syscall_error __syscall_error_1
+#include <sysdeps/unix/arm/sysdep.S>
diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h
new file mode 100644
index 0000000000..668aa1a2f1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -0,0 +1,236 @@
+/* Copyright (C) 1992, 93, 1995-2000, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
+ ARM changes by Philip Blundell, <pjb27@cam.ac.uk>, May 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _LINUX_ARM_SYSDEP_H
+#define _LINUX_ARM_SYSDEP_H 1
+
+/* There is some commonality. */
+#include <sysdeps/unix/arm/sysdep.h>
+
+/* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
+ of the kernel. But these symbols do not follow the SYS_* syntax
+ so we have to redefine the `SYS_ify' macro here. */
+#undef SYS_ify
+#define SWI_BASE (0x900000)
+#define SYS_ify(syscall_name) (__NR_##syscall_name)
+
+
+#ifdef __ASSEMBLER__
+
+/* Linux uses a negative return value to indicate syscall errors,
+ unlike most Unices, which use the condition codes' carry flag.
+
+ Since version 2.1 the return value of a system call might be
+ negative even if the call succeeded. E.g., the `lseek' system call
+ might return a large offset. Therefore we must not anymore test
+ for < 0, but test for a real error by making sure the value in R0
+ is a real error number. Linus said he will make sure the no syscall
+ returns a value in -1 .. -4095 as a valid result so we can savely
+ test with -4095. */
+
+#undef PSEUDO
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args); \
+ cmn r0, $4096;
+
+#define PSEUDO_RET \
+ RETINSTR(cc, lr); \
+ b PLTJMP(SYSCALL_ERROR)
+#undef ret
+#define ret PSEUDO_RET
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) \
+ SYSCALL_ERROR_HANDLER \
+ END (name)
+
+#undef PSEUDO_NOERRNO
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ .text; \
+ ENTRY (name); \
+ DO_CALL (syscall_name, args);
+
+#define PSEUDO_RET_NOERRNO \
+ DO_RET (lr);
+
+#undef ret_NOERRNO
+#define ret_NOERRNO PSEUDO_RET_NOERRNO
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(name) \
+ END (name)
+
+/* The function has to return the error code. */
+#undef PSEUDO_ERRVAL
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ ENTRY (name) \
+ DO_CALL (syscall_name, args); \
+ rsb r0, r0, #0
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(name) \
+ END (name)
+
+#define ret_ERRVAL PSEUDO_RET_NOERRNO
+
+#if NOT_IN_libc
+# define SYSCALL_ERROR __local_syscall_error
+# define SYSCALL_ERROR_HANDLER \
+__local_syscall_error: \
+ str lr, [sp, #-4]!; \
+ str r0, [sp, #-4]!; \
+ bl PLTJMP(C_SYMBOL_NAME(__errno_location)); \
+ ldr r1, [sp], #4; \
+ rsb r1, r1, #0; \
+ str r1, [r0]; \
+ mvn r0, #0; \
+ ldr pc, [sp], #4;
+#else
+# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
+# define SYSCALL_ERROR __syscall_error
+#endif
+
+/* Linux takes system call args in registers:
+ syscall number in the SWI instruction
+ arg 1 r0
+ arg 2 r1
+ arg 3 r2
+ arg 4 r3
+ arg 5 r4 (this is different from the APCS convention)
+ arg 6 r5
+ arg 7 r6
+
+ The compiler is going to form a call by coming here, through PSEUDO, with
+ arguments
+ syscall number in the DO_CALL macro
+ arg 1 r0
+ arg 2 r1
+ arg 3 r2
+ arg 4 r3
+ arg 5 [sp]
+ arg 6 [sp+4]
+ arg 7 [sp+8]
+
+ We need to shuffle values between R4..R6 and the stack so that the
+ caller's v1..v3 and stack frame are not corrupted, and the kernel
+ sees the right arguments.
+
+*/
+
+#undef DO_CALL
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args \
+ swi SYS_ify (syscall_name); \
+ UNDOARGS_##args
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 /* nothing */
+#define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $4];
+#define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmia ip, {r4, r5};
+#define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmia ip, {r4, r5, r6};
+
+#define UNDOARGS_0 /* nothing */
+#define UNDOARGS_1 /* nothing */
+#define UNDOARGS_2 /* nothing */
+#define UNDOARGS_3 /* nothing */
+#define UNDOARGS_4 /* nothing */
+#define UNDOARGS_5 ldr r4, [sp], $4;
+#define UNDOARGS_6 ldmfd sp!, {r4, r5};
+#define UNDOARGS_7 ldmfd sp!, {r4, r5, r6};
+
+#else /* not __ASSEMBLER__ */
+
+/* Define a macro which expands into the inline wrapper code for a system
+ call. */
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...) \
+ ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \
+ _sys_result = (unsigned int) -1; \
+ } \
+ (int) _sys_result; })
+
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ unsigned int _sys_result; \
+ { \
+ register int _a1 asm ("a1"); \
+ LOAD_ARGS_##nr (args) \
+ asm volatile ("swi %1 @ syscall " #name \
+ : "=r" (_a1) \
+ : "i" (SYS_ify(name)) ASM_ARGS_##nr \
+ : "memory"); \
+ _sys_result = _a1; \
+ } \
+ (int) _sys_result; })
+
+#undef INTERNAL_SYSCALL_ERROR_P
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned int) (val) >= 0xfffff001u)
+
+#undef INTERNAL_SYSCALL_ERRNO
+#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
+#define LOAD_ARGS_0()
+#define ASM_ARGS_0
+#define LOAD_ARGS_1(a1) \
+ _a1 = (int) (a1); \
+ LOAD_ARGS_0 ()
+#define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1)
+#define LOAD_ARGS_2(a1, a2) \
+ register int _a2 asm ("a2") = (int) (a2); \
+ LOAD_ARGS_1 (a1)
+#define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2)
+#define LOAD_ARGS_3(a1, a2, a3) \
+ register int _a3 asm ("a3") = (int) (a3); \
+ LOAD_ARGS_2 (a1, a2)
+#define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3)
+#define LOAD_ARGS_4(a1, a2, a3, a4) \
+ register int _a4 asm ("a4") = (int) (a4); \
+ LOAD_ARGS_3 (a1, a2, a3)
+#define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4)
+#define LOAD_ARGS_5(a1, a2, a3, a4, a5) \
+ register int _v1 asm ("v1") = (int) (a5); \
+ LOAD_ARGS_4 (a1, a2, a3, a4)
+#define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1)
+#define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \
+ register int _v2 asm ("v2") = (int) (a6); \
+ LOAD_ARGS_5 (a1, a2, a3, a4, a5)
+#define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2)
+#define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \
+ register int _v3 asm ("v3") = (int) (a7); \
+ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6)
+#define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3)
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* linux/arm/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/arm/versionsort64.c b/sysdeps/unix/sysv/linux/arm/versionsort64.c
new file mode 100644
index 0000000000..144b691e56
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/versionsort64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/versionsort64.c>
diff --git a/sysdeps/unix/sysv/linux/arm/vfork.S b/sysdeps/unix/sysv/linux/arm/vfork.S
new file mode 100644
index 0000000000..9ef5114b24
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -0,0 +1,59 @@
+/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <philb@gnu.org>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+#include <kernel-features.h>
+
+/* Clone the calling process, but without copying the whole address space.
+ The calling process is suspended until the new process exits or is
+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+
+ENTRY (__vfork)
+
+#ifdef __NR_vfork
+ swi __NR_vfork
+ cmn a1, #4096
+ RETINSTR(cc, lr)
+
+# ifdef __ASSUME_VFORK_SYSCALL
+ b PLTJMP(C_SYMBOL_NAME(__syscall_error))
+# else
+ /* Check if vfork syscall is known at all. */
+ cmn a2, #ENOSYS
+ bne PLTJMP(C_SYMBOL_NAME(__syscall_error))
+# endif
+#endif
+
+#ifndef __ASSUME_VFORK_SYSCALL
+ /* If we don't have vfork, fork is close enough. */
+ swi __NR_fork
+ cmn a1, #4096
+ RETINSTR(cc, lr)
+ b PLTJMP(C_SYMBOL_NAME(__syscall_error))
+#elif !defined __NR_vfork
+# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
+#endif
+
+PSEUDO_END (__vfork)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)
diff --git a/sysdeps/unix/sysv/linux/arm/xstat.c b/sysdeps/unix/sysv/linux/arm/xstat.c
new file mode 100644
index 0000000000..e9869f5508
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/xstat.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/xstat.c>
diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h
index 4de8cbba57..724dabaf10 100644
--- a/sysdeps/unix/sysv/linux/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/bits/errno.h
@@ -1,5 +1,5 @@
/* Error constants. Linux specific version.
- Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 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
@@ -27,17 +27,12 @@
/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP
-/* Older Linux versions also had no ECANCELED error code. */
+/* Linux also had no ECANCELED error code. Since it is not used here
+ we define it to an invalid value. */
# ifndef ECANCELED
# define ECANCELED 125
# endif
-/* Support for error codes to support robust mutexes was added later, too. */
-# ifndef EOWNERDEAD
-# define EOWNERDEAD 130
-# define ENOTRECOVERABLE 131
-# endif
-
# ifndef __ASSEMBLER__
/* Function to get address of global `errno' variable. */
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
diff --git a/sysdeps/unix/sysv/linux/bits/in.h b/sysdeps/unix/sysv/linux/bits/in.h
index 6880a2e636..9d587897ad 100644
--- a/sysdeps/unix/sysv/linux/bits/in.h
+++ b/sysdeps/unix/sysv/linux/bits/in.h
@@ -105,13 +105,13 @@ struct in_pktinfo
The first word in the comment at the right is the data type used;
"bool" means a boolean value stored in an `int'. */
#define IPV6_ADDRFORM 1
-#define IPV6_2292PKTINFO 2
-#define IPV6_2292HOPOPTS 3
-#define IPV6_2292DSTOPTS 4
-#define IPV6_2292RTHDR 5
-#define IPV6_2292PKTOPTIONS 6
+#define IPV6_PKTINFO 2
+#define IPV6_HOPOPTS 3
+#define IPV6_DSTOPTS 4
+#define IPV6_RTHDR 5
+#define IPV6_PKTOPTIONS 6
#define IPV6_CHECKSUM 7
-#define IPV6_2292HOPLIMIT 8
+#define IPV6_HOPLIMIT 8
#define SCM_SRCRT IPV6_RXSRCRT
@@ -133,21 +133,6 @@ struct in_pktinfo
#define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35
-#define IPV6_RECVPKTINFO 49
-#define IPV6_PKTINFO 50
-#define IPV6_RECVHOPLIMIT 51
-#define IPV6_HOPLIMIT 52
-#define IPV6_RECVHOPOPTS 53
-#define IPV6_HOPOPTS 54
-#define IPV6_RTHDRDSTOPTS 55
-#define IPV6_RECVRTHDR 56
-#define IPV6_RTHDR 57
-#define IPV6_RECVDSTOPTS 58
-#define IPV6_DSTOPTS 59
-
-#define IPV6_RECVTCLASS 66
-#define IPV6_TCLASS 67
-
/* Obsolete synonyms for the above. */
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
diff --git a/sysdeps/unix/sysv/linux/bits/poll.h b/sysdeps/unix/sysv/linux/bits/poll.h
index d7996b46c5..dccb8b6665 100644
--- a/sysdeps/unix/sysv/linux/bits/poll.h
+++ b/sysdeps/unix/sysv/linux/bits/poll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001 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
@@ -36,10 +36,8 @@
#endif
#ifdef __USE_GNU
-/* These are extensions for Linux. */
+/* This is an extension for Linux. */
# define POLLMSG 0x400
-# define POLLREMOVE 0x1000
-# define POLLRDHUP 0x2000
#endif
/* Event types always implicitly polled for. These bits need not be set in
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 526cdaf53c..c186a3a5d0 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+ Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -89,18 +89,7 @@ enum __rlimit_resource
__RLIMIT_MSGQUEUE = 12,
#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
- /* Maximum nice priority allowed to raise to.
- Nice levels 19 .. -20 correspond to 0 .. 39
- values of this resource limit. */
- __RLIMIT_NICE = 13,
-#define RLIMIT_NICE __RLIMIT_NICE
-
- /* Maximum realtime priority allowed for non-priviledged
- processes. */
- __RLIMIT_RTPRIO = 14,
-#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
-
- __RLIMIT_NLIMITS = 15,
+ __RLIMIT_NLIMITS = 13,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
#define RLIM_NLIMITS __RLIM_NLIMITS
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 4a95a263f7..24495e2b34 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
- Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-1999,2001,2002,2003 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
@@ -29,9 +29,6 @@
#define SCHED_OTHER 0
#define SCHED_FIFO 1
#define SCHED_RR 2
-#ifdef __USE_GNU
-# define SCHED_BATCH 3
-#endif
#ifdef __USE_MISC
/* Cloning flags. */
@@ -69,13 +66,10 @@ struct sched_param
__BEGIN_DECLS
-#ifdef __USE_MISC
/* Clone current process. */
+#ifdef __USE_MISC
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
- int __flags, void *__arg, ...) __THROW;
-
-/* Unshare the specified resources. */
-extern int unshare (int __flags) __THROW;
+ int __flags, void *__arg) __THROW;
#endif
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h
index 318d601aed..225b89db2d 100644
--- a/sysdeps/unix/sysv/linux/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/bits/shm.h
@@ -73,7 +73,6 @@ struct shmid_ds
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
# define SHM_LOCKED 02000 /* segment will not be swapped */
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
-# define SHM_NORESERVE 010000 /* don't check for reservations */
struct shminfo
{
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 356a2ece74..77e9b83c92 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -1,5 +1,5 @@
/* System-specific socket constants and types. Linux version.
- Copyright (C) 1991,1992,1994-2001,2004,2006 Free Software Foundation, Inc.
+ Copyright (C) 1991,1992,1994-2001, 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
@@ -221,10 +221,7 @@ struct msghdr
size_t msg_iovlen; /* Number of elements in the vector. */
void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
- size_t msg_controllen; /* Ancillary data buffer length.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
+ size_t msg_controllen; /* Ancillary data buffer length. */
int msg_flags; /* Flags on received message. */
};
@@ -233,10 +230,7 @@ struct msghdr
struct cmsghdr
{
size_t cmsg_len; /* Length of data in cmsg_data plus length
- of cmsghdr structure.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
+ of cmsghdr structure. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h
index c71e4ad1fe..1b71f60faf 100644
--- a/sysdeps/unix/sysv/linux/bits/termios.h
+++ b/sysdeps/unix/sysv/linux/bits/termios.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005
+ Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2003
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -172,7 +172,6 @@ struct termios
#define __MAX_BAUD B4000000
#ifdef __USE_MISC
# define CIBAUD 002003600000 /* input baud rate (not used) */
-# define CMSPAR 010000000000 /* mark or space (stick) parity */
# define CRTSCTS 020000000000 /* flow control */
#endif
diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h
index 6a283ed771..84b4805fe8 100644
--- a/sysdeps/unix/sysv/linux/bits/uio.h
+++ b/sysdeps/unix/sysv/linux/bits/uio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2006 Free Software Foundation, Inc.
+/* 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
@@ -16,12 +16,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#if !defined _SYS_UIO_H && !defined _FCNTL_H
+#ifndef _SYS_UIO_H
# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
#endif
-#ifndef _BITS_UIO_H
-#define _BITS_UIO_H 1
#include <sys/types.h>
@@ -33,7 +31,7 @@
/* Size of object which can be written atomically.
This macro has different values in different kernel versions. The
- latest versions of the kernel use 1024 and this is good choice. Since
+ latest versions of ther kernel use 1024 and this is good choice. Since
the C library implementation of readv/writev is able to emulate the
functionality even if the currently running kernel does not support
this large value the readv/writev call will not fail because of this. */
@@ -46,5 +44,3 @@ struct iovec
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
};
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h
index 464cedb1fc..e3f80f6814 100644
--- a/sysdeps/unix/sysv/linux/bits/waitflags.h
+++ b/sysdeps/unix/sysv/linux/bits/waitflags.h
@@ -1,5 +1,5 @@
/* Definitions of flag bits for `waitpid' et al.
- Copyright (C) 1992,1996,1997,2000,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1996, 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
@@ -32,7 +32,5 @@
#define WCONTINUED 8 /* Report continued child. */
#define WNOWAIT 0x01000000 /* Don't reap, just poll status. */
-#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads
- in this group */
#define __WALL 0x40000000 /* Wait for any child. */
#define __WCLONE 0x80000000 /* Wait for cloned process. */
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index 46161a806a..69924769bc 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003 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
@@ -17,11 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <assert.h>
#include <errno.h>
#include <ifaddrs.h>
#include <netdb.h>
-#include <stddef.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
@@ -31,30 +29,16 @@
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
-#include <not-cancel.h>
-#include <kernel-features.h>
-
-
-#ifndef IFA_F_TEMPORARY
-# define IFA_F_TEMPORARY IFA_F_SECONDARY
-#endif
-#ifndef IFA_F_HOMEADDRESS
-# define IFA_F_HOMEADDRESS 0
-#endif
+#include "kernel-features.h"
static int
-make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
- struct in6addrinfo **in6ai, size_t *in6ailen)
+make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6)
{
- struct req
+ struct
{
struct nlmsghdr nlh;
struct rtgenmsg g;
- /* struct rtgenmsg consists of a single byte. This means there
- are three bytes of padding included in the REQ definition.
- We make them explicit here. */
- char pad[3];
} req;
struct sockaddr_nl nladdr;
@@ -65,50 +49,20 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
req.nlh.nlmsg_seq = time (NULL);
req.g.rtgen_family = AF_UNSPEC;
- assert (sizeof (req) - offsetof (struct req, pad) == 3);
- memset (req.pad, '\0', sizeof (req.pad));
-
memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
-#ifdef PAGE_SIZE
- /* Help the compiler optimize out the malloc call if PAGE_SIZE
- is constant and smaller or equal to PTHREAD_STACK_MIN/4. */
- const size_t buf_size = PAGE_SIZE;
-#else
- const size_t buf_size = __getpagesize ();
-#endif
- bool use_malloc = false;
- char *buf;
-
- if (__libc_use_alloca (buf_size))
- buf = alloca (buf_size);
- else
- {
- buf = malloc (buf_size);
- if (buf != NULL)
- use_malloc = true;
- else
- goto out_fail;
- }
-
- struct iovec iov = { buf, buf_size };
-
if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
(struct sockaddr *) &nladdr,
sizeof (nladdr))) < 0)
- goto out_fail;
+ return -1;
*seen_ipv4 = false;
*seen_ipv6 = false;
bool done = false;
- struct in6ailist
- {
- struct in6addrinfo info;
- struct in6ailist *next;
- } *in6ailist = NULL;
- size_t in6ailistlen = 0;
+ char buf[4096];
+ struct iovec iov = { buf, sizeof (buf) };
do
{
@@ -122,10 +76,10 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
if (read_len < 0)
- goto out_fail;
+ return -1;
if (msg.msg_flags & MSG_TRUNC)
- goto out_fail;
+ return -1;
struct nlmsghdr *nlmh;
for (nlmh = (struct nlmsghdr *) buf;
@@ -147,47 +101,6 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
break;
case AF_INET6:
*seen_ipv6 = true;
-
- if (ifam->ifa_flags & (IFA_F_DEPRECATED
- | IFA_F_TEMPORARY
- | IFA_F_HOMEADDRESS))
- {
- struct rtattr *rta = IFA_RTA (ifam);
- size_t len = (nlmh->nlmsg_len
- - NLMSG_LENGTH (sizeof (*ifam)));
- void *local = NULL;
- void *address = NULL;
- while (RTA_OK (rta, len))
- {
- switch (rta->rta_type)
- {
- case IFA_LOCAL:
- local = RTA_DATA (rta);
- break;
-
- case IFA_ADDRESS:
- address = RTA_DATA (rta);
- break;
- }
-
- rta = RTA_NEXT (rta, len);
- }
-
- struct in6ailist *newp = alloca (sizeof (*newp));
- newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
- ? in6ai_deprecated : 0)
- | ((ifam->ifa_flags
- & IFA_F_TEMPORARY)
- ? in6ai_temporary : 0)
- | ((ifam->ifa_flags
- & IFA_F_HOMEADDRESS)
- ? in6ai_homeaddress : 0));
- memcpy (newp->info.addr, address ?: local,
- sizeof (newp->info.addr));
- newp->next = in6ailist;
- in6ailist = newp;
- ++in6ailistlen;
- }
break;
default:
/* Ignore. */
@@ -197,36 +110,14 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
else if (nlmh->nlmsg_type == NLMSG_DONE)
/* We found the end, leave the loop. */
done = true;
+ else ;
}
}
while (! done);
- close_not_cancel_no_status (fd);
-
- if (in6ailist != NULL)
- {
- *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
- if (*in6ai == NULL)
- goto out_fail;
-
- *in6ailen = in6ailistlen;
+ __close (fd);
- do
- {
- (*in6ai)[--in6ailistlen] = in6ailist->info;
- in6ailist = in6ailist->next;
- }
- while (in6ailist != NULL);
- }
-
- if (use_malloc)
- free (buf);
return 0;
-
-out_fail:
- if (use_malloc)
- free (buf);
- return -1;
}
@@ -242,12 +133,8 @@ extern int __no_netlink_support attribute_hidden;
void
attribute_hidden
-__check_pf (bool *seen_ipv4, bool *seen_ipv6,
- struct in6addrinfo **in6ai, size_t *in6ailen)
+__check_pf (bool *seen_ipv4, bool *seen_ipv6)
{
- *in6ai = NULL;
- *in6ailen = 0;
-
if (! __no_netlink_support)
{
int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
@@ -261,8 +148,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
if (fd >= 0
&& __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
&& __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
- && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6,
- in6ai, in6ailen) == 0)
+ && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6) == 0)
/* It worked. */
return;
@@ -292,6 +178,9 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
return;
}
+ *seen_ipv4 = false;
+ *seen_ipv6 = false;
+
struct ifaddrs *runp;
for (runp = ifa; runp != NULL; runp = runp->ifa_next)
if (runp->ifa_addr->sa_family == PF_INET)
diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
deleted file mode 100644
index 04bf49e45f..0000000000
--- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* clock_getcpuclockid -- Get a clockid_t for process CPU time. Linux version.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <time.h>
-#include <unistd.h>
-#include <kernel-features.h>
-#include "kernel-posix-cpu-timers.h"
-
-#ifndef HAS_CPUCLOCK
-# define HAS_CPUCLOCK 1
-#endif
-
-int
-clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
-{
-#ifdef __NR_clock_getres
- /* The clockid_t value is a simple computation from the PID.
- But we do a clock_getres call to validate it. */
-
- const clockid_t pidclock = MAKE_PROCESS_CPUCLOCK (pid, CPUCLOCK_SCHED);
-
-# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
- extern int __libc_missing_posix_cpu_timers attribute_hidden;
-# if !(__ASSUME_POSIX_TIMERS > 0)
- extern int __libc_missing_posix_timers attribute_hidden;
- if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
- __libc_missing_posix_cpu_timers = 1;
-# endif
- if (!__libc_missing_posix_cpu_timers)
-# endif
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_SYSCALL (clock_getres, err, 2, pidclock, NULL);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- {
- *clock_id = pidclock;
- return 0;
- }
-
-# if !(__ASSUME_POSIX_TIMERS > 0)
- if (INTERNAL_SYSCALL_ERRNO (r, err) == ENOSYS)
- {
- /* The kernel doesn't support these calls at all. */
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- }
- else
-# endif
- if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL)
- {
-# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
- if (pidclock == MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED)
- || INTERNAL_SYSCALL_ERROR_P (INTERNAL_SYSCALL
- (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK
- (0, CPUCLOCK_SCHED), NULL),
- err))
- /* The kernel doesn't support these clocks at all. */
- __libc_missing_posix_cpu_timers = 1;
- else
-# endif
- /* The clock_getres system call checked the PID for us. */
- return ESRCH;
- }
- else
- return INTERNAL_SYSCALL_ERRNO (r, err);
- }
-#endif
-
- /* We don't allow any process ID but our own. */
- if (pid != 0 && pid != getpid ())
- return EPERM;
-
-#ifdef CLOCK_PROCESS_CPUTIME_ID
- if (HAS_CPUCLOCK)
- {
- /* Store the number. */
- *clock_id = CLOCK_PROCESS_CPUTIME_ID;
-
- return 0;
- }
-#endif
-
- /* We don't have a timer for that. */
- return ENOENT;
-}
diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
index 813d3ebbf9..442fbd5705 100644
--- a/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
@@ -1,5 +1,4 @@
-/* clock_getres -- Get the resolution of a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003 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
@@ -18,176 +17,60 @@
02111-1307 USA. */
#include <sysdep.h>
-#include <errno.h>
-#include <time.h>
-#include "kernel-posix-cpu-timers.h"
-#include <kernel-features.h>
-#ifndef HAVE_CLOCK_GETRES_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
+#include "kernel-features.h"
-#define SYSCALL_GETRES \
- retval = INLINE_VSYSCALL (clock_getres, 2, clock_id, res); \
- break
#ifdef __ASSUME_POSIX_TIMERS
-
/* This means the REALTIME and MONOTONIC clock are definitely
supported in the kernel. */
-# define SYSDEP_GETRES \
- SYSDEP_GETRES_CPUTIME \
+# define SYSDEP_GETRES \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- SYSCALL_GETRES
-
-# define __libc_missing_posix_timers 0
+ retval = INLINE_SYSCALL (clock_getres, 2, clock_id, res); \
+ break
#elif defined __NR_clock_getres
/* Is the syscall known to exist? */
extern int __libc_missing_posix_timers attribute_hidden;
-static inline int
-maybe_syscall_getres (clockid_t clock_id, struct timespec *res)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_getres, err, 2, clock_id, res);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- e = EINVAL;
- }
- }
-
- return e;
-}
-
/* The REALTIME and MONOTONIC clock might be available. Try the
syscall first. */
-# define SYSDEP_GETRES \
- SYSDEP_GETRES_CPUTIME \
+# define SYSDEP_GETRES \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- retval = maybe_syscall_getres (clock_id, res); \
- if (retval == 0) \
- break; \
- /* Fallback code. */ \
- if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
- retval = realtime_getres (res); \
- else \
- { \
- __set_errno (retval); \
- retval = -1; \
- } \
- break;
+ { \
+ int e = EINVAL; \
+ \
+ if (!__libc_missing_posix_timers) \
+ { \
+ INTERNAL_SYSCALL_DECL (err); \
+ int r = INTERNAL_SYSCALL (clock_getres, err, 2, clock_id, res); \
+ if (!INTERNAL_SYSCALL_ERROR_P (r, err)) \
+ { \
+ retval = 0; \
+ break; \
+ } \
+ \
+ e = INTERNAL_SYSCALL_ERRNO (r, err); \
+ if (e == ENOSYS) \
+ { \
+ __libc_missing_posix_timers = 1; \
+ e = EINVAL; \
+ } \
+ } \
+ \
+ /* Fallback code. */ \
+ if (e == EINVAL && clock_id == CLOCK_REALTIME) \
+ HANDLE_REALTIME; \
+ else \
+ __set_errno (e); \
+ } \
+ break
#endif
#ifdef __NR_clock_getres
/* We handled the REALTIME clock here. */
# define HANDLED_REALTIME 1
-# define HANDLED_CPUTIME 1
-
-# if __ASSUME_POSIX_CPU_TIMERS > 0
-
-# define SYSDEP_GETRES_CPU SYSCALL_GETRES
-# define SYSDEP_GETRES_CPUTIME /* Default catches them too. */
-
-# else
-
-extern int __libc_missing_posix_cpu_timers attribute_hidden;
-
-static int
-maybe_syscall_getres_cpu (clockid_t clock_id, struct timespec *res)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_cpu_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_getres, err, 2, clock_id, res);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
- {
- if (e == EINVAL)
- {
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
- }
- }
-
- return e;
-}
-
-# define SYSDEP_GETRES_CPU \
- retval = maybe_syscall_getres_cpu (clock_id, res); \
- if (retval == 0) \
- break; \
- if (retval != EINVAL || !__libc_missing_posix_cpu_timers) \
- { \
- __set_errno (retval); \
- retval = -1; \
- break; \
- } \
- retval = -1 /* Otherwise continue on to the HP_TIMING version. */;
-
-static inline int
-maybe_syscall_getres_cputime (clockid_t clock_id, struct timespec *res)
-{
- return maybe_syscall_getres_cpu
- (clock_id == CLOCK_THREAD_CPUTIME_ID
- ? MAKE_THREAD_CPUCLOCK (0, CPUCLOCK_SCHED)
- : MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- res);
-}
-
-# define SYSDEP_GETRES_CPUTIME \
- case CLOCK_PROCESS_CPUTIME_ID: \
- case CLOCK_THREAD_CPUTIME_ID: \
- retval = maybe_syscall_getres_cputime (clock_id, res); \
- if (retval == 0) \
- break; \
- if (retval != EINVAL || !__libc_missing_posix_cpu_timers) \
- { \
- __set_errno (retval); \
- retval = -1; \
- break; \
- } \
- retval = hp_timing_getres (res); \
- break;
-# if !HP_TIMING_AVAIL
-# define hp_timing_getres(res) (__set_errno (EINVAL), -1)
-# endif
-
-# endif
#endif
#include <sysdeps/posix/clock_getres.c>
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index 5afe20feb5..522fac32a7 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,4 @@
-/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003 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
@@ -18,176 +17,60 @@
02111-1307 USA. */
#include <sysdep.h>
-#include <errno.h>
-#include <time.h>
-#include "kernel-posix-cpu-timers.h"
-#include <kernel-features.h>
-#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
+#include "kernel-features.h"
-#define SYSCALL_GETTIME \
- retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \
- break
#ifdef __ASSUME_POSIX_TIMERS
-
/* This means the REALTIME and MONOTONIC clock are definitely
supported in the kernel. */
-# define SYSDEP_GETTIME \
- SYSDEP_GETTIME_CPUTIME \
+# define SYSDEP_GETTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- SYSCALL_GETTIME
-
-# define __libc_missing_posix_timers 0
+ retval = INLINE_SYSCALL (clock_gettime, 2, clock_id, tp); \
+ break
#elif defined __NR_clock_gettime
/* Is the syscall known to exist? */
int __libc_missing_posix_timers attribute_hidden;
-static inline int
-maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- e = EINVAL;
- }
- }
-
- return e;
-}
-
/* The REALTIME and MONOTONIC clock might be available. Try the
syscall first. */
-# define SYSDEP_GETTIME \
- SYSDEP_GETTIME_CPUTIME \
+# define SYSDEP_GETTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- retval = maybe_syscall_gettime (clock_id, tp); \
- if (retval == 0) \
- break; \
- /* Fallback code. */ \
- if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
- retval = realtime_gettime (tp); \
- else \
- { \
- __set_errno (retval); \
- retval = -1; \
- } \
- break;
+ { \
+ int e = EINVAL; \
+ \
+ if (!__libc_missing_posix_timers) \
+ { \
+ INTERNAL_SYSCALL_DECL (err); \
+ int r = INTERNAL_SYSCALL (clock_gettime, err, 2, clock_id, tp); \
+ if (!INTERNAL_SYSCALL_ERROR_P (r, err)) \
+ { \
+ retval = 0; \
+ break; \
+ } \
+ \
+ e = INTERNAL_SYSCALL_ERRNO (r, err); \
+ if (e == ENOSYS) \
+ { \
+ __libc_missing_posix_timers = 1; \
+ e = EINVAL; \
+ } \
+ } \
+ \
+ /* Fallback code. */ \
+ if (e == EINVAL && clock_id == CLOCK_REALTIME) \
+ HANDLE_REALTIME; \
+ else \
+ __set_errno (e); \
+ } \
+ break
#endif
#ifdef __NR_clock_gettime
/* We handled the REALTIME clock here. */
# define HANDLED_REALTIME 1
-# define HANDLED_CPUTIME 1
-
-# if __ASSUME_POSIX_CPU_TIMERS > 0
-
-# define SYSDEP_GETTIME_CPU SYSCALL_GETTIME
-# define SYSDEP_GETTIME_CPUTIME /* Default catches them too. */
-
-# else
-
-int __libc_missing_posix_cpu_timers attribute_hidden;
-
-static int
-maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_cpu_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
- {
- if (e == EINVAL)
- {
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
- }
- }
-
- return e;
-}
-
-# define SYSDEP_GETTIME_CPU \
- retval = maybe_syscall_gettime_cpu (clock_id, tp); \
- if (retval == 0) \
- break; \
- if (retval != EINVAL || !__libc_missing_posix_cpu_timers) \
- { \
- __set_errno (retval); \
- retval = -1; \
- break; \
- } \
- retval = -1 /* Otherwise continue on to the HP_TIMING version. */;
-
-static inline int
-maybe_syscall_gettime_cputime (clockid_t clock_id, struct timespec *tp)
-{
- return maybe_syscall_gettime_cpu
- (clock_id == CLOCK_THREAD_CPUTIME_ID
- ? MAKE_THREAD_CPUCLOCK (0, CPUCLOCK_SCHED)
- : MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- tp);
-}
-
-# define SYSDEP_GETTIME_CPUTIME \
- case CLOCK_PROCESS_CPUTIME_ID: \
- case CLOCK_THREAD_CPUTIME_ID: \
- retval = maybe_syscall_gettime_cputime (clock_id, tp); \
- if (retval == 0) \
- break; \
- if (retval != EINVAL || !__libc_missing_posix_cpu_timers) \
- { \
- __set_errno (retval); \
- retval = -1; \
- break; \
- } \
- retval = hp_timing_gettime (clock_id, tp); \
- break;
-# if !HP_TIMING_AVAIL
-# define hp_timing_gettime(clock_id, tp) (__set_errno (EINVAL), -1)
-# endif
-
-# endif
#endif
#include <sysdeps/unix/clock_gettime.c>
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
index 7645262cee..2a3dd411a1 100644
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003 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
@@ -17,11 +17,9 @@
02111-1307 USA. */
#include <time.h>
-#include <errno.h>
#include <sysdep-cancel.h>
-#include <kernel-features.h>
-#include "kernel-posix-cpu-timers.h"
+#include "kernel-features.h"
#ifdef __ASSUME_POSIX_TIMERS
@@ -34,11 +32,6 @@ clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
INTERNAL_SYSCALL_DECL (err);
int r;
- if (clock_id == CLOCK_THREAD_CPUTIME_ID)
- return EINVAL;
- if (clock_id == CLOCK_PROCESS_CPUTIME_ID)
- clock_id = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED);
-
if (SINGLE_THREAD_P)
r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req, rem);
else
@@ -65,20 +58,12 @@ extern int __libc_missing_posix_timers attribute_hidden;
# define SYSDEP_NANOSLEEP \
if (!__libc_missing_posix_timers) \
{ \
- clockid_t syscall_clockid; \
INTERNAL_SYSCALL_DECL (err); \
\
- if (clock_id == CLOCK_THREAD_CPUTIME_ID) \
- return EINVAL; \
- if (clock_id == CLOCK_PROCESS_CPUTIME_ID) \
- syscall_clockid = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED); \
- else \
- syscall_clockid = clock_id; \
- \
int oldstate = LIBC_CANCEL_ASYNC (); \
\
- int r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, \
- syscall_clockid, flags, req, rem); \
+ int r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, \
+ req, rem); \
\
LIBC_CANCEL_RESET (oldstate); \
\
diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c
index 217ae3f29b..5d19a09bf8 100644
--- a/sysdeps/unix/sysv/linux/clock_settime.c
+++ b/sysdeps/unix/sysv/linux/clock_settime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 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
@@ -16,64 +16,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <errno.h>
#include <sysdep.h>
-#include "kernel-posix-cpu-timers.h"
-#include <kernel-features.h>
-
-#ifndef HAVE_CLOCK_GETRES_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
-
-#if __ASSUME_POSIX_CPU_TIMERS <= 0 && defined __NR_clock_settime
-extern int __libc_missing_posix_timers attribute_hidden;
-extern int __libc_missing_posix_cpu_timers attribute_hidden;
-
-static int
-maybe_syscall_settime_cpu (clockid_t clock_id, const struct timespec *tp)
-{
- int e = EINVAL;
-
- if (!__libc_missing_posix_cpu_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_SYSCALL (clock_settime, err, 2, clock_id, tp);
- if (!INTERNAL_SYSCALL_ERROR_P (r, err))
- return 0;
-
- e = INTERNAL_SYSCALL_ERRNO (r, err);
-# ifndef __ASSUME_POSIX_TIMERS
- if (e == ENOSYS)
- {
- __libc_missing_posix_timers = 1;
- __libc_missing_posix_cpu_timers = 1;
- e = EINVAL;
- }
- else
-# endif
- {
- if (e == EINVAL)
- {
- /* Check whether the kernel supports CPU clocks at all.
- If not, record it for the future. */
- r = INTERNAL_VSYSCALL (clock_getres, err, 2,
- MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
- NULL);
- if (INTERNAL_SYSCALL_ERROR_P (r, err))
- __libc_missing_posix_cpu_timers = 1;
- }
- }
- }
-
- return e;
-}
-#endif
+#include "kernel-features.h"
#ifdef __ASSUME_POSIX_TIMERS
@@ -128,22 +73,4 @@ extern int __libc_missing_posix_timers attribute_hidden;
# define HANDLED_REALTIME 1
#endif
-#if __ASSUME_POSIX_CPU_TIMERS > 0
-# define HANDLED_CPUTIME 1
-# define SYSDEP_SETTIME_CPU \
- retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp)
-#elif defined __NR_clock_settime
-# define SYSDEP_SETTIME_CPU \
- retval = maybe_syscall_settime_cpu (clock_id, tp); \
- if (retval == 0) \
- break; \
- if (retval != EINVAL || !__libc_missing_posix_cpu_timers) \
- { \
- __set_errno (retval); \
- retval = -1; \
- break; \
- } \
- do { } while (0)
-#endif
-
#include <sysdeps/unix/clock_settime.c>
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index a8a9cc4702..d059143396 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -115,6 +115,10 @@ case "$machine" in
arch_minimum_kernel=2.0.10
libc_cv_gcc_unwind_find_fde=yes
;;
+ mips*)
+ arch_minimum_kernel=2.4.0
+ libc_cv_gcc_unwind_find_fde=yes
+ ;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -134,10 +138,6 @@ case "$machine" in
arch_minimum_kernel=2.3.99
libc_cv_gcc_unwind_find_fde=yes
;;
- sparc/sparc64*)
- libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
- ;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -224,12 +224,10 @@ fi
# in /lib and /etc.
case "$prefix" in
/usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
- # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
- # and libc_cv_localedir.
- test -n "$libc_cv_slibdir" || \
+ # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+ sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
+ mips/mips64/n64/* )
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
@@ -237,6 +235,14 @@ case "$prefix" in
libc_cv_localedir='${exec_prefix}/lib/locale'
fi
;;
+ mips/mips64/n32/* )
+ libc_cv_slibdir="/lib32"
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib32';
+ # Locale data can be shared between 32bit and 64bit libraries
+ libc_cv_localedir='${exec_prefix}/lib/locale'
+ fi
+ ;;
*)
libc_cv_slibdir="/lib"
;;
@@ -251,29 +257,38 @@ case "$prefix" in
;;
esac
-# Under Linux the NPTL add-on should be available.
+# Under Linux the LinuxThreads or NPTL add-on should be available.
case $add_ons in
+ # Only one of the add-ons should be available.
+ *linuxthreads*nptl*|*nptl*linuxthreads*)
+ echo "\
+*** LinuxThreads and NPTL add-ons are both available. Only one must be used."
+ exit 1
+ ;;
# It is available. Good.
+ *linuxthreads*)
+ linuxthreads_missing=
+ ;;
*nptl*)
- nptl_missing=
+ linuxthreads_missing=
;;
*)
- nptl_missing=yes
+ linuxthreads_missing=yes
;;
esac
-if test "$nptl_missing"; then
+if test "$linuxthreads_missing"; then
if test $enable_sanity = yes; then
echo "\
*** On GNU/Linux systems it is normal to compile GNU libc with the
-*** \`nptl' add-on. Without that, the library will be
+*** \`linuxthreads' add-on. Without that, the library will be
*** incompatible with normal GNU/Linux systems.
*** If you really mean to not use this add-on, run configure again
*** using the extra parameter \`--disable-sanity-checks'."
exit 1
else
echo "\
-*** WARNING: Are you sure you do not want to use the \`nptl'
+*** WARNING: Are you sure you do not want to use the \`linuxthreads'
*** add-on?"
fi
fi
@@ -307,6 +322,9 @@ case "$machine" in
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
+ mips/*64*)
+ ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
+ ;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 43681f3251..e3fccb4c9b 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -75,6 +75,10 @@ case "$machine" in
arch_minimum_kernel=2.0.10
libc_cv_gcc_unwind_find_fde=yes
;;
+ mips*)
+ arch_minimum_kernel=2.4.0
+ libc_cv_gcc_unwind_find_fde=yes
+ ;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -94,10 +98,6 @@ case "$machine" in
arch_minimum_kernel=2.3.99
libc_cv_gcc_unwind_find_fde=yes
;;
- sparc/sparc64*)
- libc_cv_gcc_unwind_find_fde=yes
- arch_minimum_kernel=2.4.21
- ;;
sparc*)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -159,12 +159,10 @@ fi
# in /lib and /etc.
case "$prefix" in
/usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
- # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
- # and libc_cv_localedir.
- test -n "$libc_cv_slibdir" || \
+ # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
+ sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
+ mips/mips64/n64/* )
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
@@ -172,6 +170,14 @@ case "$prefix" in
libc_cv_localedir='${exec_prefix}/lib/locale'
fi
;;
+ mips/mips64/n32/* )
+ libc_cv_slibdir="/lib32"
+ if test "$libdir" = '${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/lib32';
+ # Locale data can be shared between 32bit and 64bit libraries
+ libc_cv_localedir='${exec_prefix}/lib/locale'
+ fi
+ ;;
*)
libc_cv_slibdir="/lib"
;;
@@ -186,29 +192,38 @@ case "$prefix" in
;;
esac
-# Under Linux the NPTL add-on should be available.
+# Under Linux the LinuxThreads or NPTL add-on should be available.
case $add_ons in
+ # Only one of the add-ons should be available.
+ *linuxthreads*nptl*|*nptl*linuxthreads*)
+ echo "\
+*** LinuxThreads and NPTL add-ons are both available. Only one must be used."
+ exit 1
+ ;;
# It is available. Good.
+ *linuxthreads*)
+ linuxthreads_missing=
+ ;;
*nptl*)
- nptl_missing=
+ linuxthreads_missing=
;;
*)
- nptl_missing=yes
+ linuxthreads_missing=yes
;;
esac
-if test "$nptl_missing"; then
+if test "$linuxthreads_missing"; then
if test $enable_sanity = yes; then
echo "\
*** On GNU/Linux systems it is normal to compile GNU libc with the
-*** \`nptl' add-on. Without that, the library will be
+*** \`linuxthreads' add-on. Without that, the library will be
*** incompatible with normal GNU/Linux systems.
*** If you really mean to not use this add-on, run configure again
*** using the extra parameter \`--disable-sanity-checks'."
exit 1
else
echo "\
-*** WARNING: Are you sure you do not want to use the \`nptl'
+*** WARNING: Are you sure you do not want to use the \`linuxthreads'
*** add-on?"
fi
fi
@@ -242,6 +257,9 @@ case "$machine" in
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
+ mips/*64*)
+ ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
+ ;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
diff --git a/sysdeps/unix/sysv/linux/device-nrs.h b/sysdeps/unix/sysv/linux/device-nrs.h
index b30c1dbede..6b6578ec5f 100644
--- a/sysdeps/unix/sysv/linux/device-nrs.h
+++ b/sysdeps/unix/sysv/linux/device-nrs.h
@@ -1,5 +1,5 @@
/* Device numbers of devices used in the implementation. Linux version.
- Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 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
@@ -26,10 +26,6 @@
#define DEV_NULL_MAJOR 1
#define DEV_NULL_MINOR 3
-/* /dev/full is (1,7). */
-#define DEV_FULL_MAJOR 1
-#define DEV_FULL_MINOR 7
-
/* Pseudo tty slaves. For Linux we use the Unix98 ttys. We could
also include the old BSD-style tty buts they should not be used and
the extra test would only slow down correctly set up systems. If a
diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c
index fcac5ae240..6ef9679045 100644
--- a/sysdeps/unix/sysv/linux/dl-execstack.c
+++ b/sysdeps/unix/sysv/linux/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Linux version.
- Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 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
@@ -24,9 +24,8 @@
#include <stdbool.h>
#include <stackinfo.h>
#include <caller.h>
-#include <sysdep.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
extern int __stack_prot attribute_relro attribute_hidden;
@@ -39,7 +38,6 @@ _dl_make_stack_executable (void **stack_endp)
/* This gives us the highest/lowest page that needs to be changed. */
uintptr_t page = ((uintptr_t) *stack_endp
& -(intptr_t) GLRO(dl_pagesize));
- int result = 0;
/* Challenge the caller. */
if (__builtin_expect (__check_caller (RETURN_ADDRESS (0),
@@ -62,10 +60,7 @@ _dl_make_stack_executable (void **stack_endp)
no_growsupdown = true;
else
# endif
- {
- result = errno;
- goto out;
- }
+ return errno;
}
#endif
@@ -90,10 +85,7 @@ _dl_make_stack_executable (void **stack_endp)
else
{
if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
- }
+ return errno;
if (size == GLRO(dl_pagesize))
/* We just tried to mprotect the top hole page and failed.
@@ -116,10 +108,7 @@ _dl_make_stack_executable (void **stack_endp)
else
{
if (errno != ENOMEM) /* Unexpected failure mode. */
- {
- result = errno;
- goto out;
- }
+ return errno;
if (size == GLRO(dl_pagesize))
/* We just tried to mprotect the lowest hole page and failed.
@@ -144,11 +133,6 @@ _dl_make_stack_executable (void **stack_endp)
/* Remember that we changed the permission. */
GL(dl_stack_flags) |= PF_X;
- out:
-#ifdef check_consistency
- check_consistency ();
-#endif
-
- return result;
+ return 0;
}
rtld_hidden_def (_dl_make_stack_executable)
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index 3c93218dfc..abc67fcdcf 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -1,5 +1,5 @@
-/* Operating system specific code for generic dynamic loader functions. Linux.
- Copyright (C) 2000,2001,2002,2004,2005,2006 Free Software Foundation, Inc.
+/* Operating system specific code for generic dynamic loader functions.
+ Copyright (C) 2000, 2001, 2002, 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
@@ -18,14 +18,10 @@
02111-1307 USA. */
#include <string.h>
-#include <errno.h>
#include <fcntl.h>
+#include <sys/sysctl.h>
#include <sys/utsname.h>
-#include <kernel-features.h>
-#include <dl-sysdep.h>
-#include <stdint.h>
-#include <hp-timing.h>
-#include <endian.h>
+#include "kernel-features.h"
#ifndef MIN
# define MIN(a,b) (((a)<(b))?(a):(b))
@@ -43,167 +39,71 @@ dl_fatal (const char *str)
}
#endif
-static inline int __attribute__ ((always_inline))
-_dl_discover_osversion (void)
-{
-#if (defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO) && defined SHARED
- if (GLRO(dl_sysinfo_map) != NULL)
- {
- /* If the kernel-supplied DSO contains a note indicating the kernel's
- version, we don't need to call uname or parse any strings. */
-
- static const struct
- {
- ElfW(Word) vendorlen;
- ElfW(Word) datalen;
- ElfW(Word) type;
- char vendor[8];
- } expected_note = { sizeof "Linux", sizeof (ElfW(Word)), 0, "Linux" };
- const ElfW(Phdr) *const phdr = GLRO(dl_sysinfo_map)->l_phdr;
- const ElfW(Word) phnum = GLRO(dl_sysinfo_map)->l_phnum;
- for (uint_fast16_t i = 0; i < phnum; ++i)
- if (phdr[i].p_type == PT_NOTE)
- {
- const ElfW(Addr) start = (phdr[i].p_vaddr
- + GLRO(dl_sysinfo_map)->l_addr);
- const struct
- {
- ElfW(Word) vendorlen;
- ElfW(Word) datalen;
- ElfW(Word) type;
- } *note = (const void *) start;
- while ((ElfW(Addr)) (note + 1) - start < phdr[i].p_memsz)
- {
- if (!memcmp (note, &expected_note, sizeof expected_note))
- return *(const ElfW(Word) *) ((const void *) note
- + sizeof expected_note);
-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
- note = ((const void *) (note + 1)
- + ROUND (note->vendorlen) + ROUND (note->datalen));
- }
- }
- }
-#endif
-
- char bufmem[64];
- char *buf = bufmem;
- unsigned int version;
- int parts;
- char *cp;
- struct utsname uts;
-
- /* Try the uname system call. */
- if (__uname (&uts))
- {
- /* This was not successful. Now try reading the /proc filesystem. */
- int fd = __open ("/proc/sys/kernel/osrelease", O_RDONLY);
- if (fd < 0)
- return -1;
- ssize_t reslen = __read (fd, bufmem, sizeof (bufmem));
- __close (fd);
- if (reslen <= 0)
- /* This also didn't work. We give up since we cannot
- make sure the library can actually work. */
- return -1;
- buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] = '\0';
- }
- else
- buf = uts.release;
-
- /* Now convert it into a number. The string consists of at most
- three parts. */
- version = 0;
- parts = 0;
- cp = buf;
- while ((*cp >= '0') && (*cp <= '9'))
- {
- unsigned int here = *cp++ - '0';
-
- while ((*cp >= '0') && (*cp <= '9'))
- {
- here *= 10;
- here += *cp++ - '0';
- }
- ++parts;
- version <<= 8;
- version |= here;
-
- if (*cp++ != '.')
- /* Another part following? */
- break;
- }
-
- if (parts < 3)
- version <<= 8 * (3 - parts);
-
- return version;
-}
-
-#define DL_SYSDEP_OSCHECK(FATAL) \
+#define DL_SYSDEP_OSCHECK(FATAL) \
do { \
- /* Test whether the kernel is new enough. This test is only performed \
- if the library is not compiled to run on all kernels. */ \
- \
- int version = _dl_discover_osversion (); \
- if (__builtin_expect (version >= 0, 1)) \
+ /* Test whether the kernel is new enough. This test is only \
+ performed if the library is not compiled to run on all \
+ kernels. */ \
+ if (__LINUX_KERNEL_VERSION > 0) \
{ \
- if (__builtin_expect (GLRO(dl_osversion) == 0, 1) \
- || GLRO(dl_osversion) > version) \
- GLRO(dl_osversion) = version; \
+ char bufmem[64]; \
+ char *buf = bufmem; \
+ unsigned int version; \
+ int parts; \
+ char *cp; \
+ struct utsname uts; \
+ \
+ /* Try the uname syscall */ \
+ if (__uname (&uts)) \
+ { \
+ /* This was not successful. Now try reading the /proc \
+ filesystem. */ \
+ ssize_t reslen; \
+ int fd = __open ("/proc/sys/kernel/osrelease", O_RDONLY); \
+ if (fd == -1 \
+ || (reslen = __read (fd, bufmem, sizeof (bufmem))) <= 0) \
+ /* This also didn't work. We give up since we cannot \
+ make sure the library can actually work. */ \
+ FATAL ("FATAL: cannot determine kernel version\n"); \
+ __close (fd); \
+ buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] = '\0'; \
+ } \
+ else \
+ buf = uts.release; \
+ \
+ /* Now convert it into a number. The string consists of at most \
+ three parts. */ \
+ version = 0; \
+ parts = 0; \
+ cp = buf; \
+ while ((*cp >= '0') && (*cp <= '9')) \
+ { \
+ unsigned int here = *cp++ - '0'; \
+ \
+ while ((*cp >= '0') && (*cp <= '9')) \
+ { \
+ here *= 10; \
+ here += *cp++ - '0'; \
+ } \
+ \
+ ++parts; \
+ version <<= 8; \
+ version |= here; \
+ \
+ if (*cp++ != '.') \
+ /* Another part following? */ \
+ break; \
+ } \
+ \
+ if (parts < 3) \
+ version <<= 8 * (3 - parts); \
\
/* Now we can test with the required version. */ \
- if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION) \
+ if (version < __LINUX_KERNEL_VERSION) \
/* Not sufficent. */ \
FATAL ("FATAL: kernel too old\n"); \
+ \
+ GLRO(dl_osversion) = version; \
} \
- else if (__LINUX_KERNEL_VERSION > 0) \
- FATAL ("FATAL: cannot determine kernel version\n"); \
} while (0)
-
-static inline uintptr_t __attribute__ ((always_inline))
-_dl_setup_stack_chk_guard (void)
-{
- uintptr_t ret;
-#ifdef ENABLE_STACKGUARD_RANDOMIZE
- int fd = __open ("/dev/urandom", O_RDONLY);
- if (fd >= 0)
- {
- ssize_t reslen = __read (fd, &ret, sizeof (ret));
- __close (fd);
- if (reslen == (ssize_t) sizeof (ret))
- return ret;
- }
-#endif
- ret = 0;
- unsigned char *p = (unsigned char *) &ret;
- p[sizeof (ret) - 1] = 255;
- p[sizeof (ret) - 2] = '\n';
-#ifdef HP_TIMING_NOW
- hp_timing_t hpt;
- HP_TIMING_NOW (hpt);
- hpt = (hpt & 0xffff) << 8;
- ret ^= hpt;
-#endif
- uintptr_t stk;
- /* Avoid GCC being too smart. */
- asm ("" : "=r" (stk) : "r" (p));
- stk &= 0x7ffff0;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- stk <<= (__WORDSIZE - 23);
-#elif __WORDSIZE == 64
- stk <<= 31;
-#endif
- ret ^= stk;
- /* Avoid GCC being too smart. */
- p = (unsigned char *) &errno;
- asm ("" : "=r" (stk) : "r" (p));
- stk &= 0x7fff00;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- stk <<= (__WORDSIZE - 29);
-#else
- stk >>= 8;
-#endif
- ret ^= stk;
- return ret;
-}
diff --git a/sysdeps/unix/sysv/linux/dl-sbrk.c b/sysdeps/unix/sysv/linux/dl-sbrk.c
index 1ce5cb188c..4713a92694 100644
--- a/sysdeps/unix/sysv/linux/dl-sbrk.c
+++ b/sysdeps/unix/sysv/linux/dl-sbrk.c
@@ -2,4 +2,4 @@
from ld.so. */
extern void *__curbrk attribute_hidden;
-#include <misc/sbrk.c>
+#include <sbrk.c>
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 42aec77e82..79f95df0a2 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -1,5 +1,5 @@
/* Dynamic linker system dependencies for Linux.
- Copyright (C) 1995,1997,2001,2004,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2001, 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
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <ldsodefs.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#define DL_SYSDEP_INIT frob_brk ()
@@ -53,4 +53,4 @@ frob_brk (void)
#endif
}
-#include <elf/dl-sysdep.c>
+#include <sysdeps/generic/dl-sysdep.c>
diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c
deleted file mode 100644
index 10b903d076..0000000000
--- a/sysdeps/unix/sysv/linux/faccessat.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Test for access to file, relative to open directory. Linux version.
- Copyright (C) 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <alloca.h>
-#include <kernel-features.h>
-#include <sysdep.h>
-
-
-int
-faccessat (fd, file, mode, flag)
- int fd;
- const char *file;
- int mode;
- int flag;
-{
- if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
-#ifdef __NR_faccessat
- if ((flag == 0 || ((flag & ~AT_EACCESS) == 0 && ! __libc_enable_secure))
-# ifndef __ASSUME_ATFCTS
- && __have_atfcts >= 0
-# endif
- )
- {
- int result = INLINE_SYSCALL (faccessat, 3, fd, file, mode);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- if ((!(flag & AT_EACCESS) || ! __libc_enable_secure)
-# ifndef __NR_laccess /* Linux so far has no laccess syscall. */
- && !(flag & AT_SYMLINK_NOFOLLOW)
-# endif
- )
- {
- /* If we are not set-uid or set-gid, access does the same. */
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- int result;
- INTERNAL_SYSCALL_DECL (err);
-
-# ifdef __NR_laccess
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (laccess, err, 2, file, mode);
- else
-# endif
- result = INTERNAL_SYSCALL (access, err, 2, file, mode);
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- result = -1;
- }
-
- return result;
- }
-#endif
-
- struct stat64 stats;
- if (fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
- return -1;
-
- mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
-#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
-# error Oops, portability assumptions incorrect.
-#endif
-
- if (mode == F_OK)
- return 0; /* The file exists. */
-
- uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
-
- /* The super-user can read and write any file, and execute any file
- that anyone can execute. */
- if (uid == 0 && ((mode & X_OK) == 0
- || (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
- return 0;
-
- int granted = (uid == stats.st_uid
- ? (unsigned int) (stats.st_mode & (mode << 6)) >> 6
- : (stats.st_gid == ((flag & AT_EACCESS)
- ? __getegid () : __getgid ())
- || __group_member (stats.st_gid))
- ? (unsigned int) (stats.st_mode & (mode << 3)) >> 3
- : (stats.st_mode & mode));
-
- if (granted == mode)
- return 0;
-
- __set_errno (EACCES);
- return -1;
-}
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
deleted file mode 100644
index 8b420153f1..0000000000
--- a/sysdeps/unix/sysv/linux/fchmodat.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Change the protections of file relative to open directory. Linux version.
- Copyright (C) 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <alloca.h>
-#include <kernel-features.h>
-#include <sysdep.h>
-
-int
-fchmodat (fd, file, mode, flag)
- int fd;
- const char *file;
- mode_t mode;
- int flag;
-{
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-#ifndef __NR_lchmod /* Linux so far has no lchmod syscall. */
- if (flag & AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (ENOTSUP);
- return -1;
- }
-#endif
-
- int result;
-
-#ifdef __NR_fchmodat
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INLINE_SYSCALL (fchmodat, 3, fd, file, mode);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- INTERNAL_SYSCALL_DECL (err);
-
-# ifdef __NR_lchmod
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchmod, err, 2, file, mode);
- else
-# endif
- result = INTERNAL_SYSCALL (chmod, err, 2, file, mode);
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- result = -1;
- }
-
- return result;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/fchownat.c b/sysdeps/unix/sysv/linux/fchownat.c
deleted file mode 100644
index 0f731775b3..0000000000
--- a/sysdeps/unix/sysv/linux/fchownat.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <alloca.h>
-#include <sysdep.h>
-#include <kernel-features.h>
-
-
-/* Change the owner and group of FILE. */
-int
-fchownat (fd, file, owner, group, flag)
- int fd;
- const char *file;
- uid_t owner;
- gid_t group;
- int flag;
-{
- int result;
-
-#ifdef __NR_fchownat
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- INTERNAL_SYSCALL_DECL (err);
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown, err, 3, file, owner, group);
- else
- result = INTERNAL_SYSCALL (chown, err, 3, file, owner, group);
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- result = -1;
- }
-
- return result;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/fstatvfs64.c b/sysdeps/unix/sysv/linux/fstatvfs64.c
index 24c0a8fedc..18f2f6dc7b 100644
--- a/sysdeps/unix/sysv/linux/fstatvfs64.c
+++ b/sysdeps/unix/sysv/linux/fstatvfs64.c
@@ -1,6 +1,5 @@
/* Return information about the filesystem on which FD resides.
- Copyright (C) 1996,1997,1998,2000,2001,2004,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1998,2000,2001,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
@@ -23,7 +22,7 @@
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
extern void __internal_statvfs64 (const char *name, struct statvfs64 *buf,
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index 60e7ae0ac7..26caee2f46 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2001,2003,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2001,2003 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
@@ -25,7 +24,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_ftruncate64
#ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -73,5 +72,5 @@ weak_alias (__ftruncate64, ftruncate64)
#else
/* Use the generic implementation. */
-# include <misc/ftruncate64.c>
+# include <sysdeps/generic/ftruncate64.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/futimes.c b/sysdeps/unix/sysv/linux/futimes.c
index b307c3ff64..f43f568ec1 100644
--- a/sysdeps/unix/sysv/linux/futimes.c
+++ b/sysdeps/unix/sysv/linux/futimes.c
@@ -1,5 +1,5 @@
/* futimes -- change access and modification times of open file. Linux version.
- Copyright (C) 2002,2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 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
@@ -23,9 +23,8 @@
#include <utime.h>
#include <sys/time.h>
#include <stdio-common/_itoa.h>
-#include <fcntl.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
/* Change the access time of FILE to TVP[0] and
the modification time of FILE to TVP[1], but do not follow symlinks.
@@ -41,61 +40,31 @@ __futimes (int fd, const struct timeval tvp[2])
char *cp = _itoa_word ((unsigned int) fd, fname + sizeof (fname) - 1, 10, 0);
cp = memcpy (cp - sizeof (selffd) + 1, selffd, sizeof (selffd) - 1);
- int result;
#ifdef __NR_utimes
- result = INLINE_SYSCALL (utimes, 2, cp, tvp);
+ int result = INLINE_SYSCALL (utimes, 2, cp, tvp);
# ifndef __ASSUME_UTIMES
- if (result == -1 && errno == ENOSYS)
+ if (result != -1 || errno != ENOSYS)
# endif
+ return result;
#endif
- {
- /* The utimes() syscall does not exist or is not available in the
- used kernel. Use utime(). For this we have to convert to the
- data format utime() expects. */
-#ifndef __ASSUME_UTIMES
- struct utimbuf buf;
- struct utimbuf *times;
- if (tvp != NULL)
- {
- times = &buf;
- buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000;
- buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec + 500000) / 1000000;
- }
- else
- times = NULL;
+ /* The utimes() syscall does not exist or is not available in the
+ used kernel. Use utime(). For this we have to convert to the
+ data format utime() expects. */
+#ifndef __ASSUME_UTIMES
+ struct utimbuf buf;
+ struct utimbuf *times;
- result = INLINE_SYSCALL (utime, 2, cp, times);
-#endif
+ if (tvp != NULL)
+ {
+ times = &buf;
+ buf.actime = tvp[0].tv_sec + (tvp[0].tv_usec + 500000) / 1000000;
+ buf.modtime = tvp[1].tv_sec + (tvp[1].tv_usec + 500000) / 1000000;
}
+ else
+ times = NULL;
- if (result == -1)
- /* Check for errors that result from failing to find /proc.
- This means we can't do futimes at all, so return ENOSYS
- rather than some confusing error. */
- switch (errno)
- {
- case EACCES:
- if (tvp == NULL) /* Could be a path problem or a file problem. */
- break;
- /*FALLTHROUGH*/
- case ELOOP:
- case ENAMETOOLONG:
- case ENOTDIR:
- __set_errno (ENOSYS);
- break;
-
- case ENOENT:
- /* Validate the file descriptor by letting fcntl set errno to
- EBADF if it's bogus. Otherwise it's a /proc issue. */
-#if !defined __NR_fcntl && defined __NR_fcntl64
-# define __NR_fcntl __NR_fcntl64
+ return INLINE_SYSCALL (utime, 2, cp, times);
#endif
- if (INLINE_SYSCALL (fcntl, 3, fd, F_GETFD, 0) != -1)
- __set_errno (ENOSYS);
- break;
- }
-
- return result;
}
weak_alias (__futimes, futimes)
diff --git a/sysdeps/unix/sysv/linux/futimesat.c b/sysdeps/unix/sysv/linux/futimesat.c
deleted file mode 100644
index 5f3a3f52f3..0000000000
--- a/sysdeps/unix/sysv/linux/futimesat.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <utime.h>
-#include <sys/time.h>
-#include <sysdep.h>
-#include <kernel-features.h>
-
-
-/* Change the access time of FILE relative to FD to TVP[0] and
- the modification time of FILE to TVP[1]. */
-int
-futimesat (fd, file, tvp)
- int fd;
- const char *file;
- const struct timeval tvp[2];
-{
- int result;
-
- if (file == NULL)
- return __futimes (fd, tvp);
-
-#ifdef __NR_futimesat
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- INTERNAL_SYSCALL_DECL (err);
-
-# ifdef __NR_utimes
- result = INTERNAL_SYSCALL (utimes, err, 2, file, tvp);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
-
-# ifndef __ASSUME_UTIMES
- if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- goto fail;
-# endif
-# endif
-
- /* The utimes() syscall does not exist or is not available in the
- used kernel. Use utime(). For this we have to convert to the
- data format utime() expects. */
-# ifndef __ASSUME_UTIMES
- struct utimbuf tmp;
- struct utimbuf *times;
-
- if (tvp != NULL)
- {
- times = &tmp;
- tmp.actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000;
- tmp.modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000;
- }
- else
- times = NULL;
-
- result = INTERNAL_SYSCALL (utime, err, 2, file, times);
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
-
- fail:
-# endif
-
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
-
- return -1;
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index 6bc560152c..f443adf7da 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -1,5 +1,5 @@
/* fxstat64 using old-style Unix fstat system call.
- Copyright (C) 1997-2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2002, 2003 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
@@ -26,7 +26,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#if __ASSUME_STAT64_SYSCALL == 0
# include <xstatconv.h>
diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
deleted file mode 100644
index c1c416abd7..0000000000
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Ho hum, if fxstatat == fxstatat64 we must get rid of the prototype or gcc
- will complain since they don't strictly match. */
-#define __fxstatat64 __fxstatat64_disable
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <kernel_stat.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <xstatconv.h>
-
-/* Get information about the file NAME in BUF. */
-int
-__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
-{
- int result;
- INTERNAL_SYSCALL_DECL (err);
-#ifdef STAT_IS_KERNEL_STAT
-# define kst (*st)
-#else
- struct kernel_stat kst;
-#endif
-
-#ifdef __NR_newfstatat
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INTERNAL_SYSCALL (newfstatat, err, 4, fd, file, &kst, flag);
-# ifndef __ASSUME_ATFCTS
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)
- && INTERNAL_SYSCALL_ERRNO (result, err) == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- {
-#ifdef STAT_IS_KERNEL_STAT
- return 0;
-#else
- return __xstat_conv (vers, &kst, st);
-#endif
- }
- else
- {
- __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- }
-#endif
-
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
- if (vers == _STAT_VER_KERNEL)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return result;
- }
-#ifdef STAT_IS_KERNEL_STAT
- else
- {
- __set_errno (EINVAL);
- return -1;
- }
-#else
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kst, st);
-#endif
-
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
-
- return -1;
-}
-libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
-# undef __fxstatat64
-strong_alias (__fxstatat, __fxstatat64);
-libc_hidden_def (__fxstatat64)
-#endif
diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c
deleted file mode 100644
index cb932b8e59..0000000000
--- a/sysdeps/unix/sysv/linux/fxstatat64.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <kernel_stat.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <kernel-features.h>
-
-#if __ASSUME_STAT64_SYSCALL == 0
-# include <xstatconv.h>
-#endif
-
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls.
- This is the definition. */
-extern int __have_no_stat64;
-# endif
-#endif
-
-/* Get information about the file NAME in BUF. */
-
-int
-__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
-{
- if (__builtin_expect (vers != _STAT_VER_LINUX, 0))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- int result;
- INTERNAL_SYSCALL_DECL (err);
-
-#ifdef __NR_fstatat64
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag);
-# ifndef __ASSUME_ATFCTS
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)
- && INTERNAL_SYSCALL_ERRNO (result, err) == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return 0;
- else
- {
- __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
-# if __ASSUME_STAT64_SYSCALL > 0
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- {
-# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
- if (st->__st_ino != (__ino_t) st->st_ino)
- st->st_ino = st->__st_ino;
-# endif
- return result;
- }
-# else
- struct kernel_stat kst;
-# ifdef __NR_stat64
- if (! __have_no_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- CHECK_1 (st));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- {
-# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
- if (st->__st_ino != (__ino_t) st->st_ino)
- st->st_ino = st->__st_ino;
-# endif
- return result;
- }
- if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- goto fail;
-
- __have_no_stat64 = 1;
- }
-# endif
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat64_conv (vers, &kst, st);
-
- fail:
-# endif
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
-
- return -1;
-#endif
-}
-libc_hidden_def (__fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/gai_sigqueue.c b/sysdeps/unix/sysv/linux/gai_sigqueue.c
index 0c6654a386..3e67add0d7 100644
--- a/sysdeps/unix/sysv/linux/gai_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/gai_sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2003 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
@@ -52,5 +52,5 @@ __gai_sigqueue (sig, val, caller_pid)
sig, __ptrvalue (&info));
}
#else
-# include <resolv/gai_sigqueue.c>
+# include <sysdeps/generic/gai_sigqueue.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 911d85f43d..9695d8a035 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -1,6 +1,5 @@
/* Determine current working directory. Linux version.
- Copyright (C) 1997,1998,1999,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -29,7 +28,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
/* If we compile the file for use in ld.so we don't need the feature
@@ -87,7 +86,7 @@ __getcwd (char *buf, size_t size)
return NULL;
}
- alloc_size = MAX (PATH_MAX, __getpagesize ());
+ alloc_size = PATH_MAX;
}
if (buf == NULL)
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 836cbf3922..d473486de8 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2003, 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
@@ -33,15 +33,15 @@
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getdents64
# ifndef __ASSUME_GETDENTS64_SYSCALL
# ifndef __GETDENTS
/* The variable is shared between all *getdents* calls. */
-int __have_no_getdents64 attribute_hidden;
+int __have_no_getdents64;
# else
-extern int __have_no_getdents64 attribute_hidden;
+extern int __have_no_getdents64;
# endif
# define have_no_getdents64_defined 1
# endif
diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
index de98fb3d7b..f44a9afbf2 100644
--- a/sysdeps/unix/sysv/linux/gethostid.c
+++ b/sysdeps/unix/sysv/linux/gethostid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1996,1998-2001,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998-2001,2003,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
@@ -25,6 +24,7 @@
#include <not-cancel.h>
#define HOSTIDFILE "/etc/hostid"
+#define OLD_HOSTIDFILE "/etc/hostid"
#ifdef SET_PROCEDURE
int
@@ -81,6 +81,8 @@ gethostid ()
/* First try to get the ID from a former invocation of sethostid. */
fd = open_not_cancel (HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
+ if (fd < 0)
+ fd = open_not_cancel (OLD_HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
if (fd >= 0)
{
ssize_t n = read_not_cancel (fd, &id, sizeof (id));
diff --git a/sysdeps/unix/sysv/linux/getloadavg.c b/sysdeps/unix/sysv/linux/getloadavg.c
index 81a1c0dd52..6a521431ba 100644
--- a/sysdeps/unix/sysv/linux/getloadavg.c
+++ b/sysdeps/unix/sysv/linux/getloadavg.c
@@ -1,5 +1,5 @@
/* Get system load averages. Linux (/proc/loadavg) version.
- Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2003 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
@@ -55,7 +55,7 @@ getloadavg (double loadavg[], int nelem)
for (i = 0; i < nelem; ++i)
{
char *endp;
- loadavg[i] = __strtod_l (p, &endp, _nl_C_locobj_ptr);
+ loadavg[i] = __strtod_l (p, &endp, &_nl_C_locobj);
if (endp == p)
/* This should not happen. The format of /proc/loadavg
must have changed. Don't return with what we have,
diff --git a/sysdeps/unix/sysv/linux/getsourcefilter.c b/sysdeps/unix/sysv/linux/getsourcefilter.c
index a6f89a3cc9..fdcf8d6130 100644
--- a/sysdeps/unix/sysv/linux/getsourcefilter.c
+++ b/sysdeps/unix/sysv/linux/getsourcefilter.c
@@ -1,5 +1,5 @@
/* Get source filter. Linux version.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -112,27 +112,23 @@ getsourcefilter (int s, uint32_t interface, const struct sockaddr *group,
gf->gf_numsrc = *numsrc;
/* We need to provide the appropriate socket level value. */
- int result;
int sol = __get_sol (group->sa_family, grouplen);
if (sol == -1)
{
__set_errno (EINVAL);
- result = -1;
+ return -1;
}
- else
- {
- result = __getsockopt (s, sol, MCAST_MSFILTER, gf, &needed);
- /* If successful, copy the results to the places the caller wants
- them in. */
- if (result == 0)
- {
- *fmode = gf->gf_fmode;
- memcpy (slist, gf->gf_slist,
- MIN (*numsrc, gf->gf_numsrc)
- * sizeof (struct sockaddr_storage));
- *numsrc = gf->gf_numsrc;
- }
+ int result = __getsockopt (s, sol, MCAST_MSFILTER, gf, &needed);
+
+ /* If successful, copy the results to the places the caller wants
+ them in. */
+ if (result == 0)
+ {
+ *fmode = gf->gf_fmode;
+ memcpy (slist, gf->gf_slist,
+ MIN (*numsrc, gf->gf_numsrc) * sizeof (struct sockaddr_storage));
+ *numsrc = gf->gf_numsrc;
}
if (! use_alloca)
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index d655ba3b27..985a0860cb 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux version.
- Copyright (C) 1996-2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -34,6 +34,75 @@
#include <atomic.h>
+/* The default value for the /proc filesystem mount point. */
+static const char path_proc[] = "/proc";
+
+/* Actual mount point of /proc filesystem. */
+libc_freeres_ptr (static char *mount_proc);
+
+/* Determine the path to the /proc filesystem if available. */
+static const char *
+internal_function
+get_proc_path (char *buffer, size_t bufsize)
+{
+ struct mntent mount_point;
+ struct mntent *entry;
+ char *result = NULL;
+ char *copy_result;
+ FILE *fp;
+
+ /* First find the mount point of the proc filesystem. */
+ fp = __setmntent (_PATH_MOUNTED, "r");
+ if (fp == NULL)
+ fp = __setmntent (_PATH_MNTTAB, "r");
+ if (fp != NULL)
+ {
+ /* We don't need locking. */
+ (void) __fsetlocking (fp, FSETLOCKING_BYCALLER);
+
+ while ((entry = __getmntent_r (fp, &mount_point, buffer, bufsize))
+ != NULL)
+ if (strcmp (mount_point.mnt_type, "proc") == 0)
+ {
+ result = mount_point.mnt_dir;
+ break;
+ }
+ __endmntent (fp);
+ }
+
+ /* If we haven't found anything this is generally a bad sign but we
+ handle it gracefully. We return what is hopefully the right
+ answer (/proc) but we don't remember this. This will enable
+ programs which started before the system is fully running to
+ adjust themselves. */
+ if (result == NULL)
+ return path_proc;
+
+ /* Make a copy we can keep around. */
+ copy_result = __strdup (result);
+ if (copy_result == NULL)
+ return result;
+
+ /* Now store the copied value. But do it atomically. */
+ assert (sizeof (long int) == sizeof (void *__unbounded));
+ if (atomic_compare_and_exchange_bool_acq (&mount_proc, copy_result, NULL))
+ /* Replacing the value failed. This means another thread was
+ faster and we don't need the copy anymore. */
+ free (copy_result);
+#if __BOUNDED_POINTERS__
+ else
+ {
+ /* compare_and_swap only copied the pointer value, so we must
+ now copy the bounds as well. */
+ __ptrlow (mount_proc) = __ptrlow (copy_result);
+ __ptrhigh (mount_proc) = __ptrhigh (copy_result);
+ }
+#endif
+
+ return mount_proc;
+}
+
+
/* How we can determine the number of available processors depends on
the configuration. There is currently (as of version 2.0.21) no
system call to determine the number. It is planned for the 2.1.x
@@ -67,35 +136,50 @@
int
__get_nprocs ()
{
+ FILE *fp;
char buffer[8192];
+ const char *proc_path;
int result = 1;
/* XXX Here will come a test for the new system call. */
- /* The /proc/stat format is more uniform, use it by default. */
- FILE *fp = fopen ("/proc/stat", "rc");
- if (fp != NULL)
+ /* Get mount point of proc filesystem. */
+ proc_path = get_proc_path (buffer, sizeof buffer);
+
+ /* If we haven't found an appropriate entry return 1. */
+ if (proc_path != NULL)
{
- /* No threads use this stream. */
- __fsetlocking (fp, FSETLOCKING_BYCALLER);
+ char *proc_fname = alloca (strlen (proc_path) + sizeof ("/cpuinfo"));
- result = 0;
- while (fgets_unlocked (buffer, sizeof (buffer), fp) != NULL)
- if (strncmp (buffer, "cpu", 3) == 0 && isdigit (buffer[3]))
- ++result;
+ /* The /proc/stat format is more uniform, use it by default. */
+ __stpcpy (__stpcpy (proc_fname, proc_path), "/stat");
- fclose (fp);
- }
- else
- {
- fp = fopen ("/proc/cpuinfo", "rc");
+ fp = fopen (proc_fname, "rc");
if (fp != NULL)
{
/* No threads use this stream. */
__fsetlocking (fp, FSETLOCKING_BYCALLER);
- GET_NPROCS_PARSER (fp, buffer, result);
+
+ result = 0;
+ while (fgets_unlocked (buffer, sizeof (buffer), fp) != NULL)
+ if (strncmp (buffer, "cpu", 3) == 0 && isdigit (buffer[3]))
+ ++result;
+
fclose (fp);
}
+ else
+ {
+ __stpcpy (__stpcpy (proc_fname, proc_path), "/cpuinfo");
+
+ fp = fopen (proc_fname, "rc");
+ if (fp != NULL)
+ {
+ /* No threads use this stream. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+ GET_NPROCS_PARSER (fp, buffer, result);
+ fclose (fp);
+ }
+ }
}
return result;
@@ -109,19 +193,30 @@ weak_alias (__get_nprocs, get_nprocs)
int
__get_nprocs_conf ()
{
+ FILE *fp;
char buffer[8192];
+ const char *proc_path;
int result = 1;
/* XXX Here will come a test for the new system call. */
+ /* Get mount point of proc filesystem. */
+ proc_path = get_proc_path (buffer, sizeof buffer);
+
/* If we haven't found an appropriate entry return 1. */
- FILE *fp = fopen ("/proc/cpuinfo", "rc");
- if (fp != NULL)
+ if (proc_path != NULL)
{
- /* No threads use this stream. */
- __fsetlocking (fp, FSETLOCKING_BYCALLER);
- GET_NPROCS_CONF_PARSER (fp, buffer, result);
- fclose (fp);
+ char *proc_cpuinfo = alloca (strlen (proc_path) + sizeof ("/cpuinfo"));
+ __stpcpy (__stpcpy (proc_cpuinfo, proc_path), "/cpuinfo");
+
+ fp = fopen (proc_cpuinfo, "rc");
+ if (fp != NULL)
+ {
+ /* No threads use this stream. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+ GET_NPROCS_CONF_PARSER (fp, buffer, result);
+ fclose (fp);
+ }
}
return result;
@@ -140,29 +235,40 @@ static long int
internal_function
phys_pages_info (const char *format)
{
+ FILE *fp;
char buffer[8192];
+ const char *proc_path;
long int result = -1;
+ /* Get mount point of proc filesystem. */
+ proc_path = get_proc_path (buffer, sizeof buffer);
+
/* If we haven't found an appropriate entry return 1. */
- FILE *fp = fopen ("/proc/meminfo", "rc");
- if (fp != NULL)
+ if (proc_path != NULL)
{
- /* No threads use this stream. */
- __fsetlocking (fp, FSETLOCKING_BYCALLER);
-
- result = 0;
- /* Read all lines and count the lines starting with the
- string "processor". We don't have to fear extremely long
- lines since the kernel will not generate them. 8192
- bytes are really enough. */
- while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL)
- if (sscanf (buffer, format, &result) == 1)
- {
- result /= (__getpagesize () / 1024);
- break;
- }
+ char *proc_meminfo = alloca (strlen (proc_path) + sizeof ("/meminfo"));
+ __stpcpy (__stpcpy (proc_meminfo, proc_path), "/meminfo");
- fclose (fp);
+ fp = fopen (proc_meminfo, "rc");
+ if (fp != NULL)
+ {
+ /* No threads use this stream. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+
+ result = 0;
+ /* Read all lines and count the lines starting with the
+ string "processor". We don't have to fear extremely long
+ lines since the kernel will not generate them. 8192
+ bytes are really enough. */
+ while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL)
+ if (sscanf (buffer, format, &result) == 1)
+ {
+ result /= (__getpagesize () / 1024);
+ break;
+ }
+
+ fclose (fp);
+ }
}
if (result == -1)
diff --git a/sysdeps/unix/sysv/linux/hppa/Dist b/sysdeps/unix/sysv/linux/hppa/Dist
new file mode 100644
index 0000000000..2954d3c4bf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Dist
@@ -0,0 +1,5 @@
+umount.c
+kernel_stat.h
+kernel_sigaction.h
+clone.S
+sys/procfs.h
diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile b/sysdeps/unix/sysv/linux/hppa/Makefile
new file mode 100644
index 0000000000..1c93ec52d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Makefile
@@ -0,0 +1,2 @@
+# linux/hppa does not use -lmilli anymore
+gnulib := -lgcc
diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
new file mode 100644
index 0000000000..e15c8225fb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/Versions
@@ -0,0 +1,25 @@
+libc {
+ # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
+ # When you get an error from errlist-compat.awk, you need to add a new
+ # version here. Don't do this blindly, since this means changing the ABI
+ # for all GNU/Linux configurations.
+
+ GLIBC_2.1 {
+ #errlist-compat 253
+ _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+ }
+ GLIBC_2.2 {
+ # New rlimit interface
+ getrlimit; setrlimit; getrlimit64; setrlimit64;
+ }
+ GLIBC_2.3 {
+ #errlist-compat 254
+ _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+ }
+}
+librt {
+ GLIBC_2.3 {
+ # AIO functions.
+ aio_cancel; aio_cancel64;
+ }
+}
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
new file mode 100644
index 0000000000..003d71f622
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -0,0 +1,51 @@
+/* Error constants. Linux/HPPA specific version.
+ Copyright (C) 1996,1997,1998,1999,2000,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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+# include <linux/errno.h>
+
+/* Linux also has no ECANCELED error code. Since it is not used here
+ we define it to an invalid value. */
+# ifndef ECANCELED
+# define ECANCELED ECANCELLED
+# endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# if !defined _LIBC || defined _LIBC_REENTRANT
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough. We must
+ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+ defined. */
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 47 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif /* !_ERRNO_H && __need_Emath */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
new file mode 100644
index 0000000000..9d967c6475
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -0,0 +1,181 @@
+/* O_*, F_*, FD_* bit values for Linux/HPPA.
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2002,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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_RDONLY 00000000
+#define O_WRONLY 00000001
+#define O_RDWR 00000002
+#define O_ACCMODE 00000003
+#define O_APPEND 00000010
+#define O_BLKSEEK 00000100 /* HPUX only */
+#define O_CREAT 00000400 /* not fcntl */
+#define O_TRUNC 00001000 /* not fcntl */
+#define O_EXCL 00002000 /* not fcntl */
+#define O_ASYNC 00020000
+#define O_SYNC 00100000
+#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NDELAY O_NONBLOCK
+#define O_NOCTTY 00400000 /* not fcntl */
+
+
+#ifdef __USE_GNU
+# define O_DIRECT 00040000 /* direct disk access hint - currently ignored */
+# define O_DIRECTORY 00010000 /* must be a directory */
+# define O_NOFOLLOW 00000200 /* don't follow links */
+# define O_NOATIME 04000000 /* Do not set atime. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 00004000
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC 01000000 /* HPUX only */
+# define O_RSYNC 02000000 /* HPUX only */
+#endif
+
+/* 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. */
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking). */
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+#endif
+
+#define F_GETLK64 8 /* Get record locking info. */
+#define F_SETLK64 9 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 10 /* Set record locking info (blocking). */
+
+#if defined __USE_BSD || defined __USE_UNIX98
+# define F_GETOWN 11 /* Get owner of socket (receiver of SIGIO). */
+# define F_SETOWN 12 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 13 /* Set number of signal to be sent. */
+# define F_GETSIG 14 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+#endif
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 1 /* Read lock. */
+#define F_WRLCK 2 /* Write lock. */
+#define F_UNLCK 3 /* Remove lock. */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+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
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#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. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
+
+__BEGIN_DECLS
+
+/* Provide kernel hint to read ahead. */
+extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+ __THROW;
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
new file mode 100644
index 0000000000..6f4e05fcc8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ioctls.h
@@ -0,0 +1,37 @@
+/* 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files. */
+#include <asm/ioctls.h>
+
+/* Oh well, this is necessary since the kernel data structure is
+ different from the user-level version. */
+#undef TCGETS
+#undef TCSETS
+#undef TCSETSW
+#undef TCSETSF
+#define TCGETS _IOR ('T', 16, char[36])
+#define TCSETS _IOW ('T', 17, char[36])
+#define TCSETSW _IOW ('T', 18, char[36])
+#define TCSETSF _IOW ('T', 19, char[36])
+
+#include <linux/sockios.h>
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
new file mode 100644
index 0000000000..d80cf06993
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_CREAT 01000 /* Create key if key does not exist. */
+#define IPC_EXCL 02000 /* Fail if key exists. */
+#define IPC_NOWAIT 04000 /* Return error on wait. */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 0 /* Remove identifier. */
+#define IPC_SET 1 /* Set `ipc_perm' options. */
+#define IPC_STAT 2 /* Get `ipc_perm' options. */
+#ifdef __USE_GNU
+# define IPC_INFO 3 /* See ipcs. */
+#endif
+
+/* Special key values. */
+#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ __uid_t uid; /* Owner's user ID. */
+ __gid_t gid; /* Owner's group ID. */
+ __uid_t cuid; /* Creator's user ID. */
+ __gid_t cgid; /* Creator's group ID. */
+#if __WORDSIZE == 32
+ unsigned short int __pad1;
+ unsigned short int mode; /* Read/write permission. */
+ unsigned short int __pad2;
+#else
+ __mode_t mode; /* Read/write permission. */
+ unsigned short int __pad2;
+#endif
+ unsigned short int __seq; /* Sequence number. */
+ unsigned int __pad3;
+ unsigned long long int __unused1;
+ unsigned long long int __unused2;
+ };
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
new file mode 100644
index 0000000000..1eb1233814
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h
@@ -0,0 +1,83 @@
+/* Definitions for POSIX memory map interface. Linux/HPPA version.
+ Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* these are basically taken from the kernel definitions */
+
+#define PROT_READ 0x1 /* page can be read */
+#define PROT_WRITE 0x2 /* page can be written */
+#define PROT_EXEC 0x4 /* page can be executed */
+#define PROT_NONE 0x0 /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
+ growsdown vma (mprotect only). */
+#define PROT_GROWSUP 0x02000000 /* Extend change to start of
+ growsup vma (mprotect only). */
+
+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_TYPE 0x03 /* Mask for type of mapping */
+#define MAP_FIXED 0x04 /* Interpret addr exactly */
+#define MAP_ANONYMOUS 0x10 /* don't use a file */
+
+#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
+#define MAP_LOCKED 0x2000 /* pages are locked */
+#define MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define MAP_GROWSDOWN 0x8000 /* stack-like segment */
+#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
+#define MAP_NONBLOCK 0x20000 /* do not block on IO */
+
+#define MS_SYNC 1 /* synchronous memory sync */
+#define MS_ASYNC 2 /* sync memory asynchronously */
+#define MS_INVALIDATE 4 /* invalidate the caches */
+
+#define MCL_CURRENT 1 /* lock all current mappings */
+#define MCL_FUTURE 2 /* lock all future mappings */
+
+#define MADV_NORMAL 0 /* no further special treatment */
+#define MADV_RANDOM 1 /* expect random page references */
+#define MADV_SEQUENTIAL 2 /* expect sequential page references */
+#define MADV_WILLNEED 3 /* will need these pages */
+#define MADV_DONTNEED 4 /* dont need these pages */
+#define MADV_SPACEAVAIL 5 /* insure that resources are reserved */
+#define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */
+#define MADV_VPS_INHERIT 7 /* Inherit parents page size */
+
+/* The range 12-64 is reserved for page size specification. */
+#define MADV_4K_PAGES 12 /* Use 4K pages */
+#define MADV_16K_PAGES 14 /* Use 16K pages */
+#define MADV_64K_PAGES 16 /* Use 64K pages */
+#define MADV_256K_PAGES 18 /* Use 256K pages */
+#define MADV_1M_PAGES 20 /* Use 1 Megabyte pages */
+#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */
+#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */
+#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */
+
+/* compatibility flags */
+#define MAP_ANON MAP_ANONYMOUS
+#define MAP_FILE 0
+#define MAP_VARIABLE 0
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/msq.h b/sysdeps/unix/sysv/linux/hppa/bits/msq.h
new file mode 100644
index 0000000000..1268dc858c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/msq.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Define options for message queue functions. */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+#ifdef __USE_GNU
+# define MSG_EXCEPT 020000 /* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition. */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+ The type `struct msg' is opaque. */
+struct msqid_ds
+{
+ struct ipc_perm msg_perm; /* structure describing operation permission */
+#if __WORDSIZE == 32
+ unsigned int __pad1;
+#endif
+ __time_t msg_stime; /* time of last msgsnd command */
+#if __WORDSIZE == 32
+ unsigned int __pad2;
+#endif
+ __time_t msg_rtime; /* time of last msgrcv command */
+#if __WORDSIZE == 32
+ unsigned int __pad3;
+#endif
+ __time_t msg_ctime; /* time of last change */
+ unsigned long int __msg_cbytes; /* current number of bytes on queue */
+ msgqnum_t msg_qnum; /* number of messages currently on queue */
+ msglen_t msg_qbytes; /* max number of bytes allowed on queue */
+ __pid_t msg_lspid; /* pid of last msgsnd() */
+ __pid_t msg_lrpid; /* pid of last msgrcv() */
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes __msg_cbytes
+
+/* ipcs ctl commands */
+# define MSG_STAT 11
+# define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+ {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short int msgseg;
+ };
+
+#endif /* __USE_MISC */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sem.h b/sysdeps/unix/sysv/linux/hppa/bits/sem.h
new file mode 100644
index 0000000000..2880765108
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/sem.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+/* Flags for `semop'. */
+#define SEM_UNDO 0x1000 /* undo the operation on exit */
+
+/* Commands for `semctl'. */
+#define GETPID 11 /* get sempid */
+#define GETVAL 12 /* get semval */
+#define GETALL 13 /* get all semval's */
+#define GETNCNT 14 /* get semncnt */
+#define GETZCNT 15 /* get semzcnt */
+#define SETVAL 16 /* set semval */
+#define SETALL 17 /* set all semval's */
+
+
+/* Data structure describing a set of semaphores. */
+struct semid_ds
+{
+ struct ipc_perm sem_perm; /* operation permission struct */
+#if __WORDSIZE == 32
+ unsigned int __pad1;
+#endif
+ __time_t sem_otime; /* last semop() time */
+#if __WORDSIZE == 32
+ unsigned int __pad2;
+#endif
+ __time_t sem_ctime; /* last time changed by semctl() */
+ unsigned long int sem_nsems; /* number of semaphores in set */
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+};
+
+/* The user should define a union like the following to use it for arguments
+ for `semctl'.
+
+ union semun
+ {
+ int val; <= value for SETVAL
+ struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
+ unsigned short int *array; <= array for GETALL & SETALL
+ struct seminfo *__buf; <= buffer for IPC_INFO
+ };
+
+ Previous versions of this file used to define this union but this is
+ incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+ one must define the union or not. */
+#define _SEM_SEMUN_UNDEFINED 1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 18
+# define SEM_INFO 19
+
+struct seminfo
+{
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#endif /* __USE_MISC */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
new file mode 100644
index 0000000000..1c022fda83
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/shm.h
@@ -0,0 +1,106 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 11 /* lock segment (root only) */
+#define SHM_UNLOCK 12 /* unlock segment (root only) */
+
+/* Segment low boundary address multiple. */
+#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */
+
+/* Type to count number of attaches. */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+#if __WORDSIZE == 32
+ unsigned int __pad1;
+#endif
+ __time_t shm_atime; /* time of last shmat() */
+#if __WORDSIZE == 32
+ unsigned int __pad2;
+#endif
+ __time_t shm_dtime; /* time of last shmdt() */
+#if __WORDSIZE == 32
+ unsigned int __pad3;
+#endif
+ __time_t shm_ctime; /* time of last change by shmctl() */
+#if __WORDSIZE == 32
+ unsigned int __pad4;
+#endif
+ size_t shm_segsz; /* size of segment in bytes */
+ __pid_t shm_cpid; /* pid of creator */
+ __pid_t shm_lpid; /* pid of last shmop */
+ shmatt_t shm_nattch; /* number of current attaches */
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+ };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 13
+# define SHM_INFO 14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST 01000 /* segment will be destroyed on last detach */
+# define SHM_LOCKED 02000 /* segment will not be swapped */
+# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
+
+struct shminfo
+ {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+ };
+
+struct shm_info
+ {
+ int used_ids;
+ unsigned long int shm_tot; /* total allocated shm */
+ unsigned long int shm_rss; /* total resident shm */
+ unsigned long int shm_swp; /* total swapped shm */
+ unsigned long int swap_attempts;
+ unsigned long int swap_successes;
+ };
+
+#endif /* __USE_MISC */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
new file mode 100644
index 0000000000..33f2b237b7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/sigaction.h
@@ -0,0 +1,75 @@
+/* Definitions for Linux/HPPA sigaction.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct sigaction
+ {
+ /* Signal handler. */
+#ifdef __USE_POSIX199309
+ union
+ {
+ /* Used if SA_SIGINFO is not set. */
+ __sighandler_t sa_handler;
+ /* Used if SA_SIGINFO is set. */
+ void (*sa_sigaction) (int, siginfo_t *, void *);
+ }
+ __sigaction_handler;
+# define sa_handler __sigaction_handler.sa_handler
+# define sa_sigaction __sigaction_handler.sa_sigaction
+#else
+ __sighandler_t sa_handler;
+#endif
+
+ /* Special flags. */
+ unsigned long int sa_flags;
+
+ /* Additional set of signals to be blocked. */
+ __sigset_t sa_mask;
+ };
+
+/* Bits in `sa_flags'. */
+
+#define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDWAIT 0x00000080 /* Don't create zombie on child death. */
+#define SA_SIGINFO 0x00000010 /* Invoke signal-catching function with
+ three arguments instead of one. */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESETHAND 0x00000004 /* Reset to SIG_DFL on entry to handler. */
+# define SA_NODEFER 0x00000020 /* Don't automatically block the signal
+ when its handler is being executed. */
+# define SA_RESTART 0x00000040 /* Restart syscall on signal return. */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historic no-op. */
+
+/* Some aliases for the SA_ constants. */
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
+# define SA_STACK SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'. */
+#define SIG_BLOCK 0 /* for blocking signals */
+#define SIG_UNBLOCK 1 /* for unblocking signals */
+#define SIG_SETMASK 2 /* for setting the signal mask */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/signum.h b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
new file mode 100644
index 0000000000..bf46006c8d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/signum.h
@@ -0,0 +1,82 @@
+/* Signal number definitions. Linux/HPPA version.
+ Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
+#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
+#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#endif
+
+
+/* Signals. */
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGABRT 6 /* Abort (ANSI). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGEMT 7
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGBUS 10 /* BUS error (4.2 BSD). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGSYS 12 /* Bad system call. */
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
+#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGCHLD 18 /* Child status has changed (POSIX). */
+#define SIGPWR 19 /* Power failure restart (System V). */
+#define SIGVTALRM 20 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 21 /* Profiling alarm clock (4.2 BSD). */
+#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
+#define SIGIO 22 /* I/O now possible (4.2 BSD). */
+#define SIGWINCH 23 /* Window size change (4.3 BSD, Sun). */
+#define SIGSTOP 24 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 25 /* Keyboard stop (POSIX). */
+#define SIGCONT 26 /* Continue (POSIX). */
+#define SIGTTIN 27 /* Background read from tty (POSIX). */
+#define SIGTTOU 28 /* Background write to tty (POSIX). */
+#define SIGURG 29 /* Urgent condition on socket (4.2 BSD). */
+#define SIGLOST 30 /* Operating System Has Lost (HP/UX). */
+#define SIGUNUSED 31
+#define SIGXCPU 33 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 34 /* File size limit exceeded (4.2 BSD). */
+#define SIGSTKFLT 36 /* Stack fault. */
+
+#define _NSIG 65 /* Biggest signal number + 1
+ (including real-time signals). */
+
+#define SIGRTMIN (__libc_current_sigrtmin ())
+#define SIGRTMAX (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel. These values should not be
+ used directly at user level. */
+#define __SIGRTMIN 37
+#define __SIGRTMAX (_NSIG - 1)
+
+#endif /* <signal.h> included. */
diff --git a/sysdeps/unix/sysv/linux/hppa/brk.c b/sysdeps/unix/sysv/linux/hppa/brk.c
new file mode 100644
index 0000000000..a4b4df2831
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/brk.c
@@ -0,0 +1,42 @@
+/* brk system call for Linux/HPPA.
+ Copyright (C) 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sysdep.h>
+
+/* This must be initialized data because commons can't have aliases. */
+void *__curbrk = 0;
+
+int
+__brk (void *addr)
+{
+ void *newbrk;
+
+ __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
+
+ if (newbrk < addr)
+ {
+ __set_errno (ENOMEM);
+ return -1;
+ }
+
+ return 0;
+}
+weak_alias (__brk, brk)
diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S
new file mode 100644
index 0000000000..4f3bb9e206
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/clone.S
@@ -0,0 +1,99 @@
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
+ Based on the Alpha version by Richard Henderson <rth@tamu.edu>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* clone() is even more special than fork() as it mucks with stacks
+ and invokes a function in the right context after its all over. */
+
+#include <asm/unistd.h>
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
+
+ .text
+ENTRY(__clone)
+ /* FIXME: I have no idea how profiling works on hppa. */
+
+ /* Sanity check arguments. */
+ comib,= 0,%arg0,.Lerror /* no NULL function pointers */
+ ldi -EINVAL,%ret0
+ comib,= 0,%arg1,.Lerror /* no NULL stack pointers */
+ nop
+
+ /* Save the fn ptr and arg on the new stack. */
+ stwm %arg0,64(%arg1)
+ stw %arg3,-60(%arg1)
+
+ /* Save the PIC register. */
+#ifdef PIC
+ stw %r19,-32(%sr0, %sp) /* parent */
+#endif
+
+ /* Do the system call */
+ copy %arg2,%arg0
+ ble 0x100(%sr2,%r0)
+ ldi __NR_clone,%r20
+
+ ldi -4096,%r1
+ comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */
+ b,n .Lerror
+
+ comib,=,n 0,%ret0,thread_start
+
+ /* Successful return from the parent
+ No need to restore the PIC register,
+ since we return immediately. */
+
+ bv %r0(%rp)
+ nop
+
+ /* Something bad happened -- no child created */
+.Lerror:
+
+ /* Restore the PIC register on error */
+#ifdef PIC
+ ldw -32(%sr0, %sp), %r19 /* parent */
+#endif
+
+ b __syscall_error
+ sub %r0,%ret0,%arg0
+
+thread_start:
+
+ /* Load up the arguments. */
+ ldw -60(%sr0, %sp),%arg0
+ ldw -64(%sr0, %sp),%r22
+
+ /* $$dyncall fixes childs PIC register */
+
+ /* Call the user's function */
+ bl $$dyncall,%r31
+ copy %r31,%rp
+
+ bl _exit,%rp
+ copy %ret0,%arg0
+
+ /* Die horribly. */
+ iitlbp %r0,(%r0)
+
+PSEUDO_END(__clone)
+
+weak_alias(__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/hppa/fcntl.c b/sysdeps/unix/sysv/linux/hppa/fcntl.c
new file mode 100644
index 0000000000..ea951bc4f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/fcntl.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/getdents64.c b/sysdeps/unix/sysv/linux/hppa/getdents64.c
new file mode 100644
index 0000000000..0c75fb5a06
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/getdents64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getdents64.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/getrlimit64.c b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
new file mode 100644
index 0000000000..fef018f471
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/getrlimit64.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
new file mode 100644
index 0000000000..af048cbe7d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h
@@ -0,0 +1,18 @@
+/* We have a separate header file here because we do not support
+ SA_RESTORER on hppa. */
+
+/* This is the sigaction struction from the Linux 2.1.20 kernel. */
+/* Blah. This is bogus. We don't ever use it. */
+struct old_kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_mask;
+ unsigned long sa_flags;
+};
+
+/* This is the sigaction structure from the Linux 2.1.68 kernel. */
+
+struct kernel_sigaction {
+ __sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ sigset_t sa_mask;
+};
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
new file mode 100644
index 0000000000..a85c5be464
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
@@ -0,0 +1,31 @@
+/* definition of "struct stat" from the kernel */
+struct kernel_stat {
+ unsigned long st_dev; /* dev_t is 32 bits on parisc */
+ unsigned long st_ino; /* 32 bits */
+ unsigned short st_mode; /* 16 bits */
+ unsigned short st_nlink; /* 16 bits */
+ unsigned short st_reserved1; /* old st_uid */
+ unsigned short st_reserved2; /* old st_gid */
+ unsigned long st_rdev;
+ unsigned long st_size;
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long st_blksize;
+ long st_blocks;
+ unsigned long __unused1; /* ACL stuff */
+ unsigned long __unused2; /* network */
+ unsigned long __unused3; /* network */
+ unsigned long __unused4; /* cnodes */
+ unsigned short __unused5; /* netsite */
+ short st_fstype;
+ unsigned long st_realdev;
+ unsigned short st_basemode;
+ unsigned short st_spareshort;
+ unsigned long st_uid;
+ unsigned long st_gid;
+ unsigned long st_spare4[3];
+};
+
+#define _HAVE_STAT_NSEC
+#define _HAVE_STAT64_NSEC
diff --git a/sysdeps/unix/sysv/linux/hppa/mmap.c b/sysdeps/unix/sysv/linux/hppa/mmap.c
new file mode 100644
index 0000000000..6f4bfdce2a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/mmap.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+/* Map addresses starting near ADDR and extending for LEN bytes. From
+ OFFSET into the file FD describes according to PROT and FLAGS. If ADDR
+ is nonzero, it is the desired mapping address. If the MAP_FIXED bit is
+ set in FLAGS, the mapping will be at ADDR exactly (which must be
+ page-aligned); otherwise the system chooses a convenient nearby address.
+ The return value is the actual mapping address chosen or MAP_FAILED
+ for errors (in which case `errno' is set). A successful `mmap' call
+ deallocates any previous mapping for the affected region. */
+
+#include <sysdep.h>
+
+__ptr_t
+__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
+{
+
+ __ptr_t ret;
+
+ ret = INLINE_SYSCALL(mmap, 6, addr, len, prot, flags, fd, offset);
+
+ /* check if it's really a negative number */
+ if(((unsigned long)ret & 0xfffff000) == 0xfffff000)
+ return MAP_FAILED;
+
+ return ret;
+
+}
+
+strong_alias (__mmap, mmap)
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
index 22fc64109c..b108be8a36 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
+++ b/sysdeps/unix/sysv/linux/hppa/profil-counter.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999, 2006 Free Software Foundation, Inc.
+/* Machine-dependent SIGPROF signal handler. PA-RISC version
+ Copyright (C) 1996, 1997, 2000 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
@@ -16,15 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define __WORDSIZE 64
-
-#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
-/* Signal that we didn't used to have a `long double'. The changes all
- the `long double' function variants to be redirects to the double
- functions. */
-# define __LONG_DOUBLE_MATH_OPTIONAL 1
-# ifndef __LONG_DOUBLE_128__
-# define __NO_LONG_DOUBLE_MATH 1
-# endif
-#endif
+static void
+profil_counter (int signr, siginfo_t *si, struct ucontext *uctx)
+{
+ unsigned long ip = uctx->uc_mcontext.sc_iaoq[0] & ~0x3;
+ profil_count ((void *) ip);
+}
diff --git a/sysdeps/unix/sysv/linux/hppa/socket.S b/sysdeps/unix/sysv/linux/hppa/socket.S
new file mode 100644
index 0000000000..dfbb721a82
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/socket.S
@@ -0,0 +1,10 @@
+#include <sysdep.h>
+
+ .globl __socket
+PSEUDO(__socket, socket, 3)
+
+PSEUDO_END(__socket)
+
+#ifndef NO_WEAK_ALIAS
+weak_alias (__socket, socket)
+#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/procfs.h b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
new file mode 100644
index 0000000000..2e6d10956d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sys/procfs.h
@@ -0,0 +1,113 @@
+/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. It doesn't have anything to do with the /proc file
+ system, even though Linux has one.
+
+ Anyway, the whole purpose of this file is for GDB and GDB only.
+ Don't read too much into it. Don't use it for anything other than
+ GDB unless you know what you are doing. */
+
+#include <features.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#include <sys/user.h>
+#include <asm/elf.h>
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_code; /* Extra code. */
+ int si_errno; /* Errno. */
+ };
+
+/* Definitions to generate Intel SVR4-like core files. These mostly
+ have the same names as the SVR4 types with "elf_" tacked on the
+ front to prevent clashes with Linux definitions, and the typedef
+ forms have been avoided. This is mostly like the SVR4 structure,
+ but more Linuxy, with things that Linux does not support and which
+ GDB doesn't really use excluded. */
+
+struct elf_prstatus
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ unsigned long int pr_sigpend; /* Set of pending signals. */
+ unsigned long int pr_sighold; /* Set of held signals. */
+ __pid_t pr_pid;
+ __pid_t pr_ppid;
+ __pid_t pr_pgrp;
+ __pid_t pr_sid;
+ struct timeval pr_utime; /* User time. */
+ struct timeval pr_stime; /* System time. */
+ struct timeval pr_cutime; /* Cumulative user time. */
+ struct timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+
+#define ELF_PRARGSZ (80) /* Number of chars for args. */
+
+struct elf_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long int pr_flag; /* Flags. */
+ unsigned int pr_uid;
+ unsigned int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
+
+
+/* The rest of this file provides the types for emulation of the
+ Solaris <proc_service.h> interfaces that should be implemented by
+ users of libthread_db. */
+
+/* Addresses. */
+typedef void *psaddr_t;
+
+/* Register sets. Linux has different names. */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+ therefore have only one PID type. */
+typedef __pid_t lwpid_t;
+
+/* Process status and info. In the end we do provide typedefs for them. */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif /* sys/procfs.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
new file mode 100644
index 0000000000..1431143849
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Don't rely on this, the interface is currently messed up and may need to
+ be broken to be fixed. */
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+
+/* Type for general register. */
+typedef unsigned long int greg_t;
+
+/* Number of general registers. */
+#define NGREG 80
+#define NFPREG 32
+
+/* Container for all general registers. */
+typedef struct gregset
+ {
+ greg_t g_regs[32];
+ greg_t sr_regs[8];
+ greg_t cr_regs[24];
+ greg_t g_pad[16];
+ } gregset_t;
+
+/* Container for all FPU registers. */
+typedef struct fpregset
+ {
+ double fp_dregs[32];
+ } fpregset_t;
+
+/* Context to describe whole processor state. */
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/hppa/syscall.S b/sysdeps/unix/sysv/linux/hppa/syscall.S
new file mode 100644
index 0000000000..b333487c99
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/syscall.S
@@ -0,0 +1,19 @@
+/* Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* HPPA implements syscall() in 'C'; see sysdep.c. */
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
new file mode 100644
index 0000000000..0f7537c306
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -0,0 +1,37 @@
+# File name Caller Syscall name # args Strong name Weak names
+
+# semaphore and shm system calls
+msgctl - msgctl i:iip __msgctl msgctl
+msgget - msgget i:ii __msgget msgget
+msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
+msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
+shmat - shmat i:ipi __shmat shmat
+shmctl - shmctl i:iip __shmctl shmctl
+shmdt - shmdt i:s __shmdt shmdt
+shmget - shmget i:iii __shmget shmget
+semop - semop i:ipi __semop semop
+semtimedop - semtimedop i:ipip semtimedop
+semget - semget i:iii __semget semget
+semctl - semctl i:iiii __semctl semctl
+
+# proper socket implementations:
+accept - accept Ci:iBN __libc_accept __accept accept
+bind - bind i:ipi __bind bind
+connect - connect Ci:ipi __libc_connect __connect_internal __connect connect
+getpeername - getpeername i:ipp __getpeername getpeername
+getsockname - getsockname i:ipp __getsockname getsockname
+getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
+listen - listen i:ii __listen listen
+recv - recv Ci:ibni __libc_recv __recv recv
+recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
+recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg
+send - send Ci:ibni __libc_send __send send
+sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg
+sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
+setsockopt - setsockopt i:iiibn __setsockopt setsockopt
+shutdown - shutdown i:ii __shutdown shutdown
+socket - socket i:iii __socket socket
+socketpair - socketpair i:iiif __socketpair socketpair
+
+setrlimit - setrlimit i:ip __setrlimit setrlimit
+getrlimit - getrlimit i:ip __getrlimit getrlimit
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/sysdep.c
new file mode 100644
index 0000000000..192efbaf75
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 1997, 1998, 2001, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+#include <errno.h>
+
+extern int __syscall_error(int err_no);
+extern int syscall (int sysnum, int arg0, int arg1, int arg2,
+ int arg3, int arg4, int arg5);
+
+/* This routine is jumped to by all the syscall handlers, to stash
+ an error number into errno. */
+int
+__syscall_error (int err_no)
+{
+ __set_errno (err_no);
+ return -1;
+}
+
+
+/* HPPA implements syscall() in 'C'; the assembler version would
+ typically be in syscall.S. Also note that we have INLINE_SYSCALL,
+ INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers.
+ How often the function is used is unknown. */
+int
+syscall (int sysnum, int arg0, int arg1, int arg2, int arg3, int arg4,
+ int arg5)
+{
+ /* FIXME: Keep this matching INLINE_SYSCALL for hppa */
+ long int __sys_res;
+ {
+ register unsigned long int __res asm("r28");
+ LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5)
+ asm volatile (STW_ASM_PIC
+ " ble 0x100(%%sr2, %%r0) \n"
+ " copy %1, %%r20 \n"
+ LDW_ASM_PIC
+ : "=r" (__res)
+ : "r" (sysnum) ASM_ARGS_6
+ : CALL_CLOB_REGS CLOB_ARGS_6);
+ __sys_res = __res;
+ }
+ if ((unsigned long int) __sys_res >= (unsigned long int) -4095)
+ {
+ __set_errno (-__sys_res);
+ __sys_res = -1;
+ }
+ return __sys_res;
+}
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h
new file mode 100644
index 0000000000..4cfe63c556
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -0,0 +1,419 @@
+/* Assembler macros for PA-RISC.
+ Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
+ Linux/PA-RISC changes by Philipp Rumpf, <prumpf@tux.org>, March 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <asm/unistd.h>
+#include <sysdeps/generic/sysdep.h>
+#include <sys/syscall.h>
+#include "config.h"
+
+#ifndef ASM_LINE_SEP
+# define ASM_LINE_SEP ;
+#endif
+
+#undef SYS_ify
+#define SYS_ify(syscall_name) (__NR_##syscall_name)
+
+#ifdef PIC
+/* WARNING: CANNOT BE USED IN A NOP! */
+# define STW_PIC stw %r19, -32(%sr0, %sp) ASM_LINE_SEP
+# define LDW_PIC ldw -32(%sr0, %sp), %r19 ASM_LINE_SEP
+# define STW_ASM_PIC " copy %%r19, %%r4\n"
+# define LDW_ASM_PIC " copy %%r4, %%r19\n"
+# define USING_GR4 "%r4",
+#else
+# define STW_PIC ASM_LINE_SEP
+# define LDW_PIC ASM_LINE_SEP
+# define STW_ASM_PIC " \n"
+# define LDW_ASM_PIC " \n"
+# define USING_GR4
+#endif
+
+#ifdef __ASSEMBLER__
+
+/* Syntactic details of assembler. */
+
+#define ALIGNARG(log2) log2
+
+/* For Linux we can use the system call table in the header file
+ /usr/include/asm/unistd.h
+ of the kernel. But these symbols do not follow the SYS_* syntax
+ so we have to redefine the `SYS_ify' macro here. */
+#undef SYS_ify
+#define SYS_ify(syscall_name) __NR_##syscall_name
+
+/* ELF-like local names start with `.L'. */
+#undef L
+#define L(name) .L##name
+
+/* Linux uses a negative return value to indicate syscall errors,
+ unlike most Unices, which use the condition codes' carry flag.
+
+ Since version 2.1 the return value of a system call might be
+ negative even if the call succeeded. E.g., the `lseek' system call
+ might return a large offset. Therefore we must not anymore test
+ for < 0, but test for a real error by making sure the value in %eax
+ is a real error number. Linus said he will make sure the no syscall
+ returns a value in -1 .. -4095 as a valid result so we can safely
+ test with -4095. */
+
+/* We don't want the label for the error handle to be global when we define
+ it here. */
+#ifdef PIC
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
+/* Define an entry point visible from C.
+
+ There is currently a bug in gdb which prevents us from specifying
+ incomplete stabs information. Fake some entries here which specify
+ the current source file. */
+#define ENTRY(name) \
+ .text ASM_LINE_SEP \
+ .export C_SYMBOL_NAME(name) ASM_LINE_SEP \
+ .type C_SYMBOL_NAME(name),@function ASM_LINE_SEP \
+ C_LABEL(name) ASM_LINE_SEP \
+ CALL_MCOUNT ASM_LINE_SEP
+
+#undef END
+#define END(name) \
+1: ASM_LINE_SEP \
+.size C_SYMBOL_NAME(name),1b-C_SYMBOL_NAME(name) ASM_LINE_SEP
+
+/* If compiled for profiling, call `mcount' at the start of each function. */
+/* No, don't bother. gcc will put the call in for us. */
+#define CALL_MCOUNT /* Do nothing. */
+
+/* syscall wrappers consist of
+ #include <sysdep.h>
+ PSEUDO(...)
+ ret
+ PSEUDO_END(...)
+
+ which means
+ ENTRY(name)
+ DO_CALL(...)
+ nop
+ bv 0(2)
+ nop
+*/
+
+#define PSEUDO(name, syscall_name, args) \
+ ENTRY (name) \
+ DO_CALL(syscall_name, args) ASM_LINE_SEP \
+ nop ASM_LINE_SEP
+
+#define ret \
+ /* Return value set by ERRNO code */ ASM_LINE_SEP \
+ bv 0(2) ASM_LINE_SEP \
+ nop ASM_LINE_SEP
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) \
+ END (name)
+
+/* We don't set the errno on the return from the syscall */
+#define PSEUDO_NOERRNO(name, syscall_name, args) \
+ ENTRY (name) \
+ DO_CALL_NOERRNO(syscall_name, args) ASM_LINE_SEP \
+ nop ASM_LINE_SEP
+
+#define ret_NOERRNO ret
+
+#undef PSEUDO_END_NOERRNO
+#define PSEUDO_END_NOERRNO(name) \
+ END (name)
+
+/* This has to return the error value */
+#undef PSEUDO_ERRVAL
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ ENTRY(name) \
+ DO_CALL_ERRVAL(syscall_name, args) ASM_LINE_SEP \
+ nop ASM_LINE_SEP
+
+#define ret_ERRVAL ret
+
+#undef PSEUDO_END_ERRVAL
+#define PSEUDO_END_ERRVAL(name) \
+ END(name)
+
+#undef JUMPTARGET
+#define JUMPTARGET(name) name
+#define SYSCALL_PIC_SETUP /* Nothing. */
+
+
+/* All the syscall assembly macros rely on finding the approriate
+ SYSCALL_ERROR_LABEL or rather HANDLER. */
+
+/* int * __errno_location(void) so you have to store your value
+ into the return address! */
+#define DEFAULT_SYSCALL_ERROR_HANDLER \
+ .import __errno_location,code ASM_LINE_SEP \
+ /* branch to errno handler */ ASM_LINE_SEP \
+ bl __errno_location,%rp ASM_LINE_SEP
+
+/* Here are the myriad of configuration options that the above can
+ work for... what we've done is provide the framework for future
+ changes if required to each section */
+
+#ifdef PIC
+# if RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER
+# else /* !RTLD_PRIVATE_ERRNO */
+# if defined _LIBC_REENTRANT
+# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER
+# else /* !_LIBC_REENTRANT */
+# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER
+# endif /* _LIBC_REENTRANT */
+# endif /* RTLD_PRIVATE_ERRNO */
+#else
+# ifndef _LIBC_REENTRANT
+# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER
+# else
+# define SYSCALL_ERROR_HANDLER DEFAULT_SYSCALL_ERROR_HANDLER
+# endif
+#endif
+
+
+/* Linux takes system call arguments in registers:
+ syscall number gr20
+ arg 1 gr26
+ arg 2 gr25
+ arg 3 gr24
+ arg 4 gr23
+ arg 5 gr22
+ arg 6 gr21
+
+ The compiler calls us by the C convention:
+ syscall number in the DO_CALL macro
+ arg 1 gr26
+ arg 2 gr25
+ arg 3 gr24
+ arg 4 gr23
+ arg 5 -52(gr30)
+ arg 6 -56(gr30)
+
+ gr22 and gr21 are caller-saves, so we can just load the arguments
+ there and generally be happy. */
+
+/* the cmpb...no_error code below inside DO_CALL
+ * is intended to mimic the if (__sys_res...)
+ * code inside INLINE_SYSCALL
+ */
+
+#undef DO_CALL
+#define DO_CALL(syscall_name, args) \
+ DOARGS_##args ASM_LINE_SEP \
+ STW_PIC ASM_LINE_SEP \
+ /* Do syscall, delay loads # */ ASM_LINE_SEP \
+ ble 0x100(%sr2,%r0) ASM_LINE_SEP \
+ ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \
+ ldi -0x1000,%r1 ASM_LINE_SEP \
+ cmpb,>>=,n %r1,%ret0,0f ASM_LINE_SEP \
+ /* save rp or we get lost */ ASM_LINE_SEP \
+ stw %rp, -20(%sr0,%sp) ASM_LINE_SEP \
+ /* Restore r19 from frame */ ASM_LINE_SEP \
+ LDW_PIC ASM_LINE_SEP \
+ stw %ret0, -24(%sr0,%sp) ASM_LINE_SEP \
+ SYSCALL_ERROR_HANDLER ASM_LINE_SEP \
+ /* create frame */ ASM_LINE_SEP \
+ ldo 64(%sp), %sp ASM_LINE_SEP \
+ ldo -64(%sp), %sp ASM_LINE_SEP \
+ /* OPTIMIZE: Don't reload r19 */ ASM_LINE_SEP \
+ /* do a -1*syscall_ret0 */ ASM_LINE_SEP \
+ ldw -24(%sr0,%sp), %r26 ASM_LINE_SEP \
+ sub %r0, %r26, %r26 ASM_LINE_SEP \
+ /* Store into errno location */ ASM_LINE_SEP \
+ stw %r26, 0(%sr0,%ret0) ASM_LINE_SEP \
+ /* return -1 as error */ ASM_LINE_SEP \
+ ldo -1(%r0), %ret0 ASM_LINE_SEP \
+ ldw -20(%sr0,%sp), %rp ASM_LINE_SEP \
+0: ASM_LINE_SEP \
+ UNDOARGS_##args ASM_LINE_SEP
+
+/* We do nothing with the return, except hand it back to someone else */
+#undef DO_CALL_NOERRNO
+#define DO_CALL_NOERRNO(syscall_name, args) \
+ DOARGS_##args \
+ /* No need to store r19 */ ASM_LINE_SEP \
+ ble 0x100(%sr2,%r0) ASM_LINE_SEP \
+ ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \
+ /* Caller will restore r19 */ ASM_LINE_SEP \
+ UNDOARGS_##args
+
+/* Here, we return the ERRVAL in assembly, note we don't call the
+ error handler function, but we do 'negate' the return _IF_
+ it's an error. Not sure if this is the right semantic. */
+
+#undef DO_CALL_ERRVAL
+#define DO_CALL_ERRVAL(syscall_name, args) \
+ DOARGS_##args ASM_LINE_SEP \
+ /* No need to store r19 */ ASM_LINE_SEP \
+ ble 0x100(%sr2,%r0) ASM_LINE_SEP \
+ ldi SYS_ify (syscall_name), %r20 ASM_LINE_SEP \
+ /* Caller will restore r19 */ ASM_LINE_SEP \
+ ldi -0x1000,%r1 ASM_LINE_SEP \
+ cmpb,>>=,n %r1,%ret0,0f ASM_LINE_SEP \
+ sub %r0, %ret0, %ret0 ASM_LINE_SEP \
+0: ASM_LINE_SEP \
+ UNDOARGS_##args ASM_LINE_SEP
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 /* nothing */
+#define DOARGS_5 ldw -52(%r30), %r22 ASM_LINE_SEP
+#define DOARGS_6 ldw -52(%r30), %r22 ASM_LINE_SEP \
+ ldw -56(%r30), %r21 ASM_LINE_SEP
+
+
+#define UNDOARGS_0 /* nothing */
+#define UNDOARGS_1 /* nothing */
+#define UNDOARGS_2 /* nothing */
+#define UNDOARGS_3 /* nothing */
+#define UNDOARGS_4 /* nothing */
+#define UNDOARGS_5 /* nothing */
+#define UNDOARGS_6 /* nothing */
+
+#else
+
+/* GCC has to be warned that a syscall may clobber all the ABI
+ registers listed as "caller-saves", see page 8, Table 2
+ in section 2.2.6 of the PA-RISC RUN-TIME architecture
+ document. However! r28 is the result and will conflict with
+ the clobber list so it is left out. Also the input arguments
+ registers r20 -> r26 will conflict with the list so they
+ are treated specially. Although r19 is clobbered by the syscall
+ we cannot say this because it would violate ABI, thus we say
+ r4 is clobbered and use that register to save/restore r19
+ across the syscall. */
+
+#define CALL_CLOB_REGS "%r1", "%r2", USING_GR4 \
+ "%r20", "%r29", "%r31"
+
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...) ({ \
+ long __sys_res; \
+ { \
+ register unsigned long __res asm("r28"); \
+ LOAD_ARGS_##nr(args) \
+ /* FIXME: HACK stw/ldw r19 around syscall */ \
+ asm volatile( \
+ STW_ASM_PIC \
+ " ble 0x100(%%sr2, %%r0)\n" \
+ " ldi %1, %%r20\n" \
+ LDW_ASM_PIC \
+ : "=r" (__res) \
+ : "i" (SYS_ify(name)) ASM_ARGS_##nr \
+ : CALL_CLOB_REGS CLOB_ARGS_##nr \
+ ); \
+ __sys_res = (long)__res; \
+ } \
+ if ( (unsigned long)__sys_res >= (unsigned long)-4095 ){ \
+ __set_errno(-__sys_res); \
+ __sys_res = -1; \
+ } \
+ __sys_res; \
+})
+
+/* INTERNAL_SYSCALL_DECL - Allows us to setup some function static
+ value to use within the context of the syscall
+ INTERNAL_SYSCALL_ERROR_P - Returns 0 if it wasn't an error, 1 otherwise
+ You are allowed to use the syscall result (val) and the DECL error variable
+ to determine what went wrong.
+ INTERLAL_SYSCALL_ERRNO - Munges the val/err pair into the error number.
+ In our case we just flip the sign. */
+
+#undef INTERNAL_SYSCALL_DECL
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+/* Equivalent to (val < 0)&&(val > -4095) which is what we want */
+#undef INTERNAL_SYSCALL_ERROR_P
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+ ((unsigned long)val >= (unsigned long)-4095)
+
+#undef INTERNAL_SYSCALL_ERRNO
+#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
+/* Similar to INLINE_SYSCALL but we don't set errno */
+#undef INTERNAL_SYSCALL
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+({ \
+ long __sys_res; \
+ { \
+ register unsigned long __res asm("r28"); \
+ LOAD_ARGS_##nr(args) \
+ /* FIXME: HACK stw/ldw r19 around syscall */ \
+ asm volatile( \
+ STW_ASM_PIC \
+ " ble 0x100(%%sr2, %%r0)\n" \
+ " ldi %1, %%r20\n" \
+ LDW_ASM_PIC \
+ : "=r" (__res) \
+ : "i" (SYS_ify(name)) ASM_ARGS_##nr \
+ : CALL_CLOB_REGS CLOB_ARGS_##nr \
+ ); \
+ __sys_res = (long)__res; \
+ } \
+ __sys_res; \
+ })
+
+#define LOAD_ARGS_0()
+#define LOAD_ARGS_1(r26) \
+ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
+ LOAD_ARGS_0()
+#define LOAD_ARGS_2(r26,r25) \
+ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
+ LOAD_ARGS_1(r26)
+#define LOAD_ARGS_3(r26,r25,r24) \
+ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
+ LOAD_ARGS_2(r26,r25)
+#define LOAD_ARGS_4(r26,r25,r24,r23) \
+ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
+ LOAD_ARGS_3(r26,r25,r24)
+#define LOAD_ARGS_5(r26,r25,r24,r23,r22) \
+ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
+ LOAD_ARGS_4(r26,r25,r24,r23)
+#define LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
+ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
+ LOAD_ARGS_5(r26,r25,r24,r23,r22)
+
+/* Even with zero args we use r20 for the syscall number */
+#define ASM_ARGS_0
+#define ASM_ARGS_1 ASM_ARGS_0, "r" (__r26)
+#define ASM_ARGS_2 ASM_ARGS_1, "r" (__r25)
+#define ASM_ARGS_3 ASM_ARGS_2, "r" (__r24)
+#define ASM_ARGS_4 ASM_ARGS_3, "r" (__r23)
+#define ASM_ARGS_5 ASM_ARGS_4, "r" (__r22)
+#define ASM_ARGS_6 ASM_ARGS_5, "r" (__r21)
+
+/* The registers not listed as inputs but clobbered */
+#define CLOB_ARGS_6
+#define CLOB_ARGS_5 CLOB_ARGS_6, "%r21"
+#define CLOB_ARGS_4 CLOB_ARGS_5, "%r22"
+#define CLOB_ARGS_3 CLOB_ARGS_4, "%r23"
+#define CLOB_ARGS_2 CLOB_ARGS_3, "%r24"
+#define CLOB_ARGS_1 CLOB_ARGS_2, "%r25"
+#define CLOB_ARGS_0 CLOB_ARGS_1, "%r26"
+
+#endif /* __ASSEMBLER__ */
diff --git a/sysdeps/unix/sysv/linux/hppa/umount.c b/sysdeps/unix/sysv/linux/hppa/umount.c
new file mode 100644
index 0000000000..e7c5690890
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/umount.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Since we don't have an oldumount system call, do what the kernel
+ does down here. */
+
+extern long int __umount2 (const char *name, int flags);
+
+long int
+__umount (const char *name)
+{
+ return __umount2 (name, 0);
+}
+
+weak_alias (__umount, umount);
diff --git a/sysdeps/unix/sysv/linux/i386/Dist b/sysdeps/unix/sysv/linux/i386/Dist
new file mode 100644
index 0000000000..70253ac9e8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/Dist
@@ -0,0 +1,17 @@
+bp-thunks.h
+clone.S
+olddirent.h
+oldgetrlimit64.c
+setresuid.c
+setresgid.c
+setfsuid.c
+setfsgid.c
+sys/debugreg.h
+sys/elf.h
+sys/io.h
+sys/perm.h
+sys/procfs.h
+sys/reg.h
+sys/user.h
+sys/vm86.h
+ucontext_i.h
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 9e84975635..1ae69407ff 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,5 +1,5 @@
ifeq ($(subdir),misc)
-sysdep_routines += ioperm iopl vm86 call_pselect6
+sysdep_routines += ioperm iopl vm86
sysdep_headers += sys/elf.h sys/perm.h sys/reg.h sys/vm86.h sys/debugreg.h sys/io.h
endif
@@ -12,7 +12,3 @@ endif
ifeq ($(subdir),resource)
sysdep_routines += oldgetrlimit64
endif
-
-ifeq ($(subdir),stdlib)
-gen-as-const-headers += ucontext_i.sym
-endif
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index 6de33302ee..9065825b98 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -22,11 +22,8 @@
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
-#include <sys/types.h>
-#ifdef __USE_GNU
-# include <bits/uio.h>
-#endif
+#include <sys/types.h>
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
@@ -99,7 +96,7 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
#endif
-/* For F_[GET|SET]FD. */
+/* For F_[GET|SET]FL. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -183,55 +180,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
-
-#ifdef __USE_GNU
-/* Flags for SYNC_FILE_RANGE. */
-# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
- in the range before performing the
- write. */
-# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
- dirty pages in the range which are
- not presently under writeback. */
-# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
- the range after performing the
- write. */
-
-/* Flags for SPLICE and VMSPLICE. */
-# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
-# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
- (but we may still block on the fd
- we splice from/to). */
-# define SPLICE_F_MORE 4 /* Expect more data. */
-# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
-#endif
-
__BEGIN_DECLS
-#ifdef __USE_GNU
-
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
-
-/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
- unsigned int __flags);
-
-
-/* Splice address range into a pipe. */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
-
-/* Splice two files together. */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
- __off64_t *__offout, size_t __len, unsigned int __flags)
- __THROW;
-
-/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-
-#endif
-
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h
index 00cb982395..1477aa54e2 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/i386 version.
- Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003 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
@@ -78,7 +78,6 @@
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
#endif
/* Advice to `madvise'. */
@@ -88,9 +87,6 @@
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define MADV_WILLNEED 3 /* Will need these pages. */
# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/i386/call_pselect6.S b/sysdeps/unix/sysv/linux/i386/call_pselect6.S
deleted file mode 100644
index a356f1dfa9..0000000000
--- a/sysdeps/unix/sysv/linux/i386/call_pselect6.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2006.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-
-#ifdef __NR_pselect6
- .text
-ENTRY(__call_pselect6)
- .hidden __call_pselect6
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- pushl %esi
- cfi_adjust_cfa_offset (4)
- pushl %edi
- cfi_adjust_cfa_offset (4)
- pushl %ebp
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebp, 0)
- cfi_rel_offset (edi, 4)
- cfi_rel_offset (esi, 8)
- cfi_rel_offset (ebx, 12)
-
- movl $__NR_pselect6, %eax
- movl 20(%esp), %ebx
- movl 24(%esp), %ecx
- movl 28(%esp), %edx
- movl 32(%esp), %esi
- movl 36(%esp), %edi
- movl 40(%esp), %ebp
-
- /* The syscall handling cannot handle 6 parameters. Yet. */
- int $0x80
-
- popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
- popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
- popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-
- ret
-END(__call_pselect6)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/chown.c b/sysdeps/unix/sysv/linux/i386/chown.c
index fc6a9c95a1..31a6e0f08a 100644
--- a/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/sysdeps/unix/sysv/linux/i386/chown.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2002,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2002,2003,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
@@ -26,7 +25,7 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
/*
In Linux 2.1.x the chown functions have been changed. A new function lchown
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S
index 54524ec120..c7d31f7a32 100644
--- a/sysdeps/unix/sysv/linux/i386/clone.S
+++ b/sysdeps/unix/sysv/linux/i386/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000,02,03,04,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,98,99,2000,02,03,04 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@tamu.edu)
@@ -83,19 +83,12 @@ ENTRY (BP_SYM (__clone))
/* Do the system call */
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %esi
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
-
movl TLS+12(%esp),%esi
- cfi_rel_offset (esi, 4)
movl PTID+12(%esp),%edx
movl FLAGS+12(%esp),%ebx
- cfi_rel_offset (ebx, 8)
movl CTID+12(%esp),%edi
- cfi_rel_offset (edi, 0)
movl $SYS_ify(clone),%eax
#ifdef RESET_PID
@@ -103,10 +96,6 @@ ENTRY (BP_SYM (__clone))
movl %ebx, (%ecx)
#endif
- /* End FDE now, because in the child the unwind info will be
- wrong. */
- cfi_endproc
-
int $0x80
popl %edi
popl %esi
@@ -136,7 +125,7 @@ L(here):
#endif
movl %eax, %ebx
movl $SYS_ify(exit), %eax
- ENTER_KERNEL
+ int $0x80
#ifdef RESET_PID
.subsection 2
@@ -153,7 +142,6 @@ L(nomoregetpid):
.previous
#endif
- cfi_startproc
PSEUDO_END (BP_SYM (__clone))
weak_alias (BP_SYM (__clone), BP_SYM (clone))
diff --git a/sysdeps/unix/sysv/linux/i386/dl-cache.h b/sysdeps/unix/sysv/linux/i386/dl-cache.h
deleted file mode 100644
index 38a1c7dfb4..0000000000
--- a/sysdeps/unix/sysv/linux/i386/dl-cache.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- Copyright (C) 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-static inline int
-is_ia64 (void)
-{
- unsigned int fl1, fl2;
-
- /* See if we can use cpuid. */
- __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
- "pushl %0; popfl; pushfl; popl %0; popfl"
- : "=&r" (fl1), "=&r" (fl2)
- : "i" (0x00200000));
- if (((fl1 ^ fl2) & 0x00200000) == 0)
- return 0;
-
- /* Host supports cpuid. See if cpuid gives capabilities, try
- CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we
- don't need their CPUID values here, and %ebx may be the PIC
- register. */
- __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
- : "=a" (fl1) : "0" (0) : "edx", "cc");
- if (fl1 == 0)
- return 0;
-
- /* Invoke CPUID(1), return %edx; caller can examine bits to
- determine what's supported. */
- __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
- : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc");
- return (fl2 & (1 << 30)) != 0;
-}
-
-#define arch_startup(argc, argv) \
- do { \
- /* On IA-64, try to execute 64-bit ldconfig if possible. \
- This is because the badly designed /emul/ia32-linux hack \
- will cause 32-bit ldconfig to do all sorts of weird things. */ \
- if (is_ia64 ()) \
- execv ("/emul/ia32-linux/../../sbin/ldconfig", \
- (char *const *) argv); \
- } while (0)
-
-#include_next <dl-cache.h>
diff --git a/sysdeps/unix/sysv/linux/i386/fchown.c b/sysdeps/unix/sysv/linux/i386/fchown.c
index 30299c9609..1f2e389844 100644
--- a/sysdeps/unix/sysv/linux/i386/fchown.c
+++ b/sysdeps/unix/sysv/linux/i386/fchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -23,7 +23,7 @@
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_fchown32
# if __ASSUME_32BITUIDS == 0
diff --git a/sysdeps/unix/sysv/linux/i386/fchownat.c b/sysdeps/unix/sysv/linux/i386/fchownat.c
deleted file mode 100644
index 34acf10c27..0000000000
--- a/sysdeps/unix/sysv/linux/i386/fchownat.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <shlib-compat.h>
-#include <bp-checks.h>
-
-#include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-int
-fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
-{
- int result;
-
-#ifdef __NR_fchownat
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INLINE_SYSCALL (fchownat, 5, fd, file, owner, group, flag);
-# ifndef __ASSUME_ATFCTS
- if (result == -1 && errno == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- return result;
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- if (flag & ~AT_SYMLINK_NOFOLLOW)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
-# if __ASSUME_32BITUIDS > 0
- /* This implies __ASSUME_LCHOWN_SYSCALL. */
- INTERNAL_SYSCALL_DECL (err);
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lchown32, err, 3, CHECK_STRING (file), owner,
- group);
- else
- result = INTERNAL_SYSCALL (chown32, err, 3, CHECK_STRING (file), owner,
- group);
-
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- return -1;
- }
-# else
- /* Don't inline the rest to avoid unnecessary code duplication. */
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = __lchown (file, owner, group);
- else
- result = __chown (file, owner, group);
- if (result < 0)
- __atfct_seterrno (errno, fd, buf);
-# endif
-
- return result;
-
-#endif
-}
diff --git a/sysdeps/unix/sysv/linux/i386/fcntl.c b/sysdeps/unix/sysv/linux/i386/fcntl.c
index b27373d24b..210faba2a7 100644
--- a/sysdeps/unix/sysv/linux/i386/fcntl.c
+++ b/sysdeps/unix/sysv/linux/i386/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 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
@@ -23,7 +23,7 @@
#include <stdarg.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "../kernel-features.h"
#if __ASSUME_FCNTL64 == 0
/* This variable is shared with all files that check for fcntl64. */
diff --git a/sysdeps/unix/sysv/linux/i386/fxstat.c b/sysdeps/unix/sysv/linux/i386/fxstat.c
index 281839f964..40787b99e7 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -1,6 +1,5 @@
/* fxstat using old-style Unix fstat system call.
- Copyright (C) 1991,1995-1998,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991,1995-1998,2000,2002,2003 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
@@ -31,7 +30,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <xstatconv.h>
diff --git a/sysdeps/unix/sysv/linux/i386/fxstatat.c b/sysdeps/unix/sysv/linux/i386/fxstatat.c
deleted file mode 100644
index 94f6e81186..0000000000
--- a/sysdeps/unix/sysv/linux/i386/fxstatat.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Ho hum, if fxstatat == fxstatat64 we must get rid of the prototype or gcc
- will complain since they don't strictly match. */
-#define __fxstatat64 __fxstatat64_disable
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <kernel_stat.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-#include <bp-checks.h>
-
-#include <kernel-features.h>
-
-#include <xstatconv.h>
-
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls. */
-extern int __have_no_stat64;
-# endif
-#endif
-
-
-/* Get information about the file NAME relative to FD in ST. */
-int
-__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
-{
- int result;
- INTERNAL_SYSCALL_DECL (err);
- struct stat64 st64;
-
-#ifdef __NR_fstatat64
-# ifndef __ASSUME_ATFCTS
- if (__have_atfcts >= 0)
-# endif
- {
- result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, &st64, flag);
-# ifndef __ASSUME_ATFCTS
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)
- && INTERNAL_SYSCALL_ERRNO (result, err) == ENOSYS)
- __have_atfcts = -1;
- else
-# endif
- if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat32_conv (vers, &st64, st);
- else
- {
- __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
- return -1;
- }
- }
-#endif
-
-#ifndef __ASSUME_ATFCTS
- if (__builtin_expect (flag & ~AT_SYMLINK_NOFOLLOW, 0))
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- char *buf = NULL;
-
- if (fd != AT_FDCWD && file[0] != '/')
- {
- size_t filelen = strlen (file);
- static const char procfd[] = "/proc/self/fd/%d/%s";
- /* Buffer for the path name we are going to use. It consists of
- - the string /proc/self/fd/
- - the file descriptor number
- - the file name provided.
- The final NUL is included in the sizeof. A bit of overhead
- due to the format elements compensates for possible negative
- numbers. */
- size_t buflen = sizeof (procfd) + sizeof (int) * 3 + filelen;
- buf = alloca (buflen);
-
- __snprintf (buf, buflen, procfd, fd, file);
- file = buf;
- }
-
-# if __ASSUME_STAT64_SYSCALL == 0
- struct kernel_stat kst;
-# endif
- if (vers == _STAT_VER_KERNEL)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- CHECK_1 ((struct kernel_stat *) st));
- goto out;
- }
-
-# if __ASSUME_STAT64_SYSCALL > 0
-
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat32_conv (vers, &st64, st);
-# else
-# if defined __NR_stat64
- /* To support 32 bit UIDs, we have to use stat64. The normal stat
- call only returns 16 bit UIDs. */
- if (! __have_no_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- result = __xstat32_conv (vers, &st64, st);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- goto out;
-
- __have_no_stat64 = 1;
- }
-# endif
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kst, st);
-# endif /* __ASSUME_STAT64_SYSCALL */
-
- out:
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
- {
- __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
- result = -1;
- }
-
- return result;
-#endif
-}
-libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
-# undef __fxstatat64
-strong_alias (__fxstatat, __fxstatat64);
-libc_hidden_ver (__fxstatat, __fxstatat64)
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/getcontext.S b/sysdeps/unix/sysv/linux/i386/getcontext.S
index fe28f1e0e1..68541d5d80 100644
--- a/sysdeps/unix/sysv/linux/i386/getcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -63,16 +63,12 @@ ENTRY(__getcontext)
/* Save the current signal mask. */
pushl %ebx
- cfi_adjust_cfa_offset (4)
- cfi_rel_offset (ebx, 0)
leal oSIGMASK(%eax), %edx
xorl %ecx, %ecx
movl $SIG_BLOCK, %ebx
movl $__NR_sigprocmask, %eax
ENTER_KERNEL
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
cmpl $-4095, %eax /* Check %eax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
@@ -82,4 +78,4 @@ L(pseudo_end):
ret
PSEUDO_END(__getcontext)
-weak_alias (__getcontext, getcontext)
+weak_alias(__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/i386/getegid.c b/sysdeps/unix/sysv/linux/i386/getegid.c
index 31c10cc32f..c54133b359 100644
--- a/sysdeps/unix/sysv/linux/i386/getegid.c
+++ b/sysdeps/unix/sysv/linux/i386/getegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -21,7 +21,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getegid32
# if __ASSUME_32BITUIDS == 0
diff --git a/sysdeps/unix/sysv/linux/i386/geteuid.c b/sysdeps/unix/sysv/linux/i386/geteuid.c
index 53f52687a4..8d56f6c7f8 100644
--- a/sysdeps/unix/sysv/linux/i386/geteuid.c
+++ b/sysdeps/unix/sysv/linux/i386/geteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -21,7 +21,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_geteuid32
# if __ASSUME_32BITUIDS == 0
diff --git a/sysdeps/unix/sysv/linux/i386/getgid.c b/sysdeps/unix/sysv/linux/i386/getgid.c
index 7a7e38d9c0..0ff63580f6 100644
--- a/sysdeps/unix/sysv/linux/i386/getgid.c
+++ b/sysdeps/unix/sysv/linux/i386/getgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -22,7 +22,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getgid32
# if __ASSUME_32BITUIDS == 0
diff --git a/sysdeps/unix/sysv/linux/i386/getmsg.c b/sysdeps/unix/sysv/linux/i386/getmsg.c
index c0efd56369..e6ca88d136 100644
--- a/sysdeps/unix/sysv/linux/i386/getmsg.c
+++ b/sysdeps/unix/sysv/linux/i386/getmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2003 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
@@ -34,5 +34,5 @@ getmsg (fildes, ctlptr, dataptr, flagsp)
return INLINE_SYSCALL (getpmsg, 5, fildes, ctlptr, dataptr, NULL, flagsp);
}
#else
-# include <streams/getmsg.c>
+# include <sysdeps/generic/getmsg.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/getresgid.c b/sysdeps/unix/sysv/linux/i386/getresgid.c
index 393195619f..8028dec3f9 100644
--- a/sysdeps/unix/sysv/linux/i386/getresgid.c
+++ b/sysdeps/unix/sysv/linux/i386/getresgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003 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
@@ -26,7 +26,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getresgid
@@ -81,5 +81,5 @@ libc_hidden_def (__getresgid)
weak_alias (__getresgid, getresgid)
#else
-# include <posix/getresgid.c>
+# include <sysdeps/generic/getresgid.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/getresuid.c b/sysdeps/unix/sysv/linux/i386/getresuid.c
index ddd25341b2..6b94bbb66c 100644
--- a/sysdeps/unix/sysv/linux/i386/getresuid.c
+++ b/sysdeps/unix/sysv/linux/i386/getresuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003 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
@@ -26,7 +26,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getresuid
@@ -80,5 +80,5 @@ libc_hidden_def (__getresuid)
weak_alias (__getresuid, getresuid)
#else
-# include <posix/getresuid.c>
+# include <sysdeps/generic/getresuid.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/getrlimit.c b/sysdeps/unix/sysv/linux/i386/getrlimit.c
index 59951ac100..38b369bc4f 100644
--- a/sysdeps/unix/sysv/linux/i386/getrlimit.c
+++ b/sysdeps/unix/sysv/linux/i386/getrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2003 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
@@ -24,7 +24,7 @@
#include <shlib-compat.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
extern int __new_getrlimit (enum __rlimit_resource resource,
struct rlimit *__unbounded rlimits);
diff --git a/sysdeps/unix/sysv/linux/i386/getrlimit64.c b/sysdeps/unix/sysv/linux/i386/getrlimit64.c
index 2ff175393c..d6ab86f3e4 100644
--- a/sysdeps/unix/sysv/linux/i386/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/i386/getrlimit64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000 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
@@ -18,7 +18,7 @@
#define getrlimit64 __new_getrlimit64
-#include <resource/getrlimit64.c>
+#include <sysdeps/generic/getrlimit64.c>
#undef getrlimit64
#include <shlib-compat.h>
diff --git a/sysdeps/unix/sysv/linux/i386/getuid.c b/sysdeps/unix/sysv/linux/i386/getuid.c
index d7be0c3cde..3e5c901ec5 100644
--- a/sysdeps/unix/sysv/linux/i386/getuid.c
+++ b/sysdeps/unix/sysv/linux/i386/getuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -22,7 +22,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_getuid32
# if __ASSUME_32BITUIDS == 0
diff --git a/sysdeps/unix/sysv/linux/i386/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
index 18b7f21ae8..d3d1212f05 100644
--- a/sysdeps/unix/sysv/linux/i386/glob64.c
+++ b/sysdeps/unix/sysv/linux/i386/glob64.c
@@ -19,7 +19,7 @@
#define COMPILE_GLOB64 1
-#include <posix/glob.c>
+#include <sysdeps/generic/glob.c>
#include "shlib-compat.h"
@@ -48,7 +48,7 @@ int __old_glob64 (__const char *__pattern, int __flags,
#define GLOB_ONLY_P 1
-#include <posix/glob.c>
+#include <sysdeps/generic/glob.c>
compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/lchown.c b/sysdeps/unix/sysv/linux/i386/lchown.c
index fbba0bf1d1..1b217a9451 100644
--- a/sysdeps/unix/sysv/linux/i386/lchown.c
+++ b/sysdeps/unix/sysv/linux/i386/lchown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -24,7 +24,7 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_lchown
# ifdef __NR_lchown32
@@ -70,5 +70,5 @@ __lchown (const char *file, uid_t owner, gid_t group)
weak_alias (__lchown, lchown)
#else
-# include <io/lchown.c>
+# include <sysdeps/generic/lchown.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/lockf64.c b/sysdeps/unix/sysv/linux/i386/lockf64.c
index 8b568ff4a3..e066cb26e1 100644
--- a/sysdeps/unix/sysv/linux/i386/lockf64.c
+++ b/sysdeps/unix/sysv/linux/i386/lockf64.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1994,1996,1997,1998,1999,2000,2003,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2003
+ 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
@@ -24,7 +24,7 @@
#include <string.h>
#include <sysdep.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
/* lockf is a simplified interface to fcntl's locking facilities. */
diff --git a/sysdeps/unix/sysv/linux/i386/lxstat.c b/sysdeps/unix/sysv/linux/i386/lxstat.c
index 5cc96127b5..65ea0bbed0 100644
--- a/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -1,6 +1,6 @@
/* lxstat using old-style Unix lstat system call.
- Copyright (C) 1991,1995,1996,1997,1998,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991, 1995, 1996, 1997, 1998, 2000, 2002, 2003
+ 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
@@ -31,7 +31,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <xstatconv.h>
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index 12ba4e2d67..ec49b74b9a 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -68,9 +68,7 @@ ENTRY(__makecontext)
below). */
#ifdef PIC
call 1f
- cfi_adjust_cfa_offset (4)
1: popl %ecx
- cfi_adjust_cfa_offset (-4)
addl $L(exitcode)-1b, %ecx
movl %ecx, (%edx)
#else
@@ -85,7 +83,6 @@ ENTRY(__makecontext)
the context 'makecontext' manipulated at the time of the
'makecontext' call. If the pointer is NULL the process must
terminate. */
- cfi_endproc
L(exitcode):
/* This removes the parameters passed to the function given to
'makecontext' from the stack. EBX contains the number of
@@ -111,7 +108,6 @@ L(exitcode):
/* The 'exit' call should never return. In case it does cause
the process to terminate. */
hlt
- cfi_startproc
END(__makecontext)
-weak_alias (__makecontext, makecontext)
+weak_alias(__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S
index a1481feeb5..ebb21f3d32 100644
--- a/sysdeps/unix/sysv/linux/i386/mmap.S
+++ b/sysdeps/unix/sysv/linux/i386/mmap.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,96,97,98,99,2000,2002,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995,96,97,98,99,2000,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
@@ -19,7 +18,7 @@
#include <sysdep.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#define EINVAL 22
@@ -27,30 +26,22 @@
ENTRY (__mmap)
-/* I don't think it is worthwhile trying to use mmap2 whenever it
+/* I don't think it is worthwhile trzing to use mmap2 whenever it
is available. Only use it when we are sure the syscall exists. */
#ifdef __ASSUME_MMAP2_SYSCALL
/* Save registers. */
pushl %ebp
- cfi_adjust_cfa_offset (4)
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %esi
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
movl 20(%esp), %ebx
- cfi_rel_offset (ebx, 8)
movl 24(%esp), %ecx
movl 28(%esp), %edx
movl 32(%esp), %esi
- cfi_rel_offset (esi, 4)
movl 36(%esp), %edi
- cfi_rel_offset (edi, 0)
movl 40(%esp), %ebp
- cfi_rel_offset (ebp, 12)
testl $0xfff, %ebp
movl $-EINVAL, %eax
jne L(skip)
@@ -63,23 +54,14 @@ ENTRY (__mmap)
L(skip):
/* Restore registers. */
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
#else
/* Save registers. */
movl %ebx, %edx
- cfi_register (ebx, edx)
movl $SYS_ify(mmap), %eax /* System call number in %eax. */
@@ -90,7 +72,6 @@ L(skip):
/* Restore registers. */
movl %edx, %ebx
- cfi_restore (ebx)
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/mmap64.S b/sysdeps/unix/sysv/linux/i386/mmap64.S
index f53e6e8c68..3a03335814 100644
--- a/sysdeps/unix/sysv/linux/i386/mmap64.S
+++ b/sysdeps/unix/sysv/linux/i386/mmap64.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,96,97,98,99,2000,2002,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995,96,97,98,99,2000,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
@@ -21,7 +20,7 @@
#include <bp-sym.h>
#include <bp-asm.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#define EINVAL 22
#define ENOSYS 38
@@ -43,13 +42,9 @@ ENTRY (BP_SYM (__mmap64))
/* Save registers. */
pushl %ebp
- cfi_adjust_cfa_offset (4)
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %esi
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
movl OFFLO(%esp), %edx
movl OFFHI(%esp), %ecx
@@ -59,16 +54,12 @@ ENTRY (BP_SYM (__mmap64))
shrl $12, %ecx
jne L(einval)
movl %edx, %ebp
- cfi_rel_offset (ebp, 12)
movl ADDR(%esp), %ebx
- cfi_rel_offset (ebx, 8)
movl LEN(%esp), %ecx
movl PROT(%esp), %edx
movl FLAGS(%esp), %esi
- cfi_rel_offset (esi, 4)
movl FD(%esp), %edi
- cfi_rel_offset (edi, 0)
movl $SYS_ify(mmap2), %eax /* System call number in %eax. */
@@ -78,17 +69,9 @@ L(do_syscall):
/* Restore registers. */
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
#ifndef __ASSUME_MMAP2_SYSCALL
2:
@@ -104,25 +87,12 @@ L(do_syscall):
L(pseudo_end):
ret
- cfi_adjust_cfa_offset (16)
- cfi_rel_offset (ebp, 12)
- cfi_rel_offset (ebx, 8)
- cfi_rel_offset (esi, 4)
- cfi_rel_offset (edi, 0)
/* This means the offset value is too large. */
L(einval):
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
movl $-EINVAL, %eax
jmp SYSCALL_ERROR_LABEL
#endif
@@ -131,7 +101,6 @@ L(einval):
3:
/* Save registers. */
movl %ebx, %edx
- cfi_register (ebx, edx)
cmpl $0, OFFHI-SVRSP(%esp)
jne L(einval2)
@@ -145,7 +114,6 @@ L(einval):
/* Restore registers. */
movl %edx, %ebx
- cfi_restore (ebx)
/* If 0 > %eax > -4096 there was an error. */
cmpl $-4096, %eax
@@ -157,10 +125,8 @@ L(pseudo_end):
#endif
ret
- cfi_register (ebx, edx)
L(einval2):
movl %edx, %ebx
- cfi_restore (ebx)
movl $-EINVAL, %eax
jmp SYSCALL_ERROR_LABEL
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/msgctl.c b/sysdeps/unix/sysv/linux/i386/msgctl.c
index afecc49dd7..108da8a987 100644
--- a/sysdeps/unix/sysv/linux/i386/msgctl.c
+++ b/sysdeps/unix/sysv/linux/i386/msgctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -26,7 +26,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <shlib-compat.h>
struct __old_msqid_ds
diff --git a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
index 092a3bfb97..99a3ea536d 100644
--- a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
+++ b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2000,2002,2003,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
@@ -21,7 +20,7 @@
#include <bp-sym.h>
#include <bp-asm.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#define EINVAL 22
#define ENOSYS 38
@@ -43,41 +42,25 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Save registers. */
pushl %ebp
- cfi_adjust_cfa_offset (4)
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %esi
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
movl FD(%esp), %ebx
- cfi_rel_offset (ebx, 8)
movl OFFLO(%esp), %ecx
movl OFFHI(%esp), %edx
movl LENLO(%esp), %esi
- cfi_rel_offset (esi, 4)
movl LENHI(%esp), %edi
- cfi_rel_offset (edi, 0)
movl FLAGS(%esp), %ebp
- cfi_rel_offset (ebp, 12)
movl $SYS_ify(fadvise64_64), %eax
ENTER_KERNEL
/* Restore registers. */
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
#ifndef __ASSUME_FADVISE64_64_SYSCALL
cmpl $-ENOSYS, %eax
@@ -97,11 +80,8 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
&& (!defined __ASSUME_FADVISE64_64_SYSCALL || !defined __NR_fadvise64_64)
1: /* Save registers. */
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %esi
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
/* Overflow check. */
cmpl $0, LENHI(%esp)
@@ -109,13 +89,10 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
jne L(overflow)
movl FD(%esp), %ebx
- cfi_rel_offset (ebx, 8)
movl OFFLO(%esp), %ecx
movl OFFHI(%esp), %edx
movl LENLO(%esp), %esi
- cfi_rel_offset (esi, 4)
movl FLAGS(%esp), %edi
- cfi_rel_offset (edi, 0)
movl $SYS_ify(fadvise64), %eax
ENTER_KERNEL
@@ -123,14 +100,8 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Restore registers. */
L(overflow):
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
/* If 0 > %eax > -4096 there was an error. */
negl %eax
diff --git a/sysdeps/unix/sysv/linux/i386/pselect.c b/sysdeps/unix/sysv/linux/i386/pselect.c
deleted file mode 100644
index 2646608786..0000000000
--- a/sysdeps/unix/sysv/linux/i386/pselect.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <sys/select.h>
-
-extern int __call_pselect6 (int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, const struct timespec *timeout,
- void *data) attribute_hidden;
-
-
-#define CALL_PSELECT6(nfds, readfds, writefds, exceptfds, timeout, data) \
- ({ int r = __call_pselect6 (nfds, readfds, writefds, exceptfds, timeout, \
- data); \
- if (r < 0 && r > -4096) \
- { \
- __set_errno (-r); \
- r = -1; \
- } \
- r; })
-
-#include "../pselect.c"
diff --git a/sysdeps/unix/sysv/linux/i386/putmsg.c b/sysdeps/unix/sysv/linux/i386/putmsg.c
index 04fd159b7c..e7b7a08b55 100644
--- a/sysdeps/unix/sysv/linux/i386/putmsg.c
+++ b/sysdeps/unix/sysv/linux/i386/putmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2003 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
@@ -34,5 +34,5 @@ putmsg (fildes, ctlptr, dataptr, flags)
return INLINE_SYSCALL (putpmsg, 5, fildes, ctlptr, dataptr, -1, flags);
}
#else
-# include <streams/putmsg.c>
+# include <sysdeps/generic/putmsg.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/readelflib.c b/sysdeps/unix/sysv/linux/i386/readelflib.c
index a6374e61d2..6852f2a9a9 100644
--- a/sysdeps/unix/sysv/linux/i386/readelflib.c
+++ b/sysdeps/unix/sysv/linux/i386/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 2000.
@@ -73,10 +73,10 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
#undef process_elf_file
#define process_elf_file process_elf32_file
#define __ELF_NATIVE_CLASS 32
-#include "elf/readelflib.c"
+#include "sysdeps/generic/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
-#include "elf/readelflib.c"
+#include "sysdeps/generic/readelflib.c"
diff --git a/sysdeps/unix/sysv/linux/i386/semctl.c b/sysdeps/unix/sysv/linux/i386/semctl.c
index 1693cd47c4..14bfac613c 100644
--- a/sysdeps/unix/sysv/linux/i386/semctl.c
+++ b/sysdeps/unix/sysv/linux/i386/semctl.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995,1997,1998,2000,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -27,7 +26,7 @@
#include <string.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <shlib-compat.h>
struct __old_semid_ds
diff --git a/sysdeps/unix/sysv/linux/i386/semtimedop.S b/sysdeps/unix/sysv/linux/i386/semtimedop.S
index 0893c6a654..572641675f 100644
--- a/sysdeps/unix/sysv/linux/i386/semtimedop.S
+++ b/sysdeps/unix/sysv/linux/i386/semtimedop.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -32,34 +32,22 @@
ENTRY (BP_SYM (semtimedop))
pushl %ebp
- cfi_adjust_cfa_offset (4)
pushl %ebx
- cfi_adjust_cfa_offset (4)
pushl %edi
- cfi_adjust_cfa_offset (4)
movl $SYSOP_semtimedop, %ebx
- cfi_rel_offset (ebx, 4)
movl SEMID(%esp), %ecx
movl NSOPS(%esp), %edx
movl SOPS(%esp), %edi
- cfi_rel_offset (edi, 0)
movl TIMEOUT(%esp), %ebp
- cfi_rel_offset (ebp, 8)
movl $__NR_ipc, %eax
ENTER_KERNEL
/* Restore registers. */
popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
/* If 0 > %eax > -4096 there was an error. */
cmpl $-4096, %eax
diff --git a/sysdeps/unix/sysv/linux/i386/setcontext.S b/sysdeps/unix/sysv/linux/i386/setcontext.S
index bf2d7d2bad..ebed2ce572 100644
--- a/sysdeps/unix/sysv/linux/i386/setcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -31,16 +31,12 @@ ENTRY(__setcontext)
the system call fails and we return from the function with an
error. */
pushl %ebx
- cfi_adjust_cfa_offset (4)
xorl %edx, %edx
leal oSIGMASK(%eax), %ecx
movl $SIG_SETMASK, %ebx
- cfi_rel_offset (ebx, 0)
movl $__NR_sigprocmask, %eax
ENTER_KERNEL
popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
cmpl $-4095, %eax /* Check %eax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
@@ -61,13 +57,6 @@ ENTRY(__setcontext)
movl oEIP(%eax), %ecx
/* Load the new stack pointer. */
- cfi_def_cfa (eax, 0)
- cfi_offset (edi, oEDI)
- cfi_offset (esi, oESI)
- cfi_offset (ebp, oEBP)
- cfi_offset (ebx, oEBX)
- cfi_offset (edx, oEDX)
- cfi_offset (ecx, oECX)
movl oESP(%eax), %esp
/* Push the return address on the new stack so we can return there. */
@@ -83,10 +72,6 @@ ENTRY(__setcontext)
movl oECX(%eax), %ecx
movl oEAX(%eax), %eax
- /* End FDE here, we fall into another context. */
- cfi_endproc
- cfi_startproc
-
/* The following 'ret' will pop the address of the code and jump
to it. */
@@ -94,4 +79,4 @@ L(pseudo_end):
ret
PSEUDO_END(__setcontext)
-weak_alias (__setcontext, setcontext)
+weak_alias(__setcontext, setcontext)
diff --git a/sysdeps/unix/sysv/linux/i386/setegid.c b/sysdeps/unix/sysv/linux/i386/setegid.c
index 755bc360ad..b4bf33f18f 100644
--- a/sysdeps/unix/sysv/linux/i386/setegid.c
+++ b/sysdeps/unix/sysv/linux/i386/setegid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-1998,2000,2002,2003,2004,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-1998,2000,2002,2003,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
@@ -20,7 +19,7 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setresgid
diff --git a/sysdeps/unix/sysv/linux/i386/seteuid.c b/sysdeps/unix/sysv/linux/i386/seteuid.c
index 6de173521c..c139684d04 100644
--- a/sysdeps/unix/sysv/linux/i386/seteuid.c
+++ b/sysdeps/unix/sysv/linux/i386/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003, 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
@@ -19,7 +19,7 @@
#include <errno.h>
#include <unistd.h>
#include <setxid.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setresuid
diff --git a/sysdeps/unix/sysv/linux/i386/setfsgid.c b/sysdeps/unix/sysv/linux/i386/setfsgid.c
index 7296d433ca..b98514d5be 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003 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
@@ -23,7 +23,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setfsgid
diff --git a/sysdeps/unix/sysv/linux/i386/setfsuid.c b/sysdeps/unix/sysv/linux/i386/setfsuid.c
index 65ed353480..f7cf89bf14 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003 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
@@ -24,7 +24,7 @@
#include <sys/syscall.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setfsuid
diff --git a/sysdeps/unix/sysv/linux/i386/setgid.c b/sysdeps/unix/sysv/linux/i386/setgid.c
index 208ef25d0e..a7cdba582d 100644
--- a/sysdeps/unix/sysv/linux/i386/setgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setgid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 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
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setgid32
diff --git a/sysdeps/unix/sysv/linux/i386/setgroups.c b/sysdeps/unix/sysv/linux/i386/setgroups.c
index 10f5b7c91b..a2c6fc8daa 100644
--- a/sysdeps/unix/sysv/linux/i386/setgroups.c
+++ b/sysdeps/unix/sysv/linux/i386/setgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2002,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2002, 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
@@ -26,7 +26,7 @@
#include <bp-checks.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setgroups32
diff --git a/sysdeps/unix/sysv/linux/i386/setregid.c b/sysdeps/unix/sysv/linux/i386/setregid.c
index 05e448c6c9..f20a78175a 100644
--- a/sysdeps/unix/sysv/linux/i386/setregid.c
+++ b/sysdeps/unix/sysv/linux/i386/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 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
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setregid32
diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c
index d0750bb203..d4093afb0f 100644
--- a/sysdeps/unix/sysv/linux/i386/setresgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setresgid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003, 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
@@ -21,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#if defined __NR_setresgid || defined __NR_setresgid32
@@ -81,6 +80,6 @@ weak_alias (__setresgid, setresgid)
#else
-#include <posix/setresgid.c>
+#include <sysdeps/generic/setresgid.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c
index 0a676e53a9..540b954e08 100644
--- a/sysdeps/unix/sysv/linux/i386/setresuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setresuid.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002, 2003, 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
@@ -21,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#if defined __NR_setresuid || defined __NR_setresuid32
@@ -81,6 +80,6 @@ weak_alias (__setresuid, setresuid)
#else
-#include <posix/setresuid.c>
+#include <sysdeps/generic/setresuid.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
index 1ea449616c..09717ec52a 100644
--- a/sysdeps/unix/sysv/linux/i386/setreuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 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
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setreuid32
diff --git a/sysdeps/unix/sysv/linux/i386/setrlimit.c b/sysdeps/unix/sysv/linux/i386/setrlimit.c
index e7e517d914..4d23209f62 100644
--- a/sysdeps/unix/sysv/linux/i386/setrlimit.c
+++ b/sysdeps/unix/sysv/linux/i386/setrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2003 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
@@ -25,7 +25,7 @@
#include <shlib-compat.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
extern int __new_setrlimit (enum __rlimit_resource resource,
const struct rlimit *__unboundedrlimits);
diff --git a/sysdeps/unix/sysv/linux/i386/setuid.c b/sysdeps/unix/sysv/linux/i386/setuid.c
index 21c5bcd615..f809948f59 100644
--- a/sysdeps/unix/sysv/linux/i386/setuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003, 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
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <setxid.h>
#include <linux/posix_types.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#ifdef __NR_setuid32
diff --git a/sysdeps/unix/sysv/linux/i386/shmctl.c b/sysdeps/unix/sysv/linux/i386/shmctl.c
index 2cc039996c..394d3c01cf 100644
--- a/sysdeps/unix/sysv/linux/i386/shmctl.c
+++ b/sysdeps/unix/sysv/linux/i386/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -27,7 +27,7 @@
#include <bits/wordsize.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <shlib-compat.h>
struct __old_shmid_ds
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
index 299574dac4..9cb5b6e340 100644
--- a/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/i386.
- Copyright (C) 1991,1995-2000,2002-2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 1991,1995-2000,02,03, 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
@@ -154,10 +154,6 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
libc_hidden_def (__libc_sigaction)
-#ifdef WRAPPER_INCLUDE
-# include WRAPPER_INCLUDE
-#endif
-
#ifndef LIBC_SIGACTION
weak_alias (__libc_sigaction, __sigaction)
libc_hidden_weak (__sigaction)
diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S
index 7c8ac29b86..e403899cc6 100644
--- a/sysdeps/unix/sysv/linux/i386/socket.S
+++ b/sysdeps/unix/sysv/linux/i386/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1998,2002,2003,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2002,2003 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
@@ -41,6 +41,7 @@
#endif
.globl __socket
+ cfi_startproc
ENTRY (__socket)
#if defined NEED_CANCELLATION && defined CENABLE
SINGLE_THREAD_P
@@ -117,6 +118,7 @@ L(pseudo_end):
/* Successful; return the syscall's value. */
ret
#endif
+ cfi_endproc
PSEUDO_END (__socket)
#ifndef NO_WEAK_ALIAS
diff --git a/sysdeps/unix/sysv/linux/i386/swapcontext.S b/sysdeps/unix/sysv/linux/i386/swapcontext.S
index 27c16200b2..d909e659e4 100644
--- a/sysdeps/unix/sysv/linux/i386/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/swapcontext.S
@@ -109,4 +109,4 @@ L(pseudo_end):
ret
PSEUDO_END(__swapcontext)
-weak_alias (__swapcontext, swapcontext)
+weak_alias(__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/i386/sync_file_range.S b/sysdeps/unix/sysv/linux/i386/sync_file_range.S
deleted file mode 100644
index f39e8a00d7..0000000000
--- a/sysdeps/unix/sysv/linux/i386/sync_file_range.S
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Selective file content synch'ing.
- Copyright (C) 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-#define _ERRNO_H 1
-#include <bits/errno.h>
-
-
- .text
-ENTRY (sync_file_range)
-#ifdef __NR_sync_file_range
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- pushl %esi
- cfi_adjust_cfa_offset (4)
- pushl %edi
- cfi_adjust_cfa_offset (4)
- pushl %ebp
- cfi_adjust_cfa_offset (4)
-
- movl 20(%esp), %ebx
- cfi_rel_offset (ebx, 12)
- movl 24(%esp), %ecx
- movl 28(%esp), %edx
- movl 32(%esp), %esi
- cfi_rel_offset (esi, 8)
- movl 36(%esp), %edi
- cfi_rel_offset (edi, 4)
- movl 40(%esp), %ebp
- cfi_rel_offset (ebp, 0)
-
- movl $SYS_ify(sync_file_range), %eax
- ENTER_KERNEL
-
- popl %ebp
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebp)
- popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
- popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-
- cmpl $-4095, %eax
- jae SYSCALL_ERROR_LABEL
-L(pseudo_end):
- ret
-#else
- movl $-ENOSYS, %eax
- jmp SYSCALL_ERROR_LABEL
-#endif
-PSEUDO_END (sync_file_range)
diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list
index 3ff3a73aab..214397446d 100644
--- a/sysdeps/unix/sysv/linux/i386/syscalls.list
+++ b/sysdeps/unix/sysv/linux/i386/syscalls.list
@@ -5,4 +5,5 @@ vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0
vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4
oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0
oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0
+time - time Ei:p time
waitpid - waitpid Ci:ipi __waitpid waitpid __libc_waitpid
diff --git a/sysdeps/unix/sysv/linux/i386/sysconf.c b/sysdeps/unix/sysv/linux/i386/sysconf.c
index 2ffbd5227b..eae849b277 100644
--- a/sysdeps/unix/sysv/linux/i386/sysconf.c
+++ b/sysdeps/unix/sysv/linux/i386/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 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
@@ -26,7 +26,7 @@
static long int linux_sysconf (int name);
-static long int __attribute__ ((noinline))
+static long int
handle_i486 (int name)
{
/* The processor only has a unified level 1 cache of 8k. */
@@ -84,24 +84,11 @@ static const struct intel_02_cache_info
{ 0x29, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
{ 0x2c, _SC_LEVEL1_DCACHE_SIZE, 32768, 8, 64 },
{ 0x30, _SC_LEVEL1_ICACHE_SIZE, 32768, 8, 64 },
- { 0x39, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 64 },
- { 0x3a, _SC_LEVEL2_CACHE_SIZE, 196608, 6, 64 },
- { 0x3b, _SC_LEVEL2_CACHE_SIZE, 131072, 2, 64 },
- { 0x3c, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 64 },
- { 0x3d, _SC_LEVEL2_CACHE_SIZE, 393216, 6, 64 },
- { 0x3e, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
{ 0x41, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 32 },
{ 0x42, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 32 },
{ 0x43, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 32 },
{ 0x44, _SC_LEVEL2_CACHE_SIZE, 1048576, 4, 32 },
{ 0x45, _SC_LEVEL2_CACHE_SIZE, 2097152, 4, 32 },
- { 0x46, _SC_LEVEL3_CACHE_SIZE, 4194304, 4, 64 },
- { 0x47, _SC_LEVEL3_CACHE_SIZE, 8388608, 8, 64 },
- { 0x49, _SC_LEVEL2_CACHE_SIZE, 4194304, 16, 64 },
- { 0x4a, _SC_LEVEL3_CACHE_SIZE, 6291456, 12, 64 },
- { 0x4b, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
- { 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
- { 0x4d, _SC_LEVEL3_CACHE_SIZE, 16777216, 16, 64 },
{ 0x60, _SC_LEVEL1_DCACHE_SIZE, 16384, 8, 64 },
{ 0x66, _SC_LEVEL1_DCACHE_SIZE, 8192, 4, 64 },
{ 0x67, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
@@ -112,7 +99,6 @@ static const struct intel_02_cache_info
{ 0x7b, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 64 },
{ 0x7c, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
{ 0x7d, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 64 },
- { 0x7f, _SC_LEVEL2_CACHE_SIZE, 524288, 2, 64 },
{ 0x82, _SC_LEVEL2_CACHE_SIZE, 262144, 8, 32 },
{ 0x83, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 32 },
{ 0x84, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 32 },
@@ -140,7 +126,6 @@ intel_02_known_compare (const void *p1, const void *p2)
static long int
-__attribute__ ((noinline))
intel_check_word (int name, unsigned int value, bool *has_level_2,
bool *no_level_2_or_3)
{
@@ -167,33 +152,6 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
}
else
{
- if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
- {
- /* Intel reused this value. For family 15, model 6 it
- specifies the 3rd level cache. Otherwise the 2nd
- level cache. */
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
- asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
- : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
- : "0" (1));
-
- unsigned int family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
- unsigned int model = ((((eax >>16) & 0xf) << 4)
- + ((eax >> 4) & 0xf));
- if (family == 15 && model == 6)
- {
- /* The level 3 cache is encoded for this model like
- the level 2 cache is for other models. Pretend
- the caller asked for the level 2 cache. */
- name = (_SC_LEVEL2_CACHE_SIZE
- + (name - _SC_LEVEL3_CACHE_SIZE));
- folded_name = _SC_LEVEL3_CACHE_SIZE;
- }
- }
-
struct intel_02_cache_info *found;
struct intel_02_cache_info search;
@@ -230,7 +188,7 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
}
-static long int __attribute__ ((noinline))
+static long int
handle_intel (int name, unsigned int maxidx)
{
if (maxidx < 2)
@@ -292,7 +250,7 @@ handle_intel (int name, unsigned int maxidx)
}
-static long int __attribute__ ((noinline))
+static long int
handle_amd (int name)
{
unsigned int eax;
@@ -387,6 +345,17 @@ i386_i486_test (void)
long int
__sysconf (int name)
{
+ if (name == _SC_CPUTIME || name == _SC_THREAD_CPUTIME)
+ {
+#if HP_TIMING_AVAIL
+ // XXX We can add here test for machines which cannot support a
+ // XXX usable TSC.
+ return 200112L;
+#else
+ return -1;
+#endif
+ }
+
/* All the remainder, except the cache information, is handled in
the generic code. */
if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE)
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 5286676fc1..af75d4c51a 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1992,1993,1995-2000,2002,2003,2004
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
@@ -109,6 +109,27 @@
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
#else
+# ifndef HAVE_HIDDEN
+# define SETUP_PIC_REG(reg) \
+ call 1f; \
+ .subsection 1; \
+1:movl (%esp), %e##reg; \
+ ret; \
+ .previous
+# else
+# define SETUP_PIC_REG(reg) \
+ .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits; \
+ .globl __i686.get_pc_thunk.reg; \
+ .hidden __i686.get_pc_thunk.reg; \
+ .type __i686.get_pc_thunk.reg,@function; \
+__i686.get_pc_thunk.reg: \
+ movl (%esp), %e##reg; \
+ ret; \
+ .size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg; \
+ .previous; \
+ call __i686.get_pc_thunk.reg
+# endif
+
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
0:SETUP_PIC_REG(cx); \
@@ -133,36 +154,22 @@
movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx; \
xorl %edx, %edx; \
subl %eax, %edx; \
- SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx); \
+ movl %edx, %gs:0(%ecx); \
orl $-1, %eax; \
jmp L(pseudo_end);
-# ifndef NO_TLS_DIRECT_SEG_REFS
-# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
- movl src, %gs:(destoff)
-# else
-# define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff) \
- addl %gs:0, destoff; \
- movl src, (destoff)
-# endif
# else
# define SYSCALL_ERROR_HANDLER \
0:pushl %ebx; \
- cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); \
SETUP_PIC_REG (bx); \
addl $_GLOBAL_OFFSET_TABLE_, %ebx; \
xorl %edx, %edx; \
subl %eax, %edx; \
pushl %edx; \
- cfi_adjust_cfa_offset (4); \
PUSH_ERRNO_LOCATION_RETURN; \
call BP_SYM (__errno_location)@PLT; \
POP_ERRNO_LOCATION_RETURN; \
popl %ecx; \
- cfi_adjust_cfa_offset (-4); \
popl %ebx; \
- cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebx); \
movl %ecx, (%eax); \
orl $-1, %eax; \
jmp L(pseudo_end);
@@ -258,11 +265,9 @@
#define PUSHARGS_1 movl %ebx, %edx; L(SAVEBX1): PUSHARGS_0
#define DOARGS_1 _DOARGS_1 (4)
#define POPARGS_1 POPARGS_0; movl %edx, %ebx; L(RESTBX1):
-#define _PUSHARGS_1 pushl %ebx; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebx, 0); L(PUSHBX1): _PUSHARGS_0
+#define _PUSHARGS_1 pushl %ebx; L(PUSHBX1): _PUSHARGS_0
#define _DOARGS_1(n) movl n(%esp), %ebx; _DOARGS_0(n-4)
-#define _POPARGS_1 _POPARGS_0; popl %ebx; cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebx); L(POPBX1):
+#define _POPARGS_1 _POPARGS_0; popl %ebx; L(POPBX1):
#define PUSHARGS_2 PUSHARGS_1
#define DOARGS_2 _DOARGS_2 (8)
@@ -281,29 +286,23 @@
#define PUSHARGS_4 _PUSHARGS_4
#define DOARGS_4 _DOARGS_4 (24)
#define POPARGS_4 _POPARGS_4
-#define _PUSHARGS_4 pushl %esi; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (esi, 0); L(PUSHSI1): _PUSHARGS_3
+#define _PUSHARGS_4 pushl %esi; L(PUSHSI1): _PUSHARGS_3
#define _DOARGS_4(n) movl n(%esp), %esi; _DOARGS_3 (n-4)
-#define _POPARGS_4 _POPARGS_3; popl %esi; cfi_adjust_cfa_offset (-4); \
- cfi_restore (esi); L(POPSI1):
+#define _POPARGS_4 _POPARGS_3; popl %esi; L(POPSI1):
#define PUSHARGS_5 _PUSHARGS_5
#define DOARGS_5 _DOARGS_5 (32)
#define POPARGS_5 _POPARGS_5
-#define _PUSHARGS_5 pushl %edi; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (edi, 0); L(PUSHDI1): _PUSHARGS_4
+#define _PUSHARGS_5 pushl %edi; L(PUSHDI1): _PUSHARGS_4
#define _DOARGS_5(n) movl n(%esp), %edi; _DOARGS_4 (n-4)
-#define _POPARGS_5 _POPARGS_4; popl %edi; cfi_adjust_cfa_offset (-4); \
- cfi_restore (edi); L(POPDI1):
+#define _POPARGS_5 _POPARGS_4; popl %edi; L(POPDI1):
#define PUSHARGS_6 _PUSHARGS_6
-#define DOARGS_6 _DOARGS_6 (40)
+#define DOARGS_6 _DOARGS_6 (36)
#define POPARGS_6 _POPARGS_6
-#define _PUSHARGS_6 pushl %ebp; cfi_adjust_cfa_offset (4); \
- cfi_rel_offset (ebp, 0); L(PUSHBP1): _PUSHARGS_5
+#define _PUSHARGS_6 pushl %ebp; L(PUSHBP1): _PUSHARGS_5
#define _DOARGS_6(n) movl n(%esp), %ebp; _DOARGS_5 (n-4)
-#define _POPARGS_6 _POPARGS_5; popl %ebp; cfi_adjust_cfa_offset (-4); \
- cfi_restore (ebp); L(POPBP1):
+#define _POPARGS_6 _POPARGS_5; popl %ebp; L(POPBP1):
#else /* !__ASSEMBLER__ */
@@ -447,7 +446,7 @@ asm (".L__X'%ebx = 1\n\t"
#define LOADARGS_0
#ifdef __PIC__
-# if defined I386_USE_SYSENTER && defined SHARED
+# if defined I386_USE_SYSENTER
# define LOADARGS_1 \
"bpushl .L__X'%k3, %k3\n\t"
# define LOADARGS_5 \
@@ -533,49 +532,6 @@ asm (".L__X'%ebx = 1\n\t"
# define EXTRAVAR_5
#endif
-/* Consistency check for position-independent code. */
-#ifdef __PIC__
-# define check_consistency() \
- ({ int __res; \
- __asm__ __volatile__ \
- ("call __i686.get_pc_thunk.cx;" \
- "addl $_GLOBAL_OFFSET_TABLE_, %%ecx;" \
- "subl %%ebx, %%ecx;" \
- "je 1f;" \
- "ud2;" \
- "1:\n" \
- ".section .gnu.linkonce.t.__i686.get_pc_thunk.cx,\"ax\",@progbits;" \
- ".globl __i686.get_pc_thunk.cx;" \
- ".hidden __i686.get_pc_thunk.cx;" \
- ".type __i686.get_pc_thunk.cx,@function;" \
- "__i686.get_pc_thunk.cx:" \
- "movl (%%esp), %%ecx;" \
- "ret;" \
- ".previous" \
- : "=c" (__res)); \
- __res; })
-#endif
-
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. Using a global variable
- is too complicated here since we have no PC-relative addressing mode. */
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorl %gs:POINTER_GUARD, reg
-# define PTR_DEMANGLE(reg) PTR_MANGLE (reg)
-# else
-# define PTR_MANGLE(var) asm ("xorl %%gs:%c2, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
#endif /* linux/i386/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/i386/ucontext_i.h b/sysdeps/unix/sysv/linux/i386/ucontext_i.h
new file mode 100644
index 0000000000..d6efca41b1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/ucontext_i.h
@@ -0,0 +1,41 @@
+/* Offsets and other constants needed in the *context() function
+ implementation.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define SIG_BLOCK 0
+#define SIG_SETMASK 2
+
+/* Offsets of the fields in the ucontext_t structure. */
+#define oLINK 4
+#define oSS_SP 8
+#define oSS_SIZE 16
+#define oGS 20
+#define oFS 24
+#define oEDI 36
+#define oESI 40
+#define oEBP 44
+#define oESP 48
+#define oEBX 52
+#define oEDX 56
+#define oECX 60
+#define oEAX 64
+#define oEIP 76
+#define oFPREGS 96
+#define oSIGMASK 108
+#define oFPREGSMEM 236
diff --git a/sysdeps/unix/sysv/linux/i386/ucontext_i.sym b/sysdeps/unix/sysv/linux/i386/ucontext_i.sym
deleted file mode 100644
index b11a5509cd..0000000000
--- a/sysdeps/unix/sysv/linux/i386/ucontext_i.sym
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stddef.h>
-#include <signal.h>
-#include <sys/ucontext.h>
-
---
-
-SIG_BLOCK
-SIG_SETMASK
-
-#define ucontext(member) offsetof (ucontext_t, member)
-#define mcontext(member) ucontext (uc_mcontext.member)
-#define mreg(reg) mcontext (gregs[REG_##reg])
-
-oLINK ucontext (uc_link)
-oSS_SP ucontext (uc_stack.ss_sp)
-oSS_SIZE ucontext (uc_stack.ss_size)
-oGS mreg (GS)
-oFS mreg (FS)
-oEDI mreg (EDI)
-oESI mreg (ESI)
-oEBP mreg (EBP)
-oESP mreg (ESP)
-oEBX mreg (EBX)
-oEDX mreg (EDX)
-oECX mreg (ECX)
-oEAX mreg (EAX)
-oEIP mreg (EIP)
-oFPREGS mcontext (fpregs)
-oSIGMASK ucontext (uc_sigmask)
-oFPREGSMEM ucontext (__fpregs_mem)
diff --git a/sysdeps/unix/sysv/linux/i386/vfork.S b/sysdeps/unix/sysv/linux/i386/vfork.S
index eefd4b49cb..e660e6b70e 100644
--- a/sysdeps/unix/sysv/linux/i386/vfork.S
+++ b/sysdeps/unix/sysv/linux/i386/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>.
@@ -33,7 +33,6 @@ ENTRY (__vfork)
/* Pop the return PC value into ECX. */
popl %ecx
- cfi_adjust_cfa_offset (-4)
#ifdef SAVE_PID
SAVE_PID
@@ -47,7 +46,6 @@ ENTRY (__vfork)
disturbs the branch target cache. Instead push the return
address back on the stack. */
pushl %ecx
- cfi_adjust_cfa_offset (4)
#ifdef RESTORE_PID
RESTORE_PID
diff --git a/sysdeps/unix/sysv/linux/i386/xstat.c b/sysdeps/unix/sysv/linux/i386/xstat.c
index d27ecd3126..7c41d8cefa 100644
--- a/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -1,6 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 1991,95,96,97,98,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991,95,96,97,98,2000,2002,2003 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
@@ -31,7 +30,7 @@
#include <sys/syscall.h>
#include <bp-checks.h>
-#include <kernel-features.h>
+#include "kernel-features.h"
#include <xstatconv.h>
diff --git a/sysdeps/unix/sysv/linux/ia64/Dist b/sysdeps/unix/sysv/linux/ia64/Dist
new file mode 100644
index 0000000000..b4118bdead
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/Dist
@@ -0,0 +1,13 @@
+clone.S
+clone2.S
+dl-brk.S
+dl-static.c
+has_cpuclock.c
+ioperm.c
+ldd-rewrite.sed
+__start_context.S
+ucontext_i.h
+sys/procfs.h
+sys/io.h
+sys/rse.h
+sys/user.h
diff --git a/sysdeps/unix/sysv/linux/ia64/__longjmp.S b/sysdeps/unix/sysv/linux/ia64/__longjmp.S
index aa18fadf9c..7922e81bea 100644
--- a/sysdeps/unix/sysv/linux/ia64/__longjmp.S
+++ b/sysdeps/unix/sysv/linux/ia64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
The GNU C Library is free software; you can redistribute it and/or
@@ -101,9 +101,6 @@ LEAF(__longjmp)
ld8.nta r18=[r2],16 // b2
ld8.nta r19=[r3],16 // b3
;;
-#ifdef PTR_DEMANGLE
- PTR_DEMANGLE (r16, r24)
-#endif
ld8.nta r20=[r2],16 // b4
ld8.nta r21=[r3],16 // b5
;;
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index ed8c2da9e2..d330954d48 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fc