summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-12-27 14:48:14 +0000
committerJakub Jelinek <jakub@redhat.com>2005-12-27 14:48:14 +0000
commit64cd3e83c9993f3c1a3c24ea3030a22ccf35e12d (patch)
tree8808fad08bb8677b0e0d2158c65096eae5484767
parente3173d2c996d8e30dfe44e9bf530881da6df6aaa (diff)
Updated to fedora-glibc-20051227T1426
-rw-r--r--ChangeLog157
-rw-r--r--Makeconfig20
-rw-r--r--Makerules23
-rw-r--r--Versions.def1
-rw-r--r--bits/byteswap.h (renamed from sysdeps/generic/bits/byteswap.h)0
-rw-r--r--bits/confname.h (renamed from sysdeps/generic/bits/confname.h)0
-rw-r--r--bits/dlfcn.h (renamed from sysdeps/generic/bits/dlfcn.h)0
-rw-r--r--bits/environments.h (renamed from sysdeps/generic/bits/environments.h)0
-rw-r--r--bits/link.h (renamed from sysdeps/generic/bits/link.h)0
-rw-r--r--bits/linkmap.h (renamed from sysdeps/generic/bits/linkmap.h)0
-rw-r--r--bits/mman.h (renamed from sysdeps/generic/bits/mman.h)0
-rw-r--r--bits/types.h (renamed from sysdeps/generic/bits/types.h)0
-rw-r--r--bits/waitstatus.h (renamed from sysdeps/generic/bits/waitstatus.h)0
-rw-r--r--csu/dso_handle.c2
-rw-r--r--elf/cache.c4
-rw-r--r--elf/chroot_canon.c6
-rw-r--r--elf/dl-error.c2
-rw-r--r--elf/dl-lookup.c2
-rw-r--r--elf/ldconfig.c6
-rw-r--r--elf/readlib.c4
-rw-r--r--elf/rtld.c2
-rw-r--r--fedora/branch.mk4
-rw-r--r--fedora/glibc.spec.in51
-rw-r--r--gmon/mcount.c2
-rw-r--r--hurd/hurdfault.c5
-rw-r--r--hurd/hurdsig.c6
-rw-r--r--hurd/report-wait.c6
-rw-r--r--hurd/sigunwind.c2
-rw-r--r--iconv/gconv_conf.c2
-rw-r--r--include/stdlib.h4
-rw-r--r--include/time.h8
-rw-r--r--intl/l10nflist.c7
-rw-r--r--mach/setup-thread.c4
-rw-r--r--manual/errno.texi36
-rw-r--r--misc/syslog.c9
-rw-r--r--nptl/ChangeLog95
-rw-r--r--nptl/Makefile11
-rw-r--r--nptl/Versions5
-rw-r--r--nptl/descr.h45
-rw-r--r--nptl/libc-cancellation.c4
-rw-r--r--nptl/pt-cleanup.c5
-rw-r--r--nptl/pthreadP.h28
-rw-r--r--nptl/pthread_create.c29
-rw-r--r--nptl/pthread_join.c4
-rw-r--r--nptl/pthread_mutex_consistent.c (renamed from sysdeps/generic/bits/uio.h)28
-rw-r--r--nptl/pthread_mutex_destroy.c5
-rw-r--r--nptl/pthread_mutex_init.c14
-rw-r--r--nptl/pthread_mutex_lock.c76
-rw-r--r--nptl/pthread_mutex_timedlock.c90
-rw-r--r--nptl/pthread_mutex_trylock.c97
-rw-r--r--nptl/pthread_mutex_unlock.c58
-rw-r--r--nptl/pthread_mutexattr_getpshared.c6
-rw-r--r--nptl/pthread_mutexattr_getrobust.c (renamed from sysdeps/generic/bits/ipctypes.h)29
-rw-r--r--nptl/pthread_mutexattr_gettype.c6
-rw-r--r--nptl/pthread_mutexattr_setpshared.c8
-rw-r--r--nptl/pthread_mutexattr_setrobust.c (renamed from sysdeps/generic/bits/utmp.h)49
-rw-r--r--nptl/pthread_mutexattr_settype.c6
-rw-r--r--nptl/pthread_timedjoin.c4
-rw-r--r--nptl/pthread_tryjoin.c4
-rw-r--r--nptl/sysdeps/pthread/pthread.h53
-rw-r--r--nptl/sysdeps/pthread/sigaction.c8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/register-atfork.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/unregister-atfork.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h15
-rw-r--r--nptl/tst-cancel24.cc113
-rw-r--r--nptl/tst-once3.c7
-rw-r--r--nptl/tst-robust1.c245
-rw-r--r--nptl/tst-robust2.c3
-rw-r--r--nptl/tst-robust3.c20
-rw-r--r--nptl/tst-robust4.c2
-rw-r--r--nptl/tst-robust5.c2
-rw-r--r--nptl/tst-robust6.c2
-rw-r--r--nptl/tst-typesizes.c68
-rw-r--r--nptl/unwind.c4
-rw-r--r--nptl/version.c4
-rw-r--r--rt/aio_read64.c2
-rw-r--r--rt/aio_sigqueue.c4
-rw-r--r--rt/aio_write64.c2
-rw-r--r--scripts/gen-as-const.awk28
-rw-r--r--soft-fp/soft-fp.h5
-rw-r--r--stdio-common/tmpfile64.c2
-rw-r--r--stdlib/Makefile5
-rw-r--r--stdlib/tst-ucontext-off.c35
-rw-r--r--sysdeps/generic/bits/atomic.h43
-rw-r--r--sysdeps/generic/bits/dirent.h37
-rw-r--r--sysdeps/generic/bits/elfclass.h14
-rw-r--r--sysdeps/generic/bits/endian.h13
-rw-r--r--sysdeps/generic/bits/errno.h35
-rw-r--r--sysdeps/generic/bits/fcntl.h95
-rw-r--r--sysdeps/generic/bits/fenv.h56
-rw-r--r--sysdeps/generic/bits/fenvinline.h8
-rw-r--r--sysdeps/generic/bits/huge_val.h29
-rw-r--r--sysdeps/generic/bits/huge_valf.h29
-rw-r--r--sysdeps/generic/bits/huge_vall.h29
-rw-r--r--sysdeps/generic/bits/in.h82
-rw-r--r--sysdeps/generic/bits/inf.h33
-rw-r--r--sysdeps/generic/bits/ioctl-types.h114
-rw-r--r--sysdeps/generic/bits/ioctls.h5
-rw-r--r--sysdeps/generic/bits/ipc.h47
-rw-r--r--sysdeps/generic/bits/libc-lock.h138
-rw-r--r--sysdeps/generic/bits/libc-tsd.h69
-rw-r--r--sysdeps/generic/bits/local_lim.h3
-rw-r--r--sysdeps/generic/bits/mathdef.h43
-rw-r--r--sysdeps/generic/bits/mathinline.h12
-rw-r--r--sysdeps/generic/bits/mqueue.h31
-rw-r--r--sysdeps/generic/bits/msq.h45
-rw-r--r--sysdeps/generic/bits/nan.h5
-rw-r--r--sysdeps/generic/bits/netdb.h33
-rw-r--r--sysdeps/generic/bits/poll.h43
-rw-r--r--sysdeps/generic/bits/posix_opt.h2
-rw-r--r--sysdeps/generic/bits/pthreadtypes.h1
-rw-r--r--sysdeps/generic/bits/resource.h182
-rw-r--r--sysdeps/generic/bits/sched.h71
-rw-r--r--sysdeps/generic/bits/select.h35
-rw-r--r--sysdeps/generic/bits/sem.h62
-rw-r--r--sysdeps/generic/bits/setjmp.h7
-rw-r--r--sysdeps/generic/bits/shm.h58
-rw-r--r--sysdeps/generic/bits/sigaction.h78
-rw-r--r--sysdeps/generic/bits/sigcontext.h33
-rw-r--r--sysdeps/generic/bits/siginfo.h211
-rw-r--r--sysdeps/generic/bits/signum.h64
-rw-r--r--sysdeps/generic/bits/sigset.h83
-rw-r--r--sysdeps/generic/bits/sigstack.h55
-rw-r--r--sysdeps/generic/bits/sigthread.h35
-rw-r--r--sysdeps/generic/bits/sockaddr.h40
-rw-r--r--sysdeps/generic/bits/socket.h251
-rw-r--r--sysdeps/generic/bits/stat.h99
-rw-r--r--sysdeps/generic/bits/statfs.h70
-rw-r--r--sysdeps/generic/bits/statvfs.h84
-rw-r--r--sysdeps/generic/bits/stdio-lock.h58
-rw-r--r--sysdeps/generic/bits/string.h12
-rw-r--r--sysdeps/generic/bits/stropts.h231
-rw-r--r--sysdeps/generic/bits/sys_errlist.h24
-rw-r--r--sysdeps/generic/bits/termios.h256
-rw-r--r--sysdeps/generic/bits/time.h75
-rw-r--r--sysdeps/generic/bits/typesizes.h66
-rw-r--r--sysdeps/generic/bits/ustat.h31
-rw-r--r--sysdeps/generic/bits/utsname.h25
-rw-r--r--sysdeps/generic/bits/waitflags.h27
-rw-r--r--sysdeps/generic/bits/wchar.h26
-rw-r--r--sysdeps/generic/bits/wordsize.h1
-rw-r--r--sysdeps/generic/bits/xtitypes.h34
-rw-r--r--sysdeps/generic/unwind-dw2.c6
-rw-r--r--sysdeps/gnu/errlist.c48
-rw-r--r--sysdeps/i386/fpu/e_expl.c4
-rw-r--r--sysdeps/i386/i586/memusage.h1
-rw-r--r--sysdeps/i386/memusage.h1
-rw-r--r--sysdeps/ieee754/dbl-64/e_exp2.c13
-rw-r--r--sysdeps/ieee754/dbl-64/halfulp.c4
-rw-r--r--sysdeps/ieee754/flt-32/e_exp2f.c13
-rw-r--r--sysdeps/ieee754/flt-32/e_expf.c13
-rw-r--r--sysdeps/ieee754/flt-32/s_expm1f.c18
-rw-r--r--sysdeps/mach/hurd/fork.c5
-rw-r--r--sysdeps/mach/hurd/hppa/trampoline.c4
-rw-r--r--sysdeps/mach/hurd/i386/trampoline.c7
-rw-r--r--sysdeps/mach/hurd/ifreq.c6
-rw-r--r--sysdeps/mach/hurd/mips/trampoline.c10
-rw-r--r--sysdeps/mach/hurd/powerpc/trampoline.c7
-rw-r--r--sysdeps/posix/sprofil.c4
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps34
-rw-r--r--sysdeps/pthread/aio_cancel.c4
-rw-r--r--sysdeps/pthread/aio_fsync.c4
-rw-r--r--sysdeps/pthread/aio_read.c4
-rw-r--r--sysdeps/pthread/aio_read64.c4
-rw-r--r--sysdeps/pthread/aio_suspend.c5
-rw-r--r--sysdeps/pthread/aio_write.c4
-rw-r--r--sysdeps/pthread/aio_write64.c4
-rw-r--r--sysdeps/pthread/lio_listio.c5
-rw-r--r--sysdeps/pthread/lio_listio64.c4
-rw-r--r--sysdeps/unix/sysv/linux/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/aio_sigqueue.c5
-rw-r--r--sysdeps/unix/sysv/linux/bits/errno.h11
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/i386/ucontext_i.h61
-rw-r--r--sysdeps/unix/sysv/linux/i386/ucontext_i.sym30
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h62
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym34
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h75
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym50
-rw-r--r--sysdeps/unix/sysv/linux/s390/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h49
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h49
-rw-r--r--sysdeps/unix/sysv/linux/s390/ucontext_i.sym23
-rw-r--r--sysdeps/unix/sysv/linux/sh/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h79
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym38
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h149
-rw-r--r--sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym73
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.h69
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym34
-rw-r--r--sysdeps/unix/sysv/tcflow.c4
-rw-r--r--sysdeps/x86_64/__longjmp.S2
-rw-r--r--sysdeps/x86_64/setjmp.S9
-rw-r--r--test-skeleton.c4
199 files changed, 1980 insertions, 4401 deletions
diff --git a/ChangeLog b/ChangeLog
index f471b85859..33a598ff07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,160 @@
+2005-12-26 Ulrich Drepper <drepper@redhat.com>
+
+ * Versions.def: Add GLIBC_2.4 for libpthread.
+
+2005-12-25 Ulrich Drepper <drepper@redhat.com>
+
+ * stdlib/Makefile ($(objpfx)isomac.out): Move -I.. to the end so
+ that $(..)/bits is not found early.
+
+2005-12-24 Ulrich Drepper <drepper@redhat.com>
+
+ * manual/errno.texi: Add new Linux errno codes.
+ * sysdeps/unix/sysv/linux/Versions: Add new errlist-compat entry
+ for up to 132 errnos.
+ * sysdeps/unix/sysv/linux/bits/errno.h: Define EOWNERDEAD and
+ ENOTRECOVERABLE if not already defined.
+
+2005-12-23 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #1566]
+ * sysdeps/i386/i586/memusage.h: New file.
+ * sysdeps/i386/memusage.h: Don't define GETTIME.
+
+2005-12-22 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #1499]
+ * misc/syslog.c (SyslogAddr): Use sockaddr_un instead of sockaddr.
+ (openlog_internal): Adjust for this change.
+
+ * Makeconfig: Define CXXFLAGS. Split out warnings from +gccwarn which
+ are not understood by the C++ compiler.
+ * Makerules: Add rules to build C++ code for test cases.
+ * include/stdlib.h: Protect for inclusion in C++ code.
+ * include/time.h: Likewise.
+
+2005-12-22 Roland McGrath <roland@redhat.com>
+
+ * Makerules [gen-as-const-headers] (tests): Add one test per .sym
+ file, not just one.
+ ($(objpfx)test-as-const.c): Target replaced with ...
+ ($(objpfx)test-as-const-%.c): ... this pattern rule.
+ (generated): Add those files.
+
+2005-12-22 Ulrich Drepper <drepper@redhat.com>
+
+ * test-skeleton.c (timeout_handler): Rewrite ts initialization for
+ C++ compatibility.
+
+ * sysdeps/x86_64/__longjmp.S: Also protect SP and BP.
+ * sysdeps/x86_64/setjmp.S: Likewise.
+
+2005-12-21 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/i386/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/s390/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/x86_64/ucontext_i.h: File removed.
+ * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: New file.
+ * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = stdlib]:
+ (gen-as-const-headers): Add it.
+ * sysdeps/unix/sysv/linux/powerpc/Makefile: Likewise.
+ * sysdeps/unix/sysv/linux/sh/Makefile: Likewise.
+ * sysdeps/unix/sysv/linux/s390/Makefile: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/Makefile: Likewise.
+ * stdlib/tst-ucontext-off.c: File removed.
+ * stdlib/Makefile (tests): Remove it.
+
+ * scripts/gen-as-const.awk: Support generating a test program.
+ * Makerules [gen-as-const-headers] (tests): Add test-as-const.
+ [gen-as-const-headers] ($(objpfx)test-as-const.c): New target.
+
+ * sysdeps/generic/bits: Subdirectory and all files moved to ...
+ * bits: ... here, new subdirectory.
+ * Makeconfig (+includes): Reordered includes to put build and sysdeps
+ dirs first after $(..)include, $(sysincludes) last.
+
+ [BZ #2066]
+ * intl/l10nflist.c (_nl_make_l10nflist): Free ABS_FILENAME when later
+ malloc fails.
+
+2005-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/powerpc/fpu/libm-test-ulps: Update for GCC 4.1 prerelease.
+
+2005-12-21 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/mach/hurd/ifreq.c: Add missing #includes.
+
+ * elf/cache.c: Use <> rather than "" #includes.
+ * elf/chroot_canon.c: Likewise.
+ * elf/dl-lookup.c: Likewise.
+ * elf/ldconfig.c: Likewise.
+ * elf/readlib.c: Likewise.
+ * elf/rtld.c: Likewise.
+ * gmon/mcount.c: Likewise.
+ * hurd/hurdfault.c: Likewise.
+ * hurd/hurdsig.c: Likewise.
+ * hurd/report-wait.c: Likewise.
+ * hurd/sigunwind.c: Likewise.
+ * mach/setup-thread.c: Likewise.
+ * rt/aio_read64.c: Likewise.
+ * rt/aio_sigqueue.c: Likewise.
+ * rt/aio_write64.c: Likewise.
+ * soft-fp/soft-fp.h: Likewise.
+ * stdio-common/tmpfile64.c: Likewise.
+ * sysdeps/mach/hurd/fork.c: Likewise.
+ * sysdeps/mach/hurd/hppa/trampoline.c: Likewise.
+ * sysdeps/mach/hurd/i386/trampoline.c: Likewise.
+ * sysdeps/mach/hurd/mips/trampoline.c: Likewise.
+ * sysdeps/mach/hurd/powerpc/trampoline.c: Likewise.
+ * sysdeps/posix/sprofil.c: Likewise.
+ * sysdeps/pthread/aio_cancel.c: Likewise.
+ * sysdeps/pthread/aio_fsync.c: Likewise.
+ * sysdeps/pthread/aio_read64.c: Likewise.
+ * sysdeps/pthread/aio_read.c: Likewise.
+ * sysdeps/pthread/aio_suspend.c: Likewise.
+ * sysdeps/pthread/aio_write64.c: Likewise.
+ * sysdeps/pthread/aio_write.c: Likewise.
+ * sysdeps/pthread/lio_listio64.c: Likewise.
+ * sysdeps/pthread/lio_listio.c: Likewise.
+ * sysdeps/unix/sysv/linux/aio_sigqueue.c: Likewise.
+ * sysdeps/unix/sysv/tcflow.c: Likewise.
+
+ * sysdeps/generic/unwind-dw2.c (extract_cie_info): Add a cast.
+
+ * elf/dl-error.c (_dl_signal_error): Use .__jmpbuf in __longjmp call.
+
+ * csu/dso_handle.c (__dso_handle): Add const to pointer type too.
+
+2005-12-21 Ulrich Drepper <drepper@redhat.com>
+
+ * iconv/gconv_conf.c: Initialize empty_path_elem.
+
+ * sysdeps/ieee754/dbl-64/halfulp.c: Mark tab54 as static and const.
+ * sysdeps/i386/fpu/e_expl.c: Mark c0 and c1 as const.
+ * sysdeps/ieee754/flt-32/s_expm1f.c: Make sure huge and tiny end
+ up in .rodata.
+ * sysdeps/ieee754/flt-32/e_exp2f.c: Make sure TWO127 and TWOM100
+ end up in .rodata.
+ * sysdeps/ieee754/flt-32/e_expf.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_exp2.c: Make sure TWO1023 and TWOM1000
+ end up in .rodata.
+
+2005-12-21 Thorsten Kukuk <kukuk@suse.de>
+
+ * elf/readlib.c: Fix include of readelflib.c.
+
2005-12-21 Ulrich Drepper <drepper@redhat.com>
[BZ #1962]
diff --git a/Makeconfig b/Makeconfig
index 45a970402e..f32a19eab6 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -552,10 +552,11 @@ endif
# Extra flags to pass to GCC.
ifeq ($(all-warnings),yes)
-+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
++gccwarn := -Wall -Wwrite-strings -Winline -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
else
-+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes
++gccwarn := -Wall -Wwrite-strings -Winline
endif
++gccwarn-c = -Wstrict-prototypes
# We do not depend on the address of constants in different files to be
# actually different, so allow the compiler to merge them all.
@@ -627,10 +628,10 @@ endif # $(+cflags) == ""
# library source directory, in the include directory, and in the
# current directory.
# `+sysdep-includes' will be defined by Makerules.
-+includes = -I$(..)include $(patsubst %/,-I%,$(..)) \
- $(libio-include) $(includes) \
- $(+sysdep-includes) $(sysincludes) -I. \
- $(patsubst %/,-I%,$(objpfx))
++includes = -I$(..)include \
+ $(patsubst %/,-I%,$(objpfx)) $(+sysdep-includes) \
+ $(patsubst %/,-I%,$(..)) $(libio-include) $(includes) -I. \
+ $(sysincludes)
# Since libio has several internal header files, we use a -I instead
# of many little headers in the include directory.
@@ -647,8 +648,11 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
override CFLAGS = -std=gnu99 \
- $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
- $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
+ $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
+ $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
+ $(CFLAGS-$(@F))
+override CXXFLAGS = $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
+ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))
# If everything is compiled with -fPIC (implicitly) we must tell this by
# defining the PIC symbol.
diff --git a/Makerules b/Makerules
index d0b1d8975d..31939838d3 100644
--- a/Makerules
+++ b/Makerules
@@ -183,6 +183,7 @@ sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' \
endif
+ifdef gen-as-const-headers
# Generating headers for assembly constants.
# We need this defined early to get into before-compile before
# it's used in sysd-rules, below.
@@ -201,6 +202,16 @@ $(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
mv -f $(@:.h.d=.h)T $(@:.h.d=.h)
vpath %.sym $(sysdirs)
before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
+
+tests += $(gen-as-const-headers:%.sym=test-as-const-%)
+generated += $(gen-as-const-headers:%.sym=test-as-const-%.c)
+$(objpfx)test-as-const-%.c: $(..)scripts/gen-as-const.awk $(..)Makerules \
+ %.sym $(common-objpfx)%.h
+ ($(AWK) '{ sub(/^/, "asconst_", $$2); print; }' $(filter %.h,$^); \
+ $(AWK) -v test=1 -f $< $(filter %.sym,$^); \
+ echo '#include "$(..)test-skeleton.c"') > $@T
+ mv -f $@T $@
+endif
# Generate an ordered list of implicit rules which find the source files in
# each sysdep directory. The old method was to use vpath to search all the
@@ -295,6 +306,12 @@ endef
object-suffixes-left := $(all-object-suffixes)
include $(o-iterator)
+define o-iterator-doit
+$(objpfx)%$o: %.cc $(before-compile); $$(compile-command.cc)
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
+
# Omit the objpfx rules when building in the source tree, because
# objpfx is empty and so these rules just override the ones above.
ifdef objpfx
@@ -370,9 +387,11 @@ compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
+compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
# GCC can grok options after the file name, and it looks nicer that way.
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
+compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
@@ -1169,9 +1188,9 @@ xcheck: xtests
all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c)
+cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
lib := nonlib
-include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib))
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
# The include magic above causes those files to use this variable for flags.
diff --git a/Versions.def b/Versions.def
index 09cef140bf..d7be70386e 100644
--- a/Versions.def
+++ b/Versions.def
@@ -80,6 +80,7 @@ libpthread {
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
+ GLIBC_2.4
GLIBC_PRIVATE
}
libresolv {
diff --git a/sysdeps/generic/bits/byteswap.h b/bits/byteswap.h
index 949ed0bc9d..949ed0bc9d 100644
--- a/sysdeps/generic/bits/byteswap.h
+++ b/bits/byteswap.h
diff --git a/sysdeps/generic/bits/confname.h b/bits/confname.h
index 8947d48ed7..8947d48ed7 100644
--- a/sysdeps/generic/bits/confname.h
+++ b/bits/confname.h
diff --git a/sysdeps/generic/bits/dlfcn.h b/bits/dlfcn.h
index 67fd96a22a..67fd96a22a 100644
--- a/sysdeps/generic/bits/dlfcn.h
+++ b/bits/dlfcn.h
diff --git a/sysdeps/generic/bits/environments.h b/bits/environments.h
index 4617dc45f2..4617dc45f2 100644
--- a/sysdeps/generic/bits/environments.h
+++ b/bits/environments.h
diff --git a/sysdeps/generic/bits/link.h b/bits/link.h
index 6b4f811c25..6b4f811c25 100644
--- a/sysdeps/generic/bits/link.h
+++ b/bits/link.h
diff --git a/sysdeps/generic/bits/linkmap.h b/bits/linkmap.h
index 470b4d3e5f..470b4d3e5f 100644
--- a/sysdeps/generic/bits/linkmap.h
+++ b/bits/linkmap.h
diff --git a/sysdeps/generic/bits/mman.h b/bits/mman.h
index 0c15902706..0c15902706 100644
--- a/sysdeps/generic/bits/mman.h
+++ b/bits/mman.h
diff --git a/sysdeps/generic/bits/types.h b/bits/types.h
index 65c8a9fe90..65c8a9fe90 100644
--- a/sysdeps/generic/bits/types.h
+++ b/bits/types.h
diff --git a/sysdeps/generic/bits/waitstatus.h b/bits/waitstatus.h
index 699c224989..699c224989 100644
--- a/sysdeps/generic/bits/waitstatus.h
+++ b/bits/waitstatus.h
diff --git a/csu/dso_handle.c b/csu/dso_handle.c
index 72f80889d7..fd295f2442 100644
--- a/csu/dso_handle.c
+++ b/csu/dso_handle.c
@@ -18,5 +18,5 @@
/* We have to define __dso_handle ourselves since we do not use gcc's
crtbegin files. */
-void *const __dso_handle __attribute__ ((__visibility__ ("hidden")))
+const void *const __dso_handle __attribute__ ((__visibility__ ("hidden")))
= &__dso_handle;
diff --git a/elf/cache.c b/elf/cache.c
index 9ce3d161a7..c13918ccb4 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -30,8 +30,8 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "ldconfig.h"
-#include "dl-cache.h"
+#include <ldconfig.h>
+#include <dl-cache.h>
struct cache_entry
{
diff --git a/elf/chroot_canon.c b/elf/chroot_canon.c
index 41d6e82625..3ef2fdf08f 100644
--- a/elf/chroot_canon.c
+++ b/elf/chroot_canon.c
@@ -1,6 +1,6 @@
/* Return the canonical absolute name of a given file inside chroot.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
#include <stddef.h>
#include <stdint.h>
-#include "ldconfig.h"
+#include <ldconfig.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
diff --git a/elf/dl-error.c b/elf/dl-error.c
index b5374e949c..79ebaaf01b 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -113,7 +113,7 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
lcatch->malloced = false;
}
/* We do not restore the signal mask because none was saved. */
- __longjmp (lcatch->env, errcode ?: -1);
+ __longjmp (lcatch->env[0].__jmpbuf, errcode ?: -1);
}
else
{
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 130453ca24..5a7bed16e5 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <unistd.h>
#include <ldsodefs.h>
-#include "dl-hash.h"
+#include <dl-hash.h>
#include <dl-machine.h>
#include <bits/libc-lock.h>
#include <tls.h>
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index e63b312bd0..e5a931913f 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -37,10 +37,10 @@
#include <glob.h>
#include <libgen.h>
-#include "ldconfig.h"
-#include "dl-cache.h"
+#include <ldconfig.h>
+#include <dl-cache.h>
-#include "dl-procinfo.h"
+#include <dl-procinfo.h>
#ifdef _DL_FIRST_PLATFORM
# define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
diff --git a/elf/readlib.c b/elf/readlib.c
index 65c8e9d65d..8896bbdaca 100644
--- a/elf/readlib.c
+++ b/elf/readlib.c
@@ -34,7 +34,7 @@
#include <sys/stat.h>
#include <gnu/lib-names.h>
-#include "ldconfig.h"
+#include <ldconfig.h>
#define Elf32_CLASS ELFCLASS32
#define Elf64_CLASS ELFCLASS64
@@ -178,4 +178,4 @@ process_file (const char *real_file_name, const char *file_name,
}
/* Get architecture specific version of process_elf_file. */
-#include "readelflib.c"
+#include <readelflib.c>
diff --git a/elf/rtld.c b/elf/rtld.c
index aee3ea9a2a..71bcf0ab71 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -34,7 +34,7 @@
#include <hp-timing.h>
#include <bits/libc-lock.h>
#include "dynamic-link.h"
-#include "dl-librecon.h"
+#include <dl-librecon.h>
#include <unsecvars.h>
#include <dl-cache.h>
#include <dl-osinfo.h>
diff --git a/fedora/branch.mk b/fedora/branch.mk
index 43a878b1bd..eb64c97cd4 100644
--- a/fedora/branch.mk
+++ b/fedora/branch.mk
@@ -3,5 +3,5 @@ glibc-branch := fedora
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc4
-fedora-sync-date := 2005-12-21 09:31 UTC
-fedora-sync-tag := fedora-glibc-20051221T0931
+fedora-sync-date := 2005-12-27 14:26 UTC
+fedora-sync-tag := fedora-glibc-20051227T1426
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index d28e5481ab..70c2b41003 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -1,4 +1,4 @@
-%define glibcrelease 22
+%define glibcrelease 23
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define xenarches i686 athlon
@@ -390,7 +390,7 @@ cat > asm/unistd.h <<EOF
#define __NR_waitid 281
#endif
%endif
-%ifarch sparc sparc64
+%ifarch sparc sparcv9 sparc64
#ifndef __NR_mq_open
#define __NR_mq_open 273
#define __NR_mq_unlink 274
@@ -418,6 +418,47 @@ cat > asm/unistd.h <<EOF
%endif
#endif
EOF
+cat > asm/errno.h <<EOF
+#ifndef _HACK_ASM_ERRNO_H
+#include_next <asm/errno.h>
+%ifarch alpha
+#ifndef ENOKEY
+#define ENOKEY 132
+#define EKEYEXPIRED 133
+#define EKEYREVOKED 134
+#define EKEYREJECTED 135
+#endif
+#ifndef EOWNERDEAD
+#define EOWNERDEAD 136
+#define ENOTRECOVERABLE 137
+#endif
+%endif
+%ifarch %{ix86} ia64 ppc ppc64 s390 s390x x86_64
+#ifndef ENOKEY
+#define ENOKEY 126
+#define EKEYEXPIRED 127
+#define EKEYREVOKED 128
+#define EKEYREJECTED 129
+#endif
+#ifndef EOWNERDEAD
+#define EOWNERDEAD 130
+#define ENOTRECOVERABLE 131
+#endif
+%endif
+%ifarch sparc sparcv9 sparc64
+#ifndef ENOKEY
+#define ENOKEY 128
+#define EKEYEXPIRED 129
+#define EKEYREVOKED 130
+#define EKEYREJECTED 131
+#endif
+#ifndef EOWNERDEAD
+#define EOWNERDEAD 132
+#define ENOTRECOVERABLE 133
+#endif
+%endif
+#endif
+EOF
# A lot of programs still misuse memcpy when they have to use
# memmove. The memcpy implementation below is not tolerant at
@@ -1074,6 +1115,12 @@ rm -f *.filelist*
%endif
%changelog
+* Tue Dec 27 2005 Jakub Jelinek <jakub@redhat.com> 2.3.90-23
+- update from CVS
+ - robust mutexes
+- fix transliteration segfaults (#176573, #176583)
+- ignore prelink temporaries in ldconfig (#176570)
+
* Wed Dec 21 2005 Jakub Jelinek <jakub@redhat.com> 2.3.90-22
- update from CVS
- minor fts fixes
diff --git a/gmon/mcount.c b/gmon/mcount.c
index e18bf86e83..32a5f1ea0f 100644
--- a/gmon/mcount.c
+++ b/gmon/mcount.c
@@ -37,7 +37,7 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
/* This file provides the machine-dependent definitions of the _MCOUNT_DECL
and MCOUNT macros. */
-#include "machine-gmon.h"
+#include <machine-gmon.h>
#include <atomic.h>
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
index 6ab5a97876..36653e1488 100644
--- a/hurd/hurdfault.c
+++ b/hurd/hurdfault.c
@@ -1,5 +1,6 @@
/* Handle faults in the signal thread.
- Copyright (C) 1994,95,96,97,2002 Free Software Foundation, Inc.
+ Copyright (C) 1994,1995,1996,1997,2002,2005
+ 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 +25,7 @@
#include <string.h>
#include <setjmp.h>
#include <stdio.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include "faultexc_server.h" /* mig-generated header for our exc server. */
#include <assert.h>
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index bbd0c17182..e12d19da12 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01,2002
+/* Copyright (C) 1991,92,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -132,7 +132,7 @@ _hurd_thread_sigstate (thread_t thread)
#include <setjmp.h>
#include <fcntl.h>
#include <sys/wait.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <hurd/msg_server.h>
#include <hurd/msg_reply.h> /* For __msg_sig_post_reply. */
#include <hurd/interrupt.h>
@@ -256,7 +256,7 @@ interrupted_reply_port_location (struct machine_thread_all_state *thread_state,
}
#include <hurd/sigpreempt.h>
-#include "intr-msg.h"
+#include <intr-msg.h>
/* Timeout on interrupt_operation calls. */
mach_msg_timeout_t _hurdsig_interrupt_timeout = 1000;
diff --git a/hurd/report-wait.c b/hurd/report-wait.c
index 2ec1c19202..da0ca3bdb2 100644
--- a/hurd/report-wait.c
+++ b/hurd/report-wait.c
@@ -1,5 +1,5 @@
/* Report on what a thread in our task is waiting for.
- Copyright (C) 1996,97,99,2002 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999,2002,2005 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,8 +23,8 @@
#include <string.h>
#include <assert.h>
#include <hurd/msg_server.h>
-#include "thread_state.h"
-#include "intr-msg.h"
+#include <thread_state.h>
+#include <intr-msg.h>
static char *
describe_number (string_t description, const char *flavor, long int i)
diff --git a/hurd/sigunwind.c b/hurd/sigunwind.c
index 1c6489b3b3..2231518bd0 100644
--- a/hurd/sigunwind.c
+++ b/hurd/sigunwind.c
@@ -18,7 +18,7 @@
02111-1307 USA. */
#include <hurd.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <setjmp.h>
#include <assert.h>
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
index 78f41cb368..ad5a7ee105 100644
--- a/iconv/gconv_conf.c
+++ b/iconv/gconv_conf.c
@@ -46,7 +46,7 @@ struct path_elem *__gconv_path_elem;
size_t __gconv_max_path_elem_len;
/* We use the following struct if we couldn't allocate memory. */
-static const struct path_elem empty_path_elem;
+static const struct path_elem empty_path_elem = { NULL, 0 };
/* Name of the file containing the module information in the directories
along the path. */
diff --git a/include/stdlib.h b/include/stdlib.h
index 49e87576f3..90b779d895 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -10,6 +10,8 @@
/* Now define the internal interfaces. */
#ifndef __Need_M_And_C
+__BEGIN_DECLS
+
extern __typeof (strtol_l) __strtol_l;
extern __typeof (strtoul_l) __strtoul_l;
extern __typeof (strtoll_l) __strtoll_l;
@@ -197,6 +199,8 @@ __strtoull_l (__const char * __restrict __nptr, char **__restrict __endptr,
extern void * __default_morecore (ptrdiff_t);
libc_hidden_proto (__default_morecore)
+__END_DECLS
+
#undef __Need_M_And_C
#endif /* include/stdlib.h */
diff --git a/include/time.h b/include/time.h
index c2171ef449..adf2dea1ec 100644
--- a/include/time.h
+++ b/include/time.h
@@ -5,6 +5,8 @@
# include <time/time.h>
# include <xlocale.h>
+__BEGIN_DECLS
+
extern __typeof (strftime_l) __strftime_l;
libc_hidden_proto (__strftime_l)
extern __typeof (strptime_l) __strptime_l;
@@ -89,6 +91,8 @@ extern int __getclktck (void);
/* strptime support. */
/* Status of lookup: do we use the locale data or the raw data? */
+#ifndef __cplusplus
+// C++ cannot deal with using 'not'.
enum ptime_locale_status { not, loc, raw };
extern char * __strptime_internal (const char *rp, const char *fmt,
@@ -96,6 +100,7 @@ extern char * __strptime_internal (const char *rp, const char *fmt,
enum ptime_locale_status *decided,
int era_cnt, __locale_t locparam)
internal_function;
+#endif
extern double __difftime (time_t time1, time_t time0);
@@ -105,5 +110,8 @@ extern double __difftime (time_t time1, time_t time0);
#ifndef _ISOMAC
# define CLOCK_IDFIELD_SIZE 3
#endif
+
+__END_DECLS
+
#endif
#endif
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index 7ffb4ab590..2c06a91113 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
@@ -270,7 +270,10 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
* (1 << pop (mask))
* sizeof (struct loaded_l10nfile *)));
if (retval == NULL)
- return NULL;
+ {
+ free (abs_filename);
+ return NULL;
+ }
retval->filename = abs_filename;
/* If more than one directory is in the list this is a pseudo-entry
diff --git a/mach/setup-thread.c b/mach/setup-thread.c
index 937e9ca593..fecffd9f06 100644
--- a/mach/setup-thread.c
+++ b/mach/setup-thread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,94,95,97,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,94,1995,1997,2002,2005 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 @@
02111-1307 USA. */
#include <mach.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <string.h>
#include <mach/machine/vm_param.h>
#include "sysdep.h" /* Defines stack direction. */
diff --git a/manual/errno.texi b/manual/errno.texi
index c799d268f8..e230506427 100644
--- a/manual/errno.texi
+++ b/manual/errno.texi
@@ -1229,6 +1229,42 @@ They are not yet documented.}
@comment errno ???/???
@end deftypevr
+@comment errno.h
+@comment Linux: Required key not available
+@deftypevr Macro int ENOKEY
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux: Key has expired
+@deftypevr Macro int EKEYEXPIRED
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux: Key has been revoked
+@deftypevr Macro int EKEYREVOKED
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux: Key was rejected by service
+@deftypevr Macro int EKEYREJECTED
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux: Owner died
+@deftypevr Macro int EOWNERDEAD
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux: State not recoverable
+@deftypevr Macro int ENOTRECOVERABLE
+@comment errno ???/???
+@end deftypevr
+
@node Error Messages, , Error Codes, Error Reporting
@section Error Messages
diff --git a/misc/syslog.c b/misc/syslog.c
index cae13f876b..6b0e7748fe 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -35,6 +35,7 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/uio.h>
+#include <sys/un.h>
#include <netdb.h>
#include <errno.h>
@@ -326,7 +327,7 @@ vsyslog(pri, fmt, ap)
}
libc_hidden_def (vsyslog)
-static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
+static struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
static void
@@ -342,9 +343,9 @@ openlog_internal(const char *ident, int logstat, int logfac)
int retry = 0;
while (retry < 2) {
if (LogFile == -1) {
- SyslogAddr.sa_family = AF_UNIX;
- (void)strncpy(SyslogAddr.sa_data, _PATH_LOG,
- sizeof(SyslogAddr.sa_data));
+ SyslogAddr.sun_family = AF_UNIX;
+ (void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
+ sizeof(SyslogAddr.sun_path));
if (LogStat & LOG_NDELAY) {
if ((LogFile = __socket(AF_UNIX, LogType, 0))
== -1)
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index cc4fc0ec5d..7c0030cd09 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,98 @@
+2005-12-26 Ulrich Drepper <drepper@redhat.com>
+
+ * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
+ PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
+ and PTHREAD_MUTEXATTR_FLAG_BITS.
+ * descr.h (struct pthread): Add robust_list field and define
+ ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
+ * pthread_mutexattr_getrobust.c: New file.
+ * pthread_mutexattr_setrobust.c: New file.
+ * pthread_mutex_consistent.c: New file.
+ * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
+ pthread_mutexattr_setrobust, and pthread_mutex_consistent.
+ Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
+ Adjust pthread_mutex_t initializers.
+ * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
+ field to pthread_mutex_t.
+ * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
+ and __prev field to pthread_mutex_t.
+ * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
+ pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
+ * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
+ and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
+ * pthread_mutexattr_gettype.c: Likewise.
+ * pthread_mutexattr_setpshared.c: Likewise.
+ * pthread_mutexattr_settype.c: Likewise.
+ * pthread_mutex_init.c: Reject robust+pshared attribute for now.
+ Initialize mutex kind according to robust flag.
+ * pthread_mutex_lock.c: Implement local robust mutex.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+ * pthread_create.c (start_thread): Mark robust mutexes which remained
+ locked as dead.
+ * tst-robust1.c: New file.
+ * tst-robust2.c: New file.
+ * tst-robust3.c: New file.
+ * tst-robust4.c: New file.
+ * tst-robust5.c: New file.
+ * tst-robust6.c: New file.
+ * tst-robust7.c: New file.
+ * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
+ pthread_mutexattr_setrobust, and pthread_mutex_consistent.
+ (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
+ tst-robust5, tst-robust6, and tst-robust7.
+
+ * tst-typesizes.c: New file.
+ * Makefile (tests): Add tst-typesizes.
+
+ * tst-once3.c: More debug output.
+
+2005-12-24 Ulrich Drepper <drepper@redhat.com>
+
+ * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
+ missing after last change.
+
+ * version.c: Update cpoyright year.
+
+2005-12-23 Ulrich Drepper <drepper@redhat.com>
+
+ * pthread_mutex_destroy.c: Set mutex type to an invalid value.
+ * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
+ * pthread_mutex_trylock.c: Likewise.
+ * pthread_mutex_timedlock.c: Likewise.
+ * pthread_mutex_unlock.c: Likewise.
+
+2005-12-22 Roland McGrath <roland@redhat.com>
+
+ * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
+ so that #include_next's search location is not reset to the -I..
+ directory where <nptl/...> can be found.
+
+2005-12-22 Ulrich Drepper <drepper@redhat.com>
+
+ [BZ #1913]
+ * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
+ Fix unwind info. Remove useless branch prediction prefix.
+ * tst-cancel24.cc: New file.
+ * Makefile: Add rules to build and run tst-cancel24.
+
+2005-12-21 Roland McGrath <roland@redhat.com>
+
+ * libc-cancellation.c: Use <> rather than "" #includes.
+ * pt-cleanup.c: Likewise.
+ * pthread_create.c: Likewise.
+ * pthread_join.c: Likewise.
+ * pthread_timedjoin.c: Likewise.
+ * pthread_tryjoin.c: Likewise.
+ * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
+ * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
+ * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
+ * unwind.c: Likewise.
+
2005-12-19 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
diff --git a/nptl/Makefile b/nptl/Makefile
index dbe84b1c4f..a3b11730a1 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -116,6 +116,8 @@ libpthread-routines = init vars events version \
pthread_kill_other_threads \
pthread_getaffinity pthread_setaffinity \
pthread_attr_getaffinity pthread_attr_setaffinity \
+ pthread_mutexattr_getrobust pthread_mutexattr_setrobust \
+ pthread_mutex_consistent \
cleanup_routine unwind-forcedunwind
# pthread_setuid pthread_seteuid pthread_setreuid \
# pthread_setresuid \
@@ -189,7 +191,8 @@ CFLAGS-pt-system.c = -fexceptions
omit-deps = $(unix-syscalls:%=ptw-%)
-tests = tst-attr1 tst-attr2 tst-attr3 \
+tests = tst-typesizes \
+ tst-attr1 tst-attr2 tst-attr3 \
tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \
tst-mutex7 tst-mutex8 tst-mutex9 tst-mutex5a tst-mutex7a \
tst-spin1 tst-spin2 tst-spin3 \
@@ -197,6 +200,8 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
tst-cond20 tst-cond21 \
+ tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
+ tst-robust6 tst-robust7 \
tst-rwlock1 tst-rwlock2 tst-rwlock3 tst-rwlock4 tst-rwlock5 \
tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 tst-rwlock10 \
tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \
@@ -220,7 +225,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \
tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \
- tst-cancel21 tst-cancel22 tst-cancel23 \
+ tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 \
tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
tst-flock1 tst-flock2 \
tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
@@ -479,6 +484,8 @@ $(objpfx)tst-clock2: $(common-objpfx)rt/librt.a
$(objpfx)tst-rwlock14: $(common-objpfx)rt/librt.a
endif
+LDFLAGS-tst-cancel24 = -lstdc++
+
extra-B-pthread.so = -B$(common-objpfx)nptl/
$(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs))
$(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs))
diff --git a/nptl/Versions b/nptl/Versions
index 79bf190c3a..2b4dd01ab5 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -232,6 +232,11 @@ libpthread {
pthread_setschedprio;
}
+ GLIBC_2.4 {
+ pthread_mutexattr_getrobust_np; pthread_mutexattr_setrobust_np;
+ pthread_mutex_consistent_np;
+ };
+
GLIBC_PRIVATE {
__pthread_initialize_minimal;
__pthread_clock_gettime; __pthread_clock_settime;
diff --git a/nptl/descr.h b/nptl/descr.h
index aaef9bc621..a9f830ef0b 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -134,6 +134,51 @@ struct pthread
/* Process ID - thread group ID in kernel speak. */
pid_t pid;
+ /* List of robust mutexes the thread is holding. */
+ pthread_mutex_t *robust_list;
+
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+# define ENQUEUE_MUTEX(mutex) \
+ do { \
+ mutex->__data.__next = THREAD_GETMEM (THREAD_SELF, robust_list); \
+ THREAD_SETMEM (THREAD_SELF, robust_list, mutex); \
+ if (mutex->__data.__next != NULL) \
+ mutex->__data.__next->__data.__prev = mutex; \
+ mutex->__data.__prev = NULL; \
+ } while (0)
+# define DEQUEUE_MUTEX(mutex) \
+ do { \
+ if (mutex->__data.__prev == NULL) \
+ THREAD_SETMEM (THREAD_SELF, robust_list, mutex->__data.__next); \
+ else \
+ mutex->__data.__prev->__data.__next = mutex->__data.__next; \
+ if (mutex->__data.__next != NULL) \
+ mutex->__data.__next->__data.__prev = mutex->__data.__prev; \
+ mutex->__data.__prev = NULL; \
+ mutex->__data.__next = NULL; \
+ } while (0)
+#else
+# define ENQUEUE_MUTEX(mutex) \
+ do { \
+ mutex->__data.__next = THREAD_GETMEM (THREAD_SELF, robust_list); \
+ THREAD_SETMEM (THREAD_SELF, robust_list, mutex); \
+ } while (0)
+# define DEQUEUE_MUTEX(mutex) \
+ do { \
+ pthread_mutex_t *runp = THREAD_GETMEM (THREAD_SELF, robust_list); \
+ if (runp == mutex) \
+ THREAD_SETMEM (THREAD_SELF, robust_list, runp->__data.__next); \
+ else \
+ { \
+ while (runp->__data.__next != mutex) \
+ runp = runp->__data.__next; \
+ \
+ runp->__data.__next = runp->__data.__next->__data.__next; \
+ mutex->__data.__next = NULL; \
+ } \
+ } while (0)
+#endif
+
/* List of cleanup buffers. */
struct _pthread_cleanup_buffer *cleanup;
diff --git a/nptl/libc-cancellation.c b/nptl/libc-cancellation.c
index c9237e0950..b88a32fefd 100644
--- a/nptl/libc-cancellation.c
+++ b/nptl/libc-cancellation.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <setjmp.h>
#include <stdlib.h>
#include "pthreadP.h"
-#include "atomic.h"
+#include <atomic.h>
#include <bits/libc-lock.h>
diff --git a/nptl/pt-cleanup.c b/nptl/pt-cleanup.c
index 96836a14a1..f72ea26e96 100644
--- a/nptl/pt-cleanup.c
+++ b/nptl/pt-cleanup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <setjmp.h>
#include <stdlib.h>
#include "pthreadP.h"
-#include "jmpbuf-unwind.h"
+#include <jmpbuf-unwind.h>
void
__pthread_cleanup_upto (__jmp_buf target, char *targetframe)
@@ -61,4 +61,3 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
THREAD_SETMEM (self, cleanup, cbuf);
}
hidden_def (__pthread_cleanup_upto)
-
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 24168146fa..61b7176159 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -51,6 +51,32 @@
#endif
+/* Magic cookie representing robust mutex with dead owner. */
+#define PTHREAD_MUTEX_OWNERDEAD INT_MAX
+/* Magic cookie representing not recoverable robust mutex. */
+#define PTHREAD_MUTEX_NOTRECOVERABLE (INT_MAX - 1)
+
+
+/* Internal mutex type value. */
+enum
+{
+ PTHREAD_MUTEX_ROBUST_PRIVATE_NP = 256,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP
+ = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_RECURSIVE_NP,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP
+ = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_ERRORCHECK_NP,
+ PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP
+ = PTHREAD_MUTEX_ROBUST_PRIVATE_NP | PTHREAD_MUTEX_ADAPTIVE_NP
+};
+
+
+/* Flags in mutex attr. */
+#define PTHREAD_MUTEXATTR_FLAG_ROBUST 0x40000000
+#define PTHREAD_MUTEXATTR_FLAG_PSHARED 0x80000000
+#define PTHREAD_MUTEXATTR_FLAG_BITS \
+ (PTHREAD_MUTEXATTR_FLAG_ROBUST | PTHREAD_MUTEXATTR_FLAG_PSHARED)
+
+
/* Internal variables. */
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index c11d972572..2dbe58dcd4 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -52,7 +52,7 @@ unsigned int __nptl_nthreads = 1;
#include "allocatestack.c"
/* Code to create the thread. */
-#include "createthread.c"
+#include <createthread.c>
struct pthread *
@@ -310,6 +310,33 @@ start_thread (void *arg)
the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE. */
atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
+ /* If this thread has any robust mutexes locked, handle them now. */
+ pthread_mutex_t *robust = THREAD_GETMEM (pd, robust_list);
+ if (__builtin_expect (robust != NULL, 0))
+ {
+ do
+ {
+ pthread_mutex_t *this = robust;
+ robust = robust->__data.__next;
+
+ assert (lll_mutex_islocked (this->__data.__lock));
+ this->__data.__count = 0;
+ --this->__data.__nusers;
+ assert (this->__data.__owner != PTHREAD_MUTEX_NOTRECOVERABLE);
+ this->__data.__owner = PTHREAD_MUTEX_OWNERDEAD;
+ this->__data.__next = NULL;
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+ this->__data.__prev = NULL;
+#endif
+
+ lll_mutex_unlock (this->__data.__lock);
+ }
+ while (robust != NULL);
+
+ /* Clean up so that the thread descriptor can be reused. */
+ THREAD_SETMEM (pd, robust_list, NULL);
+ }
+
/* If the thread is detached free the TCB. */
if (IS_DETACHED (pd))
/* Free the TCB. */
diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c
index f94128dd96..70dc81a023 100644
--- a/nptl/pthread_join.c
+++ b/nptl/pthread_join.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
-#include "atomic.h"
+#include <atomic.h>
#include "pthreadP.h"
diff --git a/sysdeps/generic/bits/uio.h b/nptl/pthread_mutex_consistent.c
index 410ce2a98a..2edfe8a5a6 100644
--- a/sysdeps/generic/bits/uio.h
+++ b/nptl/pthread_mutex_consistent.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,17 +17,20 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _SYS_UIO_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
+#include <errno.h>
+#include <pthreadP.h>
-/* `struct iovec' -- Structure describing a section of memory. */
-
-struct iovec
+int
+pthread_mutex_consistent_np (mutex)
+ pthread_mutex_t *mutex;
{
- /* Starting address. */
- __ptr_t iov_base;
- /* Length in bytes. */
- size_t iov_len;
-};
+ /* Test whether this is a robust mutex with a dead owner. */
+ if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_PRIVATE_NP) == 0
+ || mutex->__data.__owner != -THREAD_GETMEM (THREAD_SELF, tid))
+ return EINVAL;
+
+ mutex->__data.__owner = -mutex->__data.__owner;
+
+ return 0;
+}
diff --git a/nptl/pthread_mutex_destroy.c b/nptl/pthread_mutex_destroy.c
index 91ccfb0d29..2bf76a9da3 100644
--- a/nptl/pthread_mutex_destroy.c
+++ b/nptl/pthread_mutex_destroy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -28,6 +28,9 @@ __pthread_mutex_destroy (mutex)
if (mutex->__data.__nusers != 0)
return EBUSY;
+ /* Set to an invalid value. */
+ mutex->__data.__kind = -1;
+
return 0;
}
strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)
diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c
index 074941daf3..17d1c99575 100644
--- a/nptl/pthread_mutex_init.c
+++ b/nptl/pthread_mutex_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <assert.h>
+#include <errno.h>
#include <string.h>
#include "pthreadP.h"
@@ -40,17 +41,26 @@ __pthread_mutex_init (mutex, mutexattr)
imutexattr = (const struct pthread_mutexattr *) mutexattr ?: &default_attr;
+ /* Sanity checks. */
+ // XXX For now we cannot implement robust mutexes if they are shared.
+ if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0
+ && (imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0)
+ return ENOTSUP;
+
/* Clear the whole variable. */
memset (mutex, '\0', __SIZEOF_PTHREAD_MUTEX_T);
/* Copy the values from the attribute. */
- mutex->__data.__kind = imutexattr->mutexkind & ~0x80000000;
+ mutex->__data.__kind = imutexattr->mutexkind & ~PTHREAD_MUTEXATTR_FLAG_BITS;
+ if ((imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0)
+ mutex->__data.__kind |= PTHREAD_MUTEX_ROBUST_PRIVATE_NP;
/* Default values: mutex not used yet. */
// mutex->__count = 0; already done by memset
// mutex->__owner = 0; already done by memset
// mutex->__nusers = 0; already done by memset
// mutex->__spins = 0; already done by memset
+ // mutex->__next = NULL; already done by memset
return 0;
}
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index ee39f20820..420711a4d4 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,6 +19,7 @@
#include <assert.h>
#include <errno.h>
+#include <stdlib.h>
#include "pthreadP.h"
#include <lowlevellock.h>
@@ -37,6 +38,7 @@ __pthread_mutex_lock (mutex)
pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
+ int retval = 0;
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
@@ -57,23 +59,23 @@ __pthread_mutex_lock (mutex)
/* We have to get the mutex. */
LLL_MUTEX_LOCK (mutex->__data.__lock);
+ assert (mutex->__data.__owner == 0);
mutex->__data.__count = 1;
break;
/* Error checking mutex. */
case PTHREAD_MUTEX_ERRORCHECK_NP:
/* Check whether we already hold the mutex. */
- if (mutex->__data.__owner == id)
+ if (__builtin_expect (mutex->__data.__owner == id, 0))
return EDEADLK;
/* FALLTHROUGH */
- default:
- /* Correct code cannot set any other type. */
case PTHREAD_MUTEX_TIMED_NP:
simple:
/* Normal mutex. */
LLL_MUTEX_LOCK (mutex->__data.__lock);
+ assert (mutex->__data.__owner == 0);
break;
case PTHREAD_MUTEX_ADAPTIVE_NP:
@@ -101,17 +103,79 @@ __pthread_mutex_lock (mutex)
mutex->__data.__spins += (cnt - mutex->__data.__spins) / 8;
}
+ assert (mutex->__data.__owner == 0);
+ break;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP:
+ /* Check whether we already hold the mutex. */
+ if (abs (mutex->__data.__owner) == id)
+ {
+ /* Just bump the counter. */
+ if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+ /* Overflow of the counter. */
+ return EAGAIN;
+
+ ++mutex->__data.__count;
+
+ return 0;
+ }
+
+ /* We have to get the mutex. */
+ LLL_MUTEX_LOCK (mutex->__data.__lock);
+
+ mutex->__data.__count = 1;
+
+ goto robust;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP:
+ /* Check whether we already hold the mutex. */
+ if (__builtin_expect (abs (mutex->__data.__owner) == id, 0))
+ return EDEADLK;
+
+ /* FALLTHROUGH */
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_NP:
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP:
+ LLL_MUTEX_LOCK (mutex->__data.__lock);
+
+ robust:
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_NOTRECOVERABLE, 0))
+ {
+ /* This mutex is now not recoverable. */
+ mutex->__data.__count = 0;
+ lll_mutex_unlock (mutex->__data.__lock);
+ return ENOTRECOVERABLE;
+ }
+
+ /* This mutex is either healthy or we can try to recover it. */
+ assert (mutex->__data.__owner == 0
+ || mutex->__data.__owner == PTHREAD_MUTEX_OWNERDEAD);
+
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_OWNERDEAD, 0))
+ {
+ retval = EOWNERDEAD;
+ /* We signal ownership of a not yet recovered robust mutex
+ by storing the negative thread ID. */
+ id = -id;
+ }
+
+ ENQUEUE_MUTEX (mutex);
break;
+
+ default:
+ /* Correct code cannot set any other type. */
+ return EINVAL;
}
/* Record the ownership. */
- assert (mutex->__data.__owner == 0);
mutex->__data.__owner = id;
#ifndef NO_INCR
++mutex->__data.__nusers;
#endif
- return 0;
+ return retval;
}
#ifndef __pthread_mutex_lock
strong_alias (__pthread_mutex_lock, pthread_mutex_lock)
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index 1cd2c7e606..bc4ead765d 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <assert.h>
#include <errno.h>
#include "pthreadP.h"
#include <lowlevellock.h>
@@ -49,17 +50,15 @@ pthread_mutex_timedlock (mutex, abstime)
goto out;
}
- else
- {
- /* We have to get the mutex. */
- result = lll_mutex_timedlock (mutex->__data.__lock, abstime);
- if (result != 0)
- goto out;
+ /* We have to get the mutex. */
+ result = lll_mutex_timedlock (mutex->__data.__lock, abstime);
- /* Only locked once so far. */
- mutex->__data.__count = 1;
- }
+ if (result != 0)
+ goto out;
+
+ /* Only locked once so far. */
+ mutex->__data.__count = 1;
break;
/* Error checking mutex. */
@@ -70,8 +69,6 @@ pthread_mutex_timedlock (mutex, abstime)
/* FALLTHROUGH */
- default:
- /* Correct code cannot set any other type. */
case PTHREAD_MUTEX_TIMED_NP:
simple:
/* Normal mutex. */
@@ -104,6 +101,75 @@ pthread_mutex_timedlock (mutex, abstime)
mutex->__data.__spins += (cnt - mutex->__data.__spins) / 8;
}
break;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP:
+ /* Check whether we already hold the mutex. */
+ if (abs (mutex->__data.__owner) == id)
+ {
+ /* Just bump the counter. */
+ if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+ /* Overflow of the counter. */
+ return EAGAIN;
+
+ ++mutex->__data.__count;
+
+ goto out;
+ }
+
+ /* We have to get the mutex. */
+ result = lll_mutex_timedlock (mutex->__data.__lock, abstime);
+
+ if (result != 0)
+ goto out;
+
+ /* Only locked once so far. */
+ mutex->__data.__count = 1;
+ goto robust;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP:
+ /* Check whether we already hold the mutex. */
+ if (__builtin_expect (abs (mutex->__data.__owner) == id, 0))
+ return EDEADLK;
+
+ /* FALLTHROUGH */
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_NP:
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP:
+ result = lll_mutex_timedlock (mutex->__data.__lock, abstime);
+
+ if (result != 0)
+ goto out;
+
+ robust:
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_NOTRECOVERABLE, 0))
+ {
+ /* This mutex is now not recoverable. */
+ mutex->__data.__count = 0;
+ lll_mutex_unlock (mutex->__data.__lock);
+ return ENOTRECOVERABLE;
+ }
+
+ /* This mutex is either healthy or we can try to recover it. */
+ assert (mutex->__data.__owner == 0
+ || mutex->__data.__owner == PTHREAD_MUTEX_OWNERDEAD);
+
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_OWNERDEAD, 0))
+ {
+ result = EOWNERDEAD;
+ /* We signal ownership of a not yet recovered robust mutex
+ by storing the negative thread ID. */
+ mutex->__data.__owner = -id;
+ ++mutex->__data.__nusers;
+ }
+
+ ENQUEUE_MUTEX (mutex);
+ break;
+
+ default:
+ /* Correct code cannot set any other type. */
+ return EINVAL;
}
if (result == 0)
diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
index 7008af3d97..ae73ecc39b 100644
--- a/nptl/pthread_mutex_trylock.c
+++ b/nptl/pthread_mutex_trylock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,7 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <assert.h>
#include <errno.h>
+#include <stdlib.h>
#include "pthreadP.h"
#include <lowlevellock.h>
@@ -26,13 +28,12 @@ int
__pthread_mutex_trylock (mutex)
pthread_mutex_t *mutex;
{
- pid_t id;
+ pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
/* Recursive mutex. */
case PTHREAD_MUTEX_RECURSIVE_NP:
- id = THREAD_GETMEM (THREAD_SELF, tid);
/* Check whether we already hold the mutex. */
if (mutex->__data.__owner == id)
{
@@ -56,20 +57,96 @@ __pthread_mutex_trylock (mutex)
break;
case PTHREAD_MUTEX_ERRORCHECK_NP:
- /* Error checking mutex. We do not check for deadlocks. */
- default:
- /* Correct code cannot set any other type. */
+ /* Check whether we already hold the mutex. */
+ if (__builtin_expect (mutex->__data.__owner == id, 0))
+ return EDEADLK;
+
+ /* FALLTHROUGH */
+
case PTHREAD_MUTEX_TIMED_NP:
case PTHREAD_MUTEX_ADAPTIVE_NP:
/* Normal mutex. */
- if (lll_mutex_trylock (mutex->__data.__lock) == 0)
+ if (lll_mutex_trylock (mutex->__data.__lock) != 0)
+ break;
+
+ /* Record the ownership. */
+ mutex->__data.__owner = id;
+ ++mutex->__data.__nusers;
+
+ return 0;
+
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP:
+ /* Check whether we already hold the mutex. */
+ if (abs (mutex->__data.__owner) == id)
{
- /* Record the ownership. */
- mutex->__data.__owner = THREAD_GETMEM (THREAD_SELF, tid);
- ++mutex->__data.__nusers;
+ /* Just bump the counter. */
+ if (__builtin_expect (mutex->__data.__count + 1 == 0, 0))
+ /* Overflow of the counter. */
+ return EAGAIN;
+
+ ++mutex->__data.__count;
return 0;
}
+
+ /* We have to get the mutex. */
+ if (lll_mutex_trylock (mutex->__data.__lock) == 0)
+ {
+ mutex->__data.__count = 1;
+
+ goto robust;
+ }
+
+ break;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP:
+ /* Check whether we already hold the mutex. */
+ if (__builtin_expect (abs (mutex->__data.__owner) == id, 0))
+ return EDEADLK;
+
+ /* FALLTHROUGH */
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_NP:
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP:
+ if (lll_mutex_trylock (mutex->__data.__lock) != 0)
+ break;
+
+ robust:
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_NOTRECOVERABLE, 0))
+ {
+ /* This mutex is now not recoverable. */
+ mutex->__data.__count = 0;
+ lll_mutex_unlock (mutex->__data.__lock);
+ return ENOTRECOVERABLE;
+ }
+
+ /* This mutex is either healthy or we can try to recover it. */
+ assert (mutex->__data.__owner == 0
+ || mutex->__data.__owner == PTHREAD_MUTEX_OWNERDEAD);
+
+ /* Record the ownership. */
+ int retval = 0;
+ if (__builtin_expect (mutex->__data.__owner
+ == PTHREAD_MUTEX_OWNERDEAD, 0))
+ {
+ retval = EOWNERDEAD;
+ /* We signal ownership of a not yet recovered robust
+ mutex by storing the negative thread ID. */
+ id = -id;
+ }
+
+ ENQUEUE_MUTEX (mutex);
+
+ mutex->__data.__owner = id;
+ ++mutex->__data.__nusers;
+
+ return retval
+;
+ default:
+ /* Correct code cannot set any other type. */
+ return EINVAL;
}
return EBUSY;
diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c
index 32bc2a4bc1..babce51a6f 100644
--- a/nptl/pthread_mutex_unlock.c
+++ b/nptl/pthread_mutex_unlock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <errno.h>
+#include <stdlib.h>
#include "pthreadP.h"
#include <lowlevellock.h>
@@ -28,6 +29,8 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
pthread_mutex_t *mutex;
int decr;
{
+ int newowner = 0;
+
switch (__builtin_expect (mutex->__data.__kind, PTHREAD_MUTEX_TIMED_NP))
{
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -47,16 +50,63 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
return EPERM;
break;
- default:
- /* Correct code cannot set any other type. */
case PTHREAD_MUTEX_TIMED_NP:
case PTHREAD_MUTEX_ADAPTIVE_NP:
/* Normal mutex. Nothing special to do. */
break;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP:
+ /* Recursive mutex. */
+ if (mutex->__data.__owner == -THREAD_GETMEM (THREAD_SELF, tid))
+ {
+ if (--mutex->__data.__count != 0)
+ /* We still hold the mutex. */
+ return ENOTRECOVERABLE;
+
+ goto notrecoverable;
+ }
+
+ if (mutex->__data.__owner != THREAD_GETMEM (THREAD_SELF, tid))
+ return EPERM;
+
+ if (--mutex->__data.__count != 0)
+ /* We still hold the mutex. */
+ return 0;
+
+ goto robust;
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP:
+ /* Error checking mutex. */
+ if (abs (mutex->__data.__owner) != THREAD_GETMEM (THREAD_SELF, tid)
+ || ! lll_mutex_islocked (mutex->__data.__lock))
+ return EPERM;
+
+ /* FALLTHROUGH */
+
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_NP:
+ case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP:
+ /* If the previous owner died and the caller did not succeed in
+ making the state consistent, mark the mutex as unrecoverable
+ and make all waiters. */
+ if (__builtin_expect (mutex->__data.__owner
+ == -THREAD_GETMEM (THREAD_SELF, tid)
+ || (mutex->__data.__owner
+ == PTHREAD_MUTEX_NOTRECOVERABLE), 0))
+ notrecoverable:
+ newowner = PTHREAD_MUTEX_NOTRECOVERABLE;
+
+ robust:
+ /* Remove mutex from the list. */
+ DEQUEUE_MUTEX (mutex);
+ break;
+
+ default:
+ /* Correct code cannot set any other type. */
+ return EINVAL;
}
/* Always reset the owner field. */
- mutex->__data.__owner = 0;
+ mutex->__data.__owner = newowner;
if (decr)
/* One less user. */
--mutex->__data.__nusers;
diff --git a/nptl/pthread_mutexattr_getpshared.c b/nptl/pthread_mutexattr_getpshared.c
index 4bd4ea18db..6454125db2 100644
--- a/nptl/pthread_mutexattr_getpshared.c
+++ b/nptl/pthread_mutexattr_getpshared.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -29,9 +29,7 @@ pthread_mutexattr_getpshared (attr, pshared)
iattr = (const struct pthread_mutexattr *) attr;
- /* We use bit 31 to signal whether the mutex is going to be
- process-shared or not. */
- *pshared = ((iattr->mutexkind & 0x80000000) != 0
+ *pshared = ((iattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0
? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE);
return 0;
diff --git a/sysdeps/generic/bits/ipctypes.h b/nptl/pthread_mutexattr_getrobust.c
index b88ca1d87b..5ec43d1f7c 100644
--- a/sysdeps/generic/bits/ipctypes.h
+++ b/nptl/pthread_mutexattr_getrobust.c
@@ -1,6 +1,6 @@
-/* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic.
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,21 +17,20 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-/*
- * Never include <bits/ipctypes.h> directly.
- */
+#include <pthreadP.h>
-#ifndef _BITS_IPCTYPES_H
-#define _BITS_IPCTYPES_H 1
-#include <bits/types.h>
+int
+pthread_mutexattr_getrobust_np (attr, robustness)
+ const pthread_mutexattr_t *attr;
+ int *robustness;
+{
+ const struct pthread_mutexattr *iattr;
-/* Used in `struct shmid_ds'. */
-# if __WORDSIZE == 32
-typedef unsigned short int __ipc_pid_t;
-# else
-typedef int __ipc_pid_t;
-# endif
+ iattr = (const struct pthread_mutexattr *) attr;
+ *robustness = ((iattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST) != 0
+ ? PTHREAD_MUTEX_ROBUST_NP : PTHREAD_MUTEX_STALLED_NP);
-#endif /* bits/ipctypes.h */
+ return 0;
+}
diff --git a/nptl/pthread_mutexattr_gettype.c b/nptl/pthread_mutexattr_gettype.c
index 5c32b2c6f1..7303703bf4 100644
--- a/nptl/pthread_mutexattr_gettype.c
+++ b/nptl/pthread_mutexattr_gettype.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -29,9 +29,7 @@ pthread_mutexattr_gettype (attr, kind)
iattr = (const struct pthread_mutexattr *) attr;
- /* We use bit 31 to signal whether the mutex is going to be
- process-shared or not. */
- *kind = iattr->mutexkind & ~0x80000000;
+ *kind = iattr->mutexkind & ~PTHREAD_MUTEXATTR_FLAG_BITS;
return 0;
}
diff --git a/nptl/pthread_mutexattr_setpshared.c b/nptl/pthread_mutexattr_setpshared.c
index 5f2cf417e3..8e08b9e161 100644
--- a/nptl/pthread_mutexattr_setpshared.c
+++ b/nptl/pthread_mutexattr_setpshared.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -34,12 +34,10 @@ pthread_mutexattr_setpshared (attr, pshared)
iattr = (struct pthread_mutexattr *) attr;
- /* We use bit 31 to signal whether the mutex is going to be
- process-shared or not. */
if (pshared == PTHREAD_PROCESS_PRIVATE)
- iattr->mutexkind &= ~0x80000000;
+ iattr->mutexkind &= ~PTHREAD_MUTEXATTR_FLAG_PSHARED;
else
- iattr->mutexkind |= 0x80000000;
+ iattr->mutexkind |= PTHREAD_MUTEXATTR_FLAG_PSHARED;
return 0;
}
diff --git a/sysdeps/generic/bits/utmp.h b/nptl/pthread_mutexattr_setrobust.c
index 03a2b1f40b..cf95e35b6f 100644
--- a/sysdeps/generic/bits/utmp.h
+++ b/nptl/pthread_mutexattr_setrobust.c
@@ -1,6 +1,6 @@
-/* The `struct utmp' type, describing entries in the utmp file. Generic/BSDish
- Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -17,34 +17,27 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#ifndef _UTMP_H
-# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
-#endif
+#include <errno.h>
+#include <pthreadP.h>
-#include <paths.h>
-#include <time.h>
+int
+pthread_mutexattr_setrobust_np (attr, robustness)
+ pthread_mutexattr_t *attr;
+ int robustness;
+{
+ if (robustness != PTHREAD_MUTEX_STALLED_NP
+ && __builtin_expect (robustness != PTHREAD_MUTEX_ROBUST_NP, 0))
+ return EINVAL;
-#define UT_NAMESIZE 8
-#define UT_LINESIZE 8
-#define UT_HOSTSIZE 16
+ struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr;
+ /* We use bit 30 to signal whether the mutex is going to be
+ robust or not. */
+ if (robustness == PTHREAD_MUTEX_STALLED_NP)
+ iattr->mutexkind &= ~PTHREAD_MUTEXATTR_FLAG_ROBUST;
+ else
+ iattr->mutexkind |= PTHREAD_MUTEXATTR_FLAG_ROBUST;
-struct lastlog
- {
- time_t ll_time;
- char ll_line[UT_LINESIZE];
- char ll_host[UT_HOSTSIZE];
- };
-
-struct utmp
- {
- char ut_line[UT_LINESIZE];
- char ut_user[UT_NAMESIZE];
-#define ut_name ut_user
- char ut_host[UT_HOSTSIZE];
- long int ut_time;
- };
-
-
-#define _HAVE_UT_HOST 1 /* We have the ut_host field. */
+ return 0;
+}
diff --git a/nptl/pthread_mutexattr_settype.c b/nptl/pthread_mutexattr_settype.c
index c77fe79df5..fe6b5c22cd 100644
--- a/nptl/pthread_mutexattr_settype.c
+++ b/nptl/pthread_mutexattr_settype.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -33,9 +33,7 @@ __pthread_mutexattr_settype (attr, kind)
iattr = (struct pthread_mutexattr *) attr;
- /* We use bit 31 to signal whether the mutex is going to be
- process-shared or not. */
- iattr->mutexkind = (iattr->mutexkind & 0x80000000) | kind;
+ iattr->mutexkind = (iattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_BITS) | kind;
return 0;
}
diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
index 1cc07213c8..5df6ab6a80 100644
--- a/nptl/pthread_timedjoin.c
+++ b/nptl/pthread_timedjoin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,7 +19,7 @@
#include <errno.h>
#include <stdlib.h>
-#include "atomic.h"
+#include <atomic.h>
#include "pthreadP.h"
diff --git a/nptl/pthread_tryjoin.c b/nptl/pthread_tryjoin.c
index 904cb5280b..fc363dd778 100644
--- a/nptl/pthread_tryjoin.c
+++ b/nptl/pthread_tryjoin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
-#include "atomic.h"
+#include <atomic.h>
#include "pthreadP.h"
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index badadae169..5413661eb3 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -60,24 +60,39 @@ enum
#endif
};
-/* Mutex initializers. */
-#define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, 0 } }
+
#ifdef __USE_GNU
-# if __WORDSIZE == 64
+/* Robust mutex or not flags. */
+enum
+{
+ PTHREAD_MUTEX_STALLED_NP,
+ PTHREAD_MUTEX_ROBUST_NP
+};
+#endif
+
+
+/* Mutex initializers. */
+#if __WORDSIZE == 64
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, 0, (void *) 0, (void *) 0 } }
+# ifdef __USE_GNU
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } }
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, (void *) 0, (void *) 0 } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } }
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, (void *) 0, (void *) 0 } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } }
-# else
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, (void *) 0, (void *) 0 } }
+# endif
+#else
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, { 0 } } }
+# ifdef __USE_GNU
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
# endif
#endif
@@ -696,6 +711,12 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+#ifdef __USE_GNU
+/* Declare the state protected by MUTEX as consistent. */
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) __THROW;
+#endif
+
+
/* Functions for handling mutex attributes. */
/* Initialize mutex attribute object ATTR with default attributes
@@ -726,6 +747,16 @@ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
__THROW;
#endif
+#ifdef __USE_GNU
+/* Get the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
+ int *__robustness) __THROW;
+
+/* Set the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+ int __robustness) __THROW;
+#endif
+
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Functions for handling read-write locks. */
diff --git a/nptl/sysdeps/pthread/sigaction.c b/nptl/sysdeps/pthread/sigaction.c
index 4d36150a90..445a2cb36f 100644
--- a/nptl/sysdeps/pthread/sigaction.c
+++ b/nptl/sysdeps/pthread/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -28,7 +28,11 @@
SIGCANCEL or SIGTIMER to be handled. */
# define LIBC_SIGACTION 1
-# include <nptl/sysdeps/pthread/sigaction.c>
+/* Note this include must be one that isn't found using a -I directory such
+ as -I. or -I.. for using an explicit <sysdeps/...> path, because that
+ would reset the search path starting position for the #include_next
+ below, to after that -I directory, and skip the search we want to do. */
+# include "sigaction.c"
int
__sigaction (sig, act, oact)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
index ddb3574aaa..3bd1019995 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
@@ -45,7 +45,7 @@ typedef union
/* Data structures for mutex handling. The structure of the attribute
type is not exposed on purpose. */
-typedef union
+typedef union __pthread_mutex_u
{
struct
{
@@ -56,7 +56,11 @@ typedef union
binary compatibility. */
int __kind;
unsigned int __nusers;
- int __spins;
+ union
+ {
+ int __spins;
+ union __pthread_mutex_u *__next;
+ };
} __data;
char __size[__SIZEOF_PTHREAD_MUTEX_T];
long int __align;
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index 1605b69b69..3e908aef9c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -57,7 +57,7 @@ __new_sem_wait:
cfi_offset(6, -12) /* %esi */
3: movl (%ebx), %eax
2: testl %eax, %eax
- je,pn 1f
+ je 1f
leal -1(%eax), %edx
LOCK
@@ -73,7 +73,7 @@ __new_sem_wait:
cfi_adjust_cfa_offset(-12)
ret
- cfi_adjust_cfa_offset(8)
+ cfi_adjust_cfa_offset(12)
cfi_offset(3, -8) /* %ebx */
cfi_offset(6, -12) /* %esi */
1: call __pthread_enable_asynccancel
diff --git a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
index 3d1c021819..4e60596f7d 100644
--- a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+++ b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <list.h>
-#include "fork.h"
+#include <fork.h>
#include <dl-sysdep.h>
#include <tls.h>
#include <string.h>
diff --git a/nptl/sysdeps/unix/sysv/linux/register-atfork.c b/nptl/sysdeps/unix/sysv/linux/register-atfork.c
index 9707e4663c..cb5b2b832f 100644
--- a/nptl/sysdeps/unix/sysv/linux/register-atfork.c
+++ b/nptl/sysdeps/unix/sysv/linux/register-atfork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include "fork.h"
+#include <fork.h>
/* Lock to protect allocation and deallocation of fork handlers. */
diff --git a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
index 72c8d615eb..964f5b7094 100644
--- a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
+++ b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,7 +19,7 @@
#include <errno.h>
#include <stdlib.h>
-#include "fork.h"
+#include <fork.h>
#include <atomic.h>
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
index 7f1ace693c..3eb33a8646 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
@@ -59,7 +59,7 @@ typedef union
/* Data structures for mutex handling. The structure of the attribute
type is not exposed on purpose. */
-typedef union
+typedef union __pthread_mutex_u
{
struct
{
@@ -72,10 +72,19 @@ typedef union
/* KIND must stay at this position in the structure to maintain
binary compatibility. */
int __kind;
-#if __WORDSIZE != 64
+#if __WORDSIZE == 64
+ int __spins;
+ union __pthread_mutex_u *__next;
+ union __pthread_mutex_u *__prev;
+# define __PTHREAD_MUTEX_HAVE_PREV 1
+#else
unsigned int __nusers;
+ union
+ {
+ int __spins;
+ union __pthread_mutex_u *__next;
+ };
#endif
- int __spins;
} __data;
char __size[__SIZEOF_PTHREAD_MUTEX_T];
long int __align;
diff --git a/nptl/tst-cancel24.cc b/nptl/tst-cancel24.cc
new file mode 100644
index 0000000000..52cf079d5a
--- /dev/null
+++ b/nptl/tst-cancel24.cc
@@ -0,0 +1,113 @@
+#include <cstdlib>
+#include <cstdio>
+#include <pthread.h>
+#include <semaphore.h>
+#include <unistd.h>
+
+
+static volatile bool destr_called;
+static volatile bool except_caught;
+
+static pthread_barrier_t b;
+
+
+struct monitor
+{
+ // gcc is broken and would generate a warning without this dummy
+ // constructor.
+ monitor () { }
+ ~monitor() { destr_called = true; }
+};
+
+
+static void *
+tf (void *arg)
+{
+ sem_t *s = static_cast<sem_t *> (arg);
+
+ try
+ {
+ monitor m;
+
+ pthread_barrier_wait (&b);
+
+ while (1)
+ sem_wait (s);
+ }
+ catch (...)
+ {
+ except_caught = true;
+ throw;
+ }
+
+ return NULL;
+}
+
+
+static int
+do_test ()
+{
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
+ sem_t s;
+ if (sem_init (&s, 0, 0) != 0)
+ {
+ puts ("sem_init failed");
+ return 1;
+ }
+
+ pthread_t th;
+ if (pthread_create (&th, NULL, tf, &s) != 0)
+ {
+ puts ("pthread_create failed");
+ return 1;
+ }
+
+ pthread_barrier_wait (&b);
+
+ /* There is unfortunately no better method to try to assure the
+ child thread reached the sem_wait call and is actually waiting
+ than to sleep here. */
+ sleep (1);
+
+ if (pthread_cancel (th) != 0)
+ {
+ puts ("cancel failed");
+ return 1;
+ }
+
+ void *res;
+ if (pthread_join (th, &res) != 0)
+ {
+ puts ("join failed");
+ return 1;
+ }
+
+ if (res != PTHREAD_CANCELED)
+ {
+ puts ("thread was not canceled");
+ return 1;
+ }
+
+ if (! except_caught)
+ {
+ puts ("exception not caught");
+ return 1;
+ }
+
+ if (! destr_called)
+ {
+ puts ("destructor not called");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#define TIMEOUT 3
+#include "../test-skeleton.c"
diff --git a/nptl/tst-once3.c b/nptl/tst-once3.c
index 43b354a391..1a74abb530 100644
--- a/nptl/tst-once3.c
+++ b/nptl/tst-once3.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -52,6 +52,8 @@ once_handler1 (void)
exit (1);
}
+ puts ("once_handler1: going to wait on cond");
+
pthread_cond_wait (&cond, &mut);
/* We should never get here. */
@@ -139,6 +141,9 @@ do_test (void)
puts ("join didn't return PTHREAD_CANCELED");
return 1;
}
+ puts ("joined successfully");
+
+ printf ("once = %d\n", *(int *) &once);
if (cl_called != 1)
{
diff --git a/nptl/tst-robust1.c b/nptl/tst-robust1.c
new file mode 100644
index 0000000000..13267a5efd
--- /dev/null
+++ b/nptl/tst-robust1.c
@@ -0,0 +1,245 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
+
+ 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 <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+static pthread_mutex_t m;
+static pthread_barrier_t b;
+
+
+#ifndef LOCK
+# define LOCK(m) pthread_mutex_lock (m)
+#endif
+
+
+static void *
+tf (void *arg)
+{
+ long int round = (long int) arg;
+
+ if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL) != 0)
+ {
+ printf ("%ld: setcancelstate failed\n", round);
+ exit (1);
+ }
+
+ int e = LOCK (&m);
+ if (e != 0)
+ {
+ printf ("%ld: child: mutex_lock failed with error %d\n", round, e);
+ exit (1);
+ }
+
+ e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ printf ("%ld: child: 1st barrier_wait failed\n", round);
+ exit (1);
+ }
+
+ e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ printf ("%ld: child: 2nd barrier_wait failed\n", round);
+ exit (1);
+ }
+
+ pthread_testcancel ();
+
+ printf ("%ld: testcancel returned\n", round);
+ exit (1);
+}
+
+
+static int
+do_test (void)
+{
+#ifdef PREPARE_TMO
+ PREPARE_TMO;
+#endif
+
+ pthread_mutexattr_t a;
+ if (pthread_mutexattr_init (&a) != 0)
+ {
+ puts ("mutexattr_init failed");
+ return 1;
+ }
+ if (pthread_mutexattr_setrobust_np (&a, PTHREAD_MUTEX_ROBUST_NP) != 0)
+ {
+ puts ("mutexattr_setrobust failed");
+ return 1;
+ }
+#ifndef NOT_CONSISTENT
+ if (pthread_mutex_init (&m, &a) != 0)
+ {
+ puts ("mutex_init failed");
+ return 1;
+ }
+#endif
+
+ if (pthread_barrier_init (&b, NULL, 2) != 0)
+ {
+ puts ("barrier_init failed");
+ return 1;
+ }
+
+ for (long int round = 1; round < 5; ++round)
+ {
+#ifdef NOT_CONSISTENT
+ if (pthread_mutex_init (&m, &a) != 0)
+ {
+ puts ("mutex_init failed");
+ return 1;
+ }
+#endif
+
+ pthread_t th;
+ if (pthread_create (&th, NULL, tf, (void *) round) != 0)
+ {
+ printf ("%ld: create failed\n", round);
+ return 1;
+ }
+
+ int e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ printf ("%ld: parent: 1st barrier_wait failed\n", round);
+ return 1;
+ }
+
+ if (pthread_cancel (th) != 0)
+ {
+ printf ("%ld: cancel failed\n", round);
+ return 1;
+ }
+
+ e = pthread_barrier_wait (&b);
+ if (e != 0 && e != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ printf ("%ld: parent: 2nd barrier_wait failed\n", round);
+ return 1;
+ }
+
+#ifndef AFTER_JOIN
+ if (round & 1)
+#endif
+ {
+ void *res;
+ if (pthread_join (th, &res) != 0)
+ {
+ printf ("%ld: join failed\n", round);
+ return 1;
+ }
+ if (res != PTHREAD_CANCELED)
+ {
+ printf ("%ld: thread not canceled\n", round);
+ return 1;
+ }
+ }
+
+ e = LOCK (&m);
+ if (e == 0)
+ {
+ printf ("%ld: parent: mutex_lock succeeded\n", round);
+ return 1;
+ }
+ if (e != EOWNERDEAD)
+ {
+ printf ("%ld: parent: mutex_lock returned wrong code\n", round);
+ return 1;
+ }
+
+#ifndef AFTER_JOIN
+ if ((round & 1) == 0)
+ {
+ void *res;
+ if (pthread_join (th, &res) != 0)
+ {
+ printf ("%ld: join failed\n", round);
+ return 1;
+ }
+ if (res != PTHREAD_CANCELED)
+ {
+ printf ("%ld: thread not canceled\n", round);
+ return 1;
+ }
+ }
+#endif
+
+#ifndef NOT_CONSISTENT
+ e = pthread_mutex_consistent_np (&m);
+ if (e != 0)
+ {
+ printf ("%ld: mutex_consistent failed with error %d\n", round, e);
+ return 1;
+ }
+#endif
+
+ e = pthread_mutex_unlock (&m);
+ if (e != 0)
+ {
+ printf ("%ld: mutex_unlocked failed\n", round);
+ return 1;
+ }
+
+#ifdef NOT_CONSISTENT
+ e = LOCK (&m);
+ if (e == 0)
+ {
+ printf ("%ld: locking inconsistent mutex succeeded\n", round);
+ return 1;
+ }
+ if (e != ENOTRECOVERABLE)
+ {
+ printf ("%ld: locking inconsistent mutex failed with error %d\n",
+ round, e);
+ return 1;
+ }
+
+ if (pthread_mutex_destroy (&m) != 0)
+ {
+ puts ("mutex_destroy failed");
+ return 1;
+ }
+#endif
+ }
+
+#ifndef NOT_CONSISTENT
+ if (pthread_mutex_destroy (&m) != 0)
+ {
+ puts ("mutex_destroy failed");
+ return 1;
+ }
+#endif
+
+ if (pthread_mutexattr_destroy (&a) != 0)
+ {
+ puts ("mutexattr_destroy failed");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/nptl/tst-robust2.c b/nptl/tst-robust2.c
new file mode 100644
index 0000000000..cf603feb4d
--- /dev/null
+++ b/nptl/tst-robust2.c
@@ -0,0 +1,3 @@
+#define AFTER_JOIN 1
+#define LOCK(m) pthread_mutex_trylock (m)
+#include "tst-robust1.c"
diff --git a/nptl/tst-robust3.c b/nptl/tst-robust3.c
new file mode 100644
index 0000000000..e56f2762c7
--- /dev/null
+++ b/nptl/tst-robust3.c
@@ -0,0 +1,20 @@
+#include <time.h>
+#include <sys/time.h>
+
+
+static struct timespec tmo;
+
+
+#define PREPARE_TMO \
+ do { \
+ struct timeval tv; \
+ gettimeofday (&tv, NULL); \
+ \
+ /* Define the timeout as one hour in the future. */ \
+ tmo.tv_sec = tv.tv_sec + 3600; \
+ tmo.tv_nsec = 0; \
+ } while (0)
+
+
+#define LOCK(m) pthread_mutex_timedlock (m, &tmo)
+#include "tst-robust1.c"
diff --git a/nptl/tst-robust4.c b/nptl/tst-robust4.c
new file mode 100644
index 0000000000..b9c42b85b9
--- /dev/null
+++ b/nptl/tst-robust4.c
@@ -0,0 +1,2 @@
+#define NOT_CONSISTENT 1
+#include "tst-robust1.c"
diff --git a/nptl/tst-robust5.c b/nptl/tst-robust5.c
new file mode 100644
index 0000000000..b83d3d66cb
--- /dev/null
+++ b/nptl/tst-robust5.c
@@ -0,0 +1,2 @@
+#define NOT_CONSISTENT 1
+#include "tst-robust2.c"
diff --git a/nptl/tst-robust6.c b/nptl/tst-robust6.c
new file mode 100644
index 0000000000..6713396de1
--- /dev/null
+++ b/nptl/tst-robust6.c
@@ -0,0 +1,2 @@
+#define NOT_CONSISTENT 1
+#include "tst-robust3.c"
diff --git a/nptl/tst-typesizes.c b/nptl/tst-typesizes.c
new file mode 100644
index 0000000000..db8936f5f4
--- /dev/null
+++ b/nptl/tst-typesizes.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2005.
+
+ 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 <stdio.h>
+#include <pthreadP.h>
+#include <semaphore.h>
+
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+#define TEST_TYPE(name) \
+ printf ("%s: ", #name); \
+ if (sizeof (name) != sizeof (((name *) 0)->__size)) \
+ { \
+ printf ("expected %zu, is %zu\n", \
+ sizeof (((name *) 0)->__size), sizeof (name)); \
+ result = 1; \
+ } \
+ else \
+ puts ("OK")
+
+ TEST_TYPE (pthread_mutex_t);
+ TEST_TYPE (pthread_cond_t);
+ TEST_TYPE (pthread_rwlock_t);
+
+#define TEST_TYPE2(name, internal) \
+ printf ("%s: ", #name); \
+ if (sizeof (((name *) 0)->__size) < sizeof (internal)) \
+ { \
+ printf ("expected %zu, is %zu\n", \
+ sizeof (((name *) 0)->__size), sizeof (internal)); \
+ result = 1; \
+ } \
+ else \
+ puts ("OK")
+
+ TEST_TYPE2 (pthread_attr_t, struct pthread_attr);
+ TEST_TYPE2 (pthread_mutexattr_t, struct pthread_mutexattr);
+ TEST_TYPE2 (pthread_condattr_t, struct pthread_condattr);
+ TEST_TYPE2 (pthread_rwlockattr_t, struct pthread_rwlockattr);
+ TEST_TYPE2 (pthread_barrier_t, struct pthread_barrier);
+ TEST_TYPE2 (pthread_barrierattr_t, struct pthread_barrierattr);
+ TEST_TYPE2 (sem_t, struct sem);
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/nptl/unwind.c b/nptl/unwind.c
index 56a4238158..9a35695cb5 100644
--- a/nptl/unwind.c
+++ b/nptl/unwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>
and Richard Henderson <rth@redhat.com>, 2003.
@@ -23,7 +23,7 @@
#include <string.h>
#include <unistd.h>
#include "pthreadP.h"
-#include "jmpbuf-unwind.h"
+#include <jmpbuf-unwind.h>
#ifdef HAVE_FORCED_UNWIND
diff --git a/nptl/version.c b/nptl/version.c
index f2fd25fd6d..1be6b7f4a5 100644
--- a/nptl/version.c
+++ b/nptl/version.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,7 +23,7 @@
static const char banner[] =
#include "banner.h"
-"Copyright (C) 2003 Free Software Foundation, Inc.\n\
+"Copyright (C) 2005 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n"
diff --git a/rt/aio_read64.c b/rt/aio_read64.c
index c1292352af..e9994aefcb 100644
--- a/rt/aio_read64.c
+++ b/rt/aio_read64.c
@@ -1,2 +1,2 @@
#define BE_AIO64
-#include "aio_read.c"
+#include <aio_read.c>
diff --git a/rt/aio_sigqueue.c b/rt/aio_sigqueue.c
index e824c6b3de..0e3ba1f90b 100644
--- a/rt/aio_sigqueue.c
+++ b/rt/aio_sigqueue.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2005 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 <errno.h>
#include <signal.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
__aio_sigqueue (sig, val, caller_pid)
diff --git a/rt/aio_write64.c b/rt/aio_write64.c
index bb1693eeee..88d5c001ce 100644
--- a/rt/aio_write64.c
+++ b/rt/aio_write64.c
@@ -1,2 +1,2 @@
#define BE_AIO64
-#include "aio_write.c"
+#include <aio_write.c>
diff --git a/scripts/gen-as-const.awk b/scripts/gen-as-const.awk
index a315066422..c529fa42c8 100644
--- a/scripts/gen-as-const.awk
+++ b/scripts/gen-as-const.awk
@@ -13,7 +13,17 @@ BEGIN { started = 0 }
/^#/ { print; next }
NF >= 1 && !started {
- print "void dummy(void) {";
+ if (test) {
+ print "\n#include <stdio.h>";
+ print "\nstatic int do_test (void)\n{\n int bad = 0, good = 0;\n";
+ print "#define TEST(name, source, expr) \\\n" \
+ " if (asconst_##name != (expr)) { ++bad;" \
+ " fprintf (stderr, \"%s: %s is %ld but %s is %ld\\n\"," \
+ " source, #name, (long int) asconst_##name, #expr, (long int) (expr));" \
+ " } else ++good;\n";
+ }
+ else
+ print "void dummy(void) {";
started = 1;
}
@@ -25,8 +35,18 @@ NF == 1 { sub(/^.*$/, "& &"); }
NF > 1 {
name = $1;
sub(/^[^ ]+[ ]+/, "");
- printf "asm (\"@@@name@@@%s@@@value@@@%%0@@@end@@@\" : : \"i\" (%s));\n",
- name, $0;
+ if (test)
+ print " TEST (" name ", \"" FILENAME ":" FNR "\", " $0 ")";
+ else
+ printf "asm (\"@@@name@@@%s@@@value@@@%%0@@@end@@@\" : : \"i\" (%s));\n",
+ name, $0;
}
-END { if (started) print "}" }
+END {
+ if (test) {
+ print " printf (\"%d errors in %d tests\\n\", bad, good + bad);"
+ print " return bad != 0 || good == 0;\n}\n";
+ print "#define TEST_FUNCTION do_test ()";
+ }
+ else if (started) print "}";
+}
diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
index 2dc66c1ba3..24a9b33c08 100644
--- a/soft-fp/soft-fp.h
+++ b/soft-fp/soft-fp.h
@@ -1,5 +1,6 @@
/* Software floating-point emulation.
- Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2002,2003,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com),
Jakub Jelinek (jj@ultra.linux.cz),
@@ -24,7 +25,7 @@
#ifndef SOFT_FP_H
#define SOFT_FP_H
-#include "sfp-machine.h"
+#include <sfp-machine.h>
/* Allow sfp-machine to have its own byte order definitions. */
#ifndef __BYTE_ORDER
diff --git a/stdio-common/tmpfile64.c b/stdio-common/tmpfile64.c
index adce634556..b265aeee56 100644
--- a/stdio-common/tmpfile64.c
+++ b/stdio-common/tmpfile64.c
@@ -1,3 +1,3 @@
#define GEN_THIS __GT_BIGFILE
#define tmpfile tmpfile64
-#include "tmpfile.c"
+#include <tmpfile.c>
diff --git a/stdlib/Makefile b/stdlib/Makefile
index fa65c95121..f44c66b283 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -63,8 +63,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \
- test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
- tst-ucontext-off
+ test-a64l tst-qsort tst-system testmb2 bug-strtod2
include ../Makeconfig
@@ -125,7 +124,7 @@ endif
$(objpfx)isomac.out: $(objpfx)isomac
$(dir $<)$(notdir $<) '$(CC)' \
- '-I../include -I.. $(+sysdep-includes) $(sysincludes)' > $<.out
+ '-I../include $(+sysdep-includes) $(sysincludes) -I..' > $<.out
isomac-CFLAGS = -O
$(objpfx)isomac: isomac.c
diff --git a/stdlib/tst-ucontext-off.c b/stdlib/tst-ucontext-off.c
deleted file mode 100644
index 2e97f21aba..0000000000
--- a/stdlib/tst-ucontext-off.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-#include <sys/ucontext.h>
-
-#include <ucontext_i.h>
-
-static int
-do_test (void)
-{
- int nerrors = 0;
- int ntests = 0;
-
-#define TEST(member, val) \
- do { \
- if (offsetof (struct ucontext, member) != val) \
- { \
- printf ("offsetof(%s) = %zu, %s = %zu\n", \
- #member, offsetof (struct ucontext, member), \
- #val, (size_t) val); \
- ++nerrors; \
- } \
- ++ntests; \
- } while (0)
-
-#ifdef TESTS
- TESTS
-#endif
-
- printf ("%d errors in %d tests\n", nerrors, ntests);
-
- return nerrors != 0;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/sysdeps/generic/bits/atomic.h b/sysdeps/generic/bits/atomic.h
deleted file mode 100644
index 6245130a91..0000000000
--- a/sysdeps/generic/bits/atomic.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
-
- 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 _BITS_ATOMIC_H
-#define _BITS_ATOMIC_H 1
-
-/* We have by default no support for atomic operations. So define
- them non-atomic. If this is a problem somebody will have to come
- up with real definitions. */
-
-/* The only basic operation needed is compare and exchange. */
-#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
- ({ __typeof (mem) __gmemp = (mem); \
- __typeof (*mem) __gret = *__gmemp; \
- __typeof (*mem) __gnewval = (newval); \
- \
- if (__gret == (oldval)) \
- *__gmemp = __gnewval; \
- __gret; })
-
-#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
- ({ __typeof (mem) __gmemp = (mem); \
- __typeof (*mem) __gnewval = (newval); \
- \
- *__gmemp == (oldval) ? (*__gmemp = __gnewval, 0) : 1; })
-
-#endif /* bits/atomic.h */
diff --git a/sysdeps/generic/bits/dirent.h b/sysdeps/generic/bits/dirent.h
deleted file mode 100644
index 3407ebd802..0000000000
--- a/sysdeps/generic/bits/dirent.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Directory entry structure `struct dirent'. Stub version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _DIRENT_H
-# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
-#endif
-
-struct dirent
- {
- char d_name[1]; /* Variable length. */
- int d_fileno;
- };
-
-#ifdef __USE_LARGEFILE64
-struct dirent64
- {
- char d_name[1]; /* Variable length. */
- int d_fileno;
- };
-#endif
-
diff --git a/sysdeps/generic/bits/elfclass.h b/sysdeps/generic/bits/elfclass.h
deleted file mode 100644
index 180227d9e7..0000000000
--- a/sysdeps/generic/bits/elfclass.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* This file specifies the native word size of the machine, which indicates
- the ELF file class used for executables and shared objects on this
- machine. */
-
-#ifndef _LINK_H
-# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
-#endif
-
-#include <bits/wordsize.h>
-
-#define __ELF_NATIVE_CLASS __WORDSIZE
-
-/* The entries in the .hash table always have a size of 32 bits. */
-typedef uint32_t Elf_Symndx;
diff --git a/sysdeps/generic/bits/endian.h b/sysdeps/generic/bits/endian.h
deleted file mode 100644
index 45afd4ae47..0000000000
--- a/sysdeps/generic/bits/endian.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* This file should define __BYTE_ORDER as appropriate for the machine
- in question. See string/endian.h for how to define it.
-
- If only the stub bits/endian.h applies to a particular configuration,
- bytesex.h is generated by running a program on the host machine.
- So if cross-compiling to a machine with a different byte order,
- the bits/endian.h file for that machine must exist. */
-
-#ifndef _ENDIAN_H
-# error "Never use <bits/endian.h> directly; include <endian.h> instead."
-#endif
-
-#error Machine byte order unknown.
diff --git a/sysdeps/generic/bits/errno.h b/sysdeps/generic/bits/errno.h
deleted file mode 100644
index 89a5cfddeb..0000000000
--- a/sysdeps/generic/bits/errno.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1991, 1994, 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. */
-
-/* This file defines the `errno' constants. */
-
-#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath)
-#undef __need_Emath
-#define __Emath_defined 1
-
-# define EDOM XXX <--- fill in what is actually needed
-# define EILSEQ XXX <--- fill in what is actually needed
-# define ERANGE XXX <--- fill in what is actually needed
-#endif
-
-#ifdef _ERRNO_H
-# error "Define here all the missing error messages for the port. These"
-# error "must match the numbers of the kernel."
-# define Exxxx XXX
-...
-#endif
diff --git a/sysdeps/generic/bits/fcntl.h b/sysdeps/generic/bits/fcntl.h
deleted file mode 100644
index b397f812f1..0000000000
--- a/sysdeps/generic/bits/fcntl.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* O_*, F_*, FD_* bit values for stub configuration.
- Copyright (C) 1991, 1992, 1997, 2000, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* These values should be changed as appropriate for your system. */
-
-#ifndef _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
-#endif
-
-
-/* File access modes for `open' and `fcntl'. */
-#define O_RDONLY 0 /* Open read-only. */
-#define O_WRONLY 1 /* Open write-only. */
-#define O_RDWR 2 /* Open read/write. */
-
-
-/* Bits OR'd into the second argument to open. */
-#define O_CREAT 0x0200 /* Create file if it doesn't exist. */
-#define O_EXCL 0x0800 /* Fail if file already exists. */
-#define O_TRUNC 0x0400 /* Truncate file to zero length. */
-#define O_NOCTTY 0x0100 /* Don't assign a controlling terminal. */
-
-/* File status flags for `open' and `fcntl'. */
-#define O_APPEND 0x0008 /* Writes append to the file. */
-#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
-
-#ifdef __USE_BSD
-# define O_NDELAY O_NONBLOCK
-#endif
-
-/* Mask for file access modes. This is system-dependent in case
- some system ever wants to define some other flavor of access. */
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
-#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info. */
-#define F_SETLKW 9 /* Set record locking info, wait. */
-
-/* File descriptor flags used with F_GETFD and F_SETFD. */
-#define FD_CLOEXEC 1 /* Close on exec. */
-
-
-#include <bits/types.h>
-
-/* The structure describing an advisory lock. This is the type of the third
- argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
-struct flock
- {
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- __off_t l_start; /* Offset where the lock begins. */
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
- __pid_t l_pid; /* Process holding the lock. */
- };
-
-/* Values for the `l_type' field of a `struct flock'. */
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
-
-/* 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
diff --git a/sysdeps/generic/bits/fenv.h b/sysdeps/generic/bits/fenv.h
deleted file mode 100644
index a9cb53b40e..0000000000
--- a/sysdeps/generic/bits/fenv.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1997, 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 _FENV_H
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
-#endif
-
-
-/* Here should be the exception be defined:
- FE_INVALID
- FE_DIVBYZERO
- FE_OVERFLOW
- FE_UNDERFLOW
- FE_INEXACT
- We define no macro which signals no exception is supported. */
-
-#define FE_ALL_EXCEPT 0
-
-
-/* Here should the rounding modes be defined:
- FE_TONEAREST
- FE_DOWNWARD
- FE_UPWARD
- FE_TOWARDZERO
- We define no macro which signals no rounding mode is selectable. */
-
-
-/* Type representing exception flags. */
-typedef unsigned int fexcept_t;
-
-
-/* Type representing floating-point environment. */
-typedef struct
- {
- fexcept_t __excepts;
- /* XXX I don't know what else we should save. */
- }
-fenv_t;
-
-/* If the default argument is used we use this value. */
-#define FE_DFL_ENV ((__const fenv_t *) -1l)
diff --git a/sysdeps/generic/bits/fenvinline.h b/sysdeps/generic/bits/fenvinline.h
deleted file mode 100644
index 42f77b5618..0000000000
--- a/sysdeps/generic/bits/fenvinline.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* This file provides inline versions of floating-pint environment
- handling functions. If there were any. */
-
-#ifndef __NO_MATH_INLINES
-
-/* Here is where the code would go. */
-
-#endif
diff --git a/sysdeps/generic/bits/huge_val.h b/sysdeps/generic/bits/huge_val.h
deleted file mode 100644
index e102ac3220..0000000000
--- a/sysdeps/generic/bits/huge_val.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Stub `HUGE_VAL' constant.
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VAL (__builtin_huge_val())
-#else
-# define HUGE_VAL 1e37
-#endif
diff --git a/sysdeps/generic/bits/huge_valf.h b/sysdeps/generic/bits/huge_valf.h
deleted file mode 100644
index 4cb5ebdfcb..0000000000
--- a/sysdeps/generic/bits/huge_valf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Stub `HUGE_VALF' constant.
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_valf.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALF (__builtin_huge_valf())
-#else
-# define HUGE_VALF 1e37f
-#endif
diff --git a/sysdeps/generic/bits/huge_vall.h b/sysdeps/generic/bits/huge_vall.h
deleted file mode 100644
index d5e8e2237b..0000000000
--- a/sysdeps/generic/bits/huge_vall.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Default `HUGE_VALL' constant.
- Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _MATH_H
-# error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
-#endif
-
-#if __GNUC_PREREQ(3,3)
-# define HUGE_VALL (__builtin_huge_vall())
-#else
-# define HUGE_VALL ((long double) HUGE_VAL)
-#endif
diff --git a/sysdeps/generic/bits/in.h b/sysdeps/generic/bits/in.h
deleted file mode 100644
index 31eb0f9fcf..0000000000
--- a/sysdeps/generic/bits/in.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Copyright (C) 1997, 2000, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Generic version. */
-
-#ifndef _NETINET_IN_H
-# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
-#endif
-
-/* Options for use with `getsockopt' and `setsockopt' at the IP level.
- The first word in the comment at the right is the data type used;
- "bool" means a boolean value stored in an `int'. */
-#define IP_OPTIONS 1 /* ip_opts; IP per-packet options. */
-#define IP_HDRINCL 2 /* int; Header is included with data. */
-#define IP_TOS 3 /* int; IP type of service and precedence. */
-#define IP_TTL 4 /* int; IP time to live. */
-#define IP_RECVOPTS 5 /* bool; Receive all IP options w/datagram. */
-#define IP_RECVRETOPTS 6 /* bool; Receive IP options for response. */
-#define IP_RECVDSTADDR 7 /* bool; Receive IP dst addr w/datagram. */
-#define IP_RETOPTS 8 /* ip_opts; Set/get IP per-packet options. */
-#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */
-#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
-#define IP_MULTICAST_LOOP 11 /* i_char; set/get IP multicast loopback */
-#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
-#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
-
-/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
- The `ip_dst' field is used for the first-hop gateway when using a
- source route (this gets put into the header proper). */
-struct ip_opts
- {
- struct in_addr ip_dst; /* First hop; zero without source route. */
- char ip_opts[40]; /* Actually variable in size. */
- };
-
-/* IPV6 socket options. */
-#define IPV6_ADDRFORM 1
-#define IPV6_RXINFO 2
-#define IPV6_HOPOPTS 3
-#define IPV6_DSTOPTS 4
-#define IPV6_RTHDR 5
-#define IPV6_PKTOPTIONS 6
-#define IPV6_CHECKSUM 7
-#define IPV6_HOPLIMIT 8
-
-#define IPV6_TXINFO IPV6_RXINFO
-#define SCM_SRCINFO IPV6_TXINFO
-#define SCM_SRCRT IPV6_RXSRCRT
-
-#define IPV6_UNICAST_HOPS 16
-#define IPV6_MULTICAST_IF 17
-#define IPV6_MULTICAST_HOPS 18
-#define IPV6_MULTICAST_LOOP 19
-#define IPV6_JOIN_GROUP 20
-#define IPV6_LEAVE_GROUP 21
-
-/* Obsolete synonyms for the above. */
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-#define IPV6_RXHOPOPTS IPV6_HOPOPTS
-#define IPV6_RXDSTOPTS IPV6_DSTOPTS
-
-/* Routing header options for IPv6. */
-#define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */
-#define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */
-
-#define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */
diff --git a/sysdeps/generic/bits/inf.h b/sysdeps/generic/bits/inf.h
deleted file mode 100644
index 2d526adb23..0000000000
--- a/sysdeps/generic/bits/inf.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Default `INFINITY' constant.
- 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. */
-
-#ifndef _MATH_H
-# error "Never use <bits/inf.h> directly; include <math.h> instead."
-#endif
-
-/* If we don't have real infinity, then we're supposed to produce a float
- value that overflows at translation time, which is required to produce
- a diagnostic. GCC's __builtin_inff produces a quite nice diagnostic
- that tells the user that the target doesn't support infinities. */
-
-#if __GNUC_PREREQ(3,3)
-# define INFINITY (__builtin_inff())
-#else
-# define INFINITY (1e9999f)
-#endif
diff --git a/sysdeps/generic/bits/ioctl-types.h b/sysdeps/generic/bits/ioctl-types.h
deleted file mode 100644
index 58b78a6af3..0000000000
--- a/sysdeps/generic/bits/ioctl-types.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Structure types for pre-termios terminal ioctls. Generic Unix version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, 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/ioctl-types.h> directly; include <sys/ioctl.h> instead."
-#endif
-
-#if defined TIOCGETC || defined TIOCSETC
-/* Type of ARG for TIOCGETC and TIOCSETC requests. */
-struct tchars
-{
- char t_intrc; /* Interrupt character. */
- char t_quitc; /* Quit character. */
- char t_startc; /* Start-output character. */
- char t_stopc; /* Stop-output character. */
- char t_eofc; /* End-of-file character. */
- char t_brkc; /* Input delimiter character. */
-};
-
-#define _IOT_tchars /* Hurd ioctl type field. */ \
- _IOT (_IOTS (char), 6, 0, 0, 0, 0)
-#endif
-
-#if defined TIOCGLTC || defined TIOCSLTC
-/* Type of ARG for TIOCGLTC and TIOCSLTC requests. */
-struct ltchars
-{
- char t_suspc; /* Suspend character. */
- char t_dsuspc; /* Delayed suspend character. */
- char t_rprntc; /* Reprint-line character. */
- char t_flushc; /* Flush-output character. */
- char t_werasc; /* Word-erase character. */
- char t_lnextc; /* Literal-next character. */
-};
-
-#define _IOT_ltchars /* Hurd ioctl type field. */ \
- _IOT (_IOTS (char), 6, 0, 0, 0, 0)
-#endif
-
-/* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty). */
-struct sgttyb
-{
- char sg_ispeed; /* Input speed. */
- char sg_ospeed; /* Output speed. */
- char sg_erase; /* Erase character. */
- char sg_kill; /* Kill character. */
- short int sg_flags; /* Mode flags. */
-};
-
-#define _IOT_sgttyb /* Hurd ioctl type field. */ \
- _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0)
-
-#if defined TIOCGWINSZ || defined TIOCSWINSZ
-/* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */
-struct winsize
-{
- unsigned short int ws_row; /* Rows, in characters. */
- unsigned short int ws_col; /* Columns, in characters. */
-
- /* These are not actually used. */
- unsigned short int ws_xpixel; /* Horizontal pixels. */
- unsigned short int ws_ypixel; /* Vertical pixels. */
-};
-
-#define _IOT_winsize /* Hurd ioctl type field. */ \
- _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0)
-#endif
-
-#if defined TIOCGSIZE || defined TIOCSSIZE
-/* The BSD-style ioctl constructor macros use `sizeof', which can't be used
- in a preprocessor conditional. Since the commands are always unique
- regardless of the size bits, we can safely define away `sizeof' for the
- purpose of the conditional. */
-# define sizeof(type) 0
-# if defined TIOCGWINSZ && TIOCGSIZE == TIOCGWINSZ
-/* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
- compatibility with Sun; they define `struct ttysize' to have identical
- layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ
- (likewise TIOCSSIZE and TIOCSWINSZ). */
-struct ttysize
-{
- unsigned short int ts_lines;
- unsigned short int ts_cols;
- unsigned short int ts_xxx;
- unsigned short int ts_yyy;
-};
-#define _IOT_ttysize _IOT_winsize
-# else
-/* Suns use a different layout for `struct ttysize', and TIOCGSIZE and
- TIOCGWINSZ are separate commands that do the same thing with different
- structures (likewise TIOCSSIZE and TIOCSWINSZ). */
-struct ttysize
-{
- int ts_lines, ts_cols; /* Lines and columns, in characters. */
-};
-# endif
-# undef sizeof /* See above. */
-#endif
diff --git a/sysdeps/generic/bits/ioctls.h b/sysdeps/generic/bits/ioctls.h
deleted file mode 100644
index d3ecad9515..0000000000
--- a/sysdeps/generic/bits/ioctls.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _SYS_IOCTL_H
-# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
-#endif
-
-/* This space intentionally left blank. */
diff --git a/sysdeps/generic/bits/ipc.h b/sysdeps/generic/bits/ipc.h
deleted file mode 100644
index 5ba227d36b..0000000000
--- a/sysdeps/generic/bits/ipc.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 1995, 1996, 1997, 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_IPC_H
-# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
-#endif
-
-#include <bits/types.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 */
-
-/* Special key values. */
-#define IPC_PRIVATE ((key_t) 0) /* private key */
-
-
-/* Data structure used to pass permission information to IPC operations. */
-struct ipc_perm
- {
- __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 */
- __mode_t mode; /* read/write permission */
- };
diff --git a/sysdeps/generic/bits/libc-lock.h b/sysdeps/generic/bits/libc-lock.h
deleted file mode 100644
index 3f9c211e0a..0000000000
--- a/sysdeps/generic/bits/libc-lock.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* libc-internal interface for mutex locks. Stub version.
- Copyright (C) 1996,97,99,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. */
-
-#ifndef _BITS_LIBC_LOCK_H
-#define _BITS_LIBC_LOCK_H 1
-
-
-/* Define a lock variable NAME with storage class CLASS. The lock must be
- initialized with __libc_lock_init before it can be used (or define it
- with __libc_lock_define_initialized, below). Use `extern' for CLASS to
- declare a lock defined in another module. In public structure
- definitions you must use a pointer to the lock structure (i.e., NAME
- begins with a `*'), because its storage size will not be known outside
- of libc. */
-#define __libc_lock_define(CLASS,NAME)
-#define __libc_lock_define_recursive(CLASS,NAME)
-#define __rtld_lock_define_recursive(CLASS,NAME)
-#define __libc_rwlock_define(CLASS,NAME)
-
-/* Define an initialized lock variable NAME with storage class CLASS. */
-#define __libc_lock_define_initialized(CLASS,NAME)
-#define __libc_rwlock_define_initialized(CLASS,NAME)
-
-/* Define an initialized recursive lock variable NAME with storage
- class CLASS. */
-#define __libc_lock_define_initialized_recursive(CLASS,NAME)
-#define __rtld_lock_define_initialized_recursive(CLASS,NAME)
-
-/* Initialize the named lock variable, leaving it in a consistent, unlocked
- state. */
-#define __libc_lock_init(NAME)
-#define __libc_rwlock_init(NAME)
-
-/* Same as last but this time we initialize a recursive mutex. */
-#define __libc_lock_init_recursive(NAME)
-#define __rtld_lock_init_recursive(NAME)
-
-/* Finalize the named lock variable, which must be locked. It cannot be
- used again until __libc_lock_init is called again on it. This must be
- called on a lock variable before the containing storage is reused. */
-#define __libc_lock_fini(NAME)
-#define __libc_rwlock_fini(NAME)
-
-/* Finalize recursive named lock. */
-#define __libc_lock_fini_recursive(NAME)
-
-/* Lock the named lock variable. */
-#define __libc_lock_lock(NAME)
-#define __libc_rwlock_rdlock(NAME)
-#define __libc_rwlock_wrlock(NAME)
-
-/* Lock the recursive named lock variable. */
-#define __libc_lock_lock_recursive(NAME)
-#define __rtld_lock_lock_recursive(NAME)
-
-/* Try to lock the named lock variable. */
-#define __libc_lock_trylock(NAME) 0
-#define __libc_rwlock_tryrdlock(NAME) 0
-#define __libc_rwlock_trywrlock(NAME) 0
-
-/* Try to lock the recursive named lock variable. */
-#define __libc_lock_trylock_recursive(NAME) 0
-
-/* Unlock the named lock variable. */
-#define __libc_lock_unlock(NAME)
-#define __libc_rwlock_unlock(NAME)
-
-/* Unlock the recursive named lock variable. */
-#define __libc_lock_unlock_recursive(NAME)
-#define __rtld_lock_unlock_recursive(NAME)
-
-
-/* Define once control variable. */
-#define __libc_once_define(CLASS, NAME) CLASS int NAME = 0
-
-/* Call handler iff the first call. */
-#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
- do { \
- if ((ONCE_CONTROL) == 0) { \
- INIT_FUNCTION (); \
- (ONCE_CONTROL) = 1; \
- } \
- } while (0)
-
-
-/* Start a critical region with a cleanup function */
-#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
-{ \
- typeof (***(FCT)) *__save_FCT = (DOIT) ? (FCT) : 0; \
- typeof (ARG) __save_ARG = ARG; \
- /* close brace is in __libc_cleanup_region_end below. */
-
-/* End a critical region started with __libc_cleanup_region_start. */
-#define __libc_cleanup_region_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
-}
-
-/* Sometimes we have to exit the block in the middle. */
-#define __libc_cleanup_end(DOIT) \
- if ((DOIT) && __save_FCT != 0) \
- (*__save_FCT)(__save_ARG); \
-
-#define __libc_cleanup_push(fct, arg) __libc_cleanup_region_start (1, fct, arg)
-#define __libc_cleanup_pop(execute) __libc_cleanup_region_end (execute)
-
-/* We need portable names for some of the functions. */
-#define __libc_mutex_unlock
-
-/* Type for key of thread specific data. */
-typedef int __libc_key_t;
-
-/* Create key for thread specific data. */
-#define __libc_key_create(KEY,DEST) -1
-
-/* Set thread-specific data associated with KEY to VAL. */
-#define __libc_setspecific(KEY,VAL) ((void)0)
-
-/* Get thread-specific data associated with KEY. */
-#define __libc_getspecific(KEY) 0
-
-#endif /* bits/libc-lock.h */
diff --git a/sysdeps/generic/bits/libc-tsd.h b/sysdeps/generic/bits/libc-tsd.h
deleted file mode 100644
index d39382952a..0000000000
--- a/sysdeps/generic/bits/libc-tsd.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* libc-internal interface for thread-specific data. Stub or TLS version.
- Copyright (C) 1998,2001,02 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 _GENERIC_BITS_LIBC_TSD_H
-#define _GENERIC_BITS_LIBC_TSD_H 1
-
-/* This file defines the following macros for accessing a small fixed
- set of thread-specific `void *' data used only internally by libc.
-
- __libc_tsd_define(CLASS, KEY) -- Define or declare a `void *' datum
- for KEY. CLASS can be `static' for
- keys used in only one source file,
- empty for global definitions, or
- `extern' for global declarations.
- __libc_tsd_address(KEY) -- Return the `void **' pointing to
- the current thread's datum for KEY.
- __libc_tsd_get(KEY) -- Return the `void *' datum for KEY.
- __libc_tsd_set(KEY, VALUE) -- Set the datum for KEY to VALUE.
-
- The set of available KEY's will usually be provided as an enum,
- and contains (at least):
- _LIBC_TSD_KEY_MALLOC
- _LIBC_TSD_KEY_DL_ERROR
- _LIBC_TSD_KEY_RPC_VARS
- All uses must be the literal _LIBC_TSD_* name in the __libc_tsd_* macros.
- Some implementations may not provide any enum at all and instead
- using string pasting in the macros. */
-
-#include <tls.h>
-
-/* When full support for __thread variables is available, this interface is
- just a trivial wrapper for it. Without TLS, this is the generic/stub
- implementation for wholly single-threaded systems.
-
- We don't define an enum for the possible key values, because the KEYs
- translate directly into variables by macro magic. */
-
-#if USE___THREAD
-# define __libc_tsd_define(CLASS, KEY) \
- CLASS __thread void *__libc_tsd_##KEY attribute_tls_model_ie;
-
-# define __libc_tsd_address(KEY) (&__libc_tsd_##KEY)
-# define __libc_tsd_get(KEY) (__libc_tsd_##KEY)
-# define __libc_tsd_set(KEY, VALUE) (__libc_tsd_##KEY = (VALUE))
-#else
-# define __libc_tsd_define(CLASS, KEY) CLASS void *__libc_tsd_##KEY##_data;
-
-# define __libc_tsd_address(KEY) (&__libc_tsd_##KEY##_data)
-# define __libc_tsd_get(KEY) (__libc_tsd_##KEY##_data)
-# define __libc_tsd_set(KEY, VALUE) (__libc_tsd_##KEY##_data = (VALUE))
-#endif
-
-#endif /* bits/libc-tsd.h */
diff --git a/sysdeps/generic/bits/local_lim.h b/sysdeps/generic/bits/local_lim.h
deleted file mode 100644
index 42cc7ebbc9..0000000000
--- a/sysdeps/generic/bits/local_lim.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* This file should define the implementation-specific limits described
- in posix[12]_lim.h. If there are no useful values to give a limit,
- don't define it. */
diff --git a/sysdeps/generic/bits/mathdef.h b/sysdeps/generic/bits/mathdef.h
deleted file mode 100644
index 00c67241a0..0000000000
--- a/sysdeps/generic/bits/mathdef.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 1997, 1998, 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
- 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. */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF 1
-
-/* Normally, there is no long double type and the `float' and `double'
- expressions are evaluated as `double'. */
-typedef double float_t; /* `float' expressions are evaluated as
- `double'. */
-typedef double double_t; /* `double' expressions are evaluated as
- `double'. */
-
-/* The values returned by `ilogb' for 0 and NaN respectively. */
-# define FP_ILOGB0 (-2147483647)
-# define FP_ILOGBNAN 2147483647
-
-#endif /* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'. The disables the
- declaration of all the `long double' function variants. */
-# define __NO_LONG_DOUBLE_MATH 1
-#endif
diff --git a/sysdeps/generic/bits/mathinline.h b/sysdeps/generic/bits/mathinline.h
deleted file mode 100644
index 5498af6b63..0000000000
--- a/sysdeps/generic/bits/mathinline.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This file should provide inline versions of math functions.
-
- Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-
- This file should define __MATH_INLINES if functions are actually defined as
- inlines. */
-
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-
-/* Here goes the real code. */
-
-#endif
diff --git a/sysdeps/generic/bits/mqueue.h b/sysdeps/generic/bits/mqueue.h
deleted file mode 100644
index 27bb4824b8..0000000000
--- a/sysdeps/generic/bits/mqueue.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 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. */
-
-#ifndef _MQUEUE_H
-# error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
-#endif
-
-typedef int mqd_t;
-
-struct mq_attr
-{
- long int mq_flags; /* Message queue flags. */
- long int mq_maxmsg; /* Maximum number of messages. */
- long int mq_msgsize; /* Maximum message size. */
- long int mq_curmsgs; /* Number of messages currently queued. */
-};
diff --git a/sysdeps/generic/bits/msq.h b/sysdeps/generic/bits/msq.h
deleted file mode 100644
index 0125c43dc3..0000000000
--- a/sysdeps/generic/bits/msq.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 1995, 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>
-
-/* Define options for message queue functions. */
-#define MSG_NOERROR 010000 /* no error if message is too big */
-
-/* Types used in the structure definition. */
-typedef unsigned short int msgqnum_t;
-typedef unsigned short 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 */
- __time_t msg_stime; /* time of last msgsnd command */
- __time_t msg_rtime; /* time of last msgrcv command */
- __time_t msg_ctime; /* time of last change */
- 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() */
-};
diff --git a/sysdeps/generic/bits/nan.h b/sysdeps/generic/bits/nan.h
deleted file mode 100644
index ab38168ea4..0000000000
--- a/sysdeps/generic/bits/nan.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _MATH_H
-#error "Never use <bits/nan.h> directly; include <math.h> instead."
-#endif
-
-/* This file should define `NAN' on machines that have such things. */
diff --git a/sysdeps/generic/bits/netdb.h b/sysdeps/generic/bits/netdb.h
deleted file mode 100644
index 41dc731931..0000000000
--- a/sysdeps/generic/bits/netdb.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* 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. */
-
-#ifndef _NETDB_H
-# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
-#endif
-
-
-/* Description of data base entry for a single network. NOTE: here a
- poor assumption is made. The network number is expected to fit
- into an unsigned long int variable. */
-struct netent
-{
- char *n_name; /* Official name of network. */
- char **n_aliases; /* Alias list. */
- int n_addrtype; /* Net address type. */
- uint32_t n_net; /* Network number. */
-};
diff --git a/sysdeps/generic/bits/poll.h b/sysdeps/generic/bits/poll.h
deleted file mode 100644
index 022a06cc1b..0000000000
--- a/sysdeps/generic/bits/poll.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 1997, 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_POLL_H
-# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
-#endif
-
-/* Event types that can be polled for. These bits may be set in `events'
- to indicate the interesting event types; they will appear in `revents'
- to indicate the status of the file descriptor. */
-#define POLLIN 01 /* There is data to read. */
-#define POLLPRI 02 /* There is urgent data to read. */
-#define POLLOUT 04 /* Writing now will not block. */
-
-#ifdef __USE_XOPEN
-/* These values are defined in XPG4.2. */
-# define POLLRDNORM POLLIN /* Normal data may be read. */
-# define POLLRDBAND POLLPRI /* Priority data may be read. */
-# define POLLWRNORM POLLOUT /* Writing now will not block. */
-# define POLLWRBAND POLLOUT /* Priority data may be written. */
-#endif
-
-/* Event types always implicitly polled for. These bits need not be set in
- `events', but they will appear in `revents' to indicate the status of
- the file descriptor. */
-#define POLLERR 010 /* Error condition. */
-#define POLLHUP 020 /* Hung up. */
-#define POLLNVAL 040 /* Invalid polling request. */
diff --git a/sysdeps/generic/bits/posix_opt.h b/sysdeps/generic/bits/posix_opt.h
deleted file mode 100644
index 54f5a79aa2..0000000000
--- a/sysdeps/generic/bits/posix_opt.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* This file should define the POSIX options described in <unistd.h>,
- or leave them undefined, as appropriate. */
diff --git a/sysdeps/generic/bits/pthreadtypes.h b/sysdeps/generic/bits/pthreadtypes.h
deleted file mode 100644
index 0e26952c96..0000000000
--- a/sysdeps/generic/bits/pthreadtypes.h
+++ /dev/null
@@ -1 +0,0 @@
-/* No thread support. */
diff --git a/sysdeps/generic/bits/resource.h b/sysdeps/generic/bits/resource.h
deleted file mode 100644
index 05b28dfccd..0000000000
--- a/sysdeps/generic/bits/resource.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Bit values & structures for resource limits. 4.4 BSD/generic GNU version.
- Copyright (C) 1994, 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. */
-
-#ifndef _SYS_RESOURCE_H
-# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a
- subset of these kinds of resource limit. In systems where `getrlimit'
- and `setrlimit' are not system calls, these are the values used by the C
- library to emulate them. */
-
-/* Kinds of resource limit. */
-enum __rlimit_resource
- {
- /* Per-process CPU limit, in seconds. */
- RLIMIT_CPU,
-#define RLIMIT_CPU RLIMIT_CPU
- /* Largest file that can be created, in bytes. */
- RLIMIT_FSIZE,
-#define RLIMIT_FSIZE RLIMIT_FSIZE
- /* Maximum size of data segment, in bytes. */
- RLIMIT_DATA,
-#define RLIMIT_DATA RLIMIT_DATA
- /* Maximum size of stack segment, in bytes. */
- RLIMIT_STACK,
-#define RLIMIT_STACK RLIMIT_STACK
- /* Largest core file that can be created, in bytes. */
- RLIMIT_CORE,
-#define RLIMIT_CORE RLIMIT_CORE
- /* Largest resident set size, in bytes.
- This affects swapping; processes that are exceeding their
- resident set size will be more likely to have physical memory
- taken from them. */
- RLIMIT_RSS,
-#define RLIMIT_RSS RLIMIT_RSS
- /* Locked-in-memory address space. */
- RLIMIT_MEMLOCK,
-#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
- /* Number of processes. */
- RLIMIT_NPROC,
-#define RLIMIT_NPROC RLIMIT_NPROC
- /* Number of open files. */
- RLIMIT_OFILE,
- RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing. */
-#define RLIMIT_OFILE RLIMIT_OFILE
-#define RLIMIT_NOFILE RLIMIT_NOFILE
-
- RLIMIT_NLIMITS, /* Number of limit flavors. */
- RLIM_NLIMITS = RLIMIT_NLIMITS /* Traditional name for same. */
- };
-
-/* Value to indicate that there is no limit. */
-#ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY 0x7fffffff
-#else
-# define RLIM_INFINITY 0x7fffffffffffffffLL
-#endif
-
-#ifdef __USE_LARGEFILE64
-# define RLIM64_INFINITY 0x7fffffffffffffffLL
-#endif
-
-
-/* Type for resource quantity measurement. */
-#ifndef __USE_FILE_OFFSET64
-typedef __rlim_t rlim_t;
-#else
-typedef __rlim64_t rlim_t;
-#endif
-#ifdef __USE_LARGEFILE64
-typedef __rlim64_t rlim64_t;
-#endif
-
-struct rlimit
- {
- /* The current (soft) limit. */
- rlim_t rlim_cur;
- /* The hard limit. */
- rlim_t rlim_max;
- };
-
-#ifdef __USE_LARGEFILE64
-struct rlimit64
- {
- /* The current (soft) limit. */
- rlim64_t rlim_cur;
- /* The hard limit. */
- rlim64_t rlim_max;
- };
-#endif
-
-/* Whose usage statistics do you want? */
-enum __rusage_who
-/* The macro definitions are necessary because some programs want
- to test for operating system features with #ifdef RUSAGE_SELF.
- In ISO C the reflexive definition is a no-op. */
- {
- /* The calling process. */
- RUSAGE_SELF = 0,
-#define RUSAGE_SELF RUSAGE_SELF
- /* All of its terminated child processes. */
- RUSAGE_CHILDREN = -1
-#define RUSAGE_CHILDREN RUSAGE_CHILDREN
- };
-
-#define __need_timeval
-#include <bits/time.h> /* For `struct timeval'. */
-
-/* Structure which says how much of each resource has been used. */
-struct rusage
- {
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
- };
-
-/* Priority limits. */
-#define PRIO_MIN -20 /* Minimum priority a process can have. */
-#define PRIO_MAX 20 /* Maximum priority a process can have. */
-
-/* The type of the WHICH argument to `getpriority' and `setpriority',
- indicating what flavor of entity the WHO argument specifies. */
-enum __priority_which
- {
- PRIO_PROCESS = 0, /* WHO is a process ID. */
- PRIO_PGRP = 1, /* WHO is a process group ID. */
- PRIO_USER = 2 /* WHO is a user ID. */
- };
diff --git a/sysdeps/generic/bits/sched.h b/sysdeps/generic/bits/sched.h
deleted file mode 100644
index 91b6dca0ca..0000000000
--- a/sysdeps/generic/bits/sched.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Definitions of constants and data structure for POSIX 1003.1b-1993
- scheduling interface.
- Copyright (C) 1996, 1997, 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. */
-
-#ifndef _SCHED_H
-# error "Never include <bits/sched.h> directly; use <sched.h> instead."
-#endif
-
-
-/* Scheduling algorithms. */
-#define SCHED_OTHER 0
-#define SCHED_FIFO 1
-#define SCHED_RR 2
-
-/* Data structure to describe a process' schedulability. */
-struct sched_param
-{
- int __sched_priority;
-};
-
-
-#if defined _SCHED_H && !defined __cpu_set_t_defined
-# define __cpu_set_t_defined
-/* Size definition for CPU sets. */
-# define __CPU_SETSIZE 1024
-# define __NCPUBITS (8 * sizeof (__cpu_mask))
-
-/* Type for array elements in 'cpu_set'. */
-typedef unsigned long int __cpu_mask;
-
-/* Basic access functions. */
-# define __CPUELT(cpu) ((cpu) / __NCPUBITS)
-# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
-
-/* Data structure to describe CPU mask. */
-typedef struct
-{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
-} cpu_set_t;
-
-/* Access functions for CPU masks. */
-# define __CPU_ZERO(cpusetp) \
- do { \
- unsigned int __i; \
- cpu_set *__arr = (cpusetp); \
- for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \
- __arr->__bits[__i] = 0; \
- } while (0)
-# define __CPU_SET(cpu, cpusetp) \
- ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
-# define __CPU_CLR(cpu, cpusetp) \
- ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
-# define __CPU_ISSET(cpu, cpusetp) \
- (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
-#endif
diff --git a/sysdeps/generic/bits/select.h b/sysdeps/generic/bits/select.h
deleted file mode 100644
index 47e7dedc30..0000000000
--- a/sysdeps/generic/bits/select.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1997, 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. */
-
-#ifndef _SYS_SELECT_H
-# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
-#endif
-
-
-/* We don't use `memset' because this would require a prototype and
- the array isn't too big. */
-#define __FD_ZERO(s) \
- do { \
- unsigned int __i; \
- fd_set *__arr = (s); \
- for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
- __FDS_BITS (__arr)[__i] = 0; \
- } while (0)
-#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
-#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
-#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/sysdeps/generic/bits/sem.h b/sysdeps/generic/bits/sem.h
deleted file mode 100644
index dcb1c3edf7..0000000000
--- a/sysdeps/generic/bits/sem.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 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. */
-
-#ifndef _SYS_SEM_H
-# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
-#endif
-
-#include <sys/types.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 */
- __time_t sem_otime; /* last semop() time */
- __time_t sem_ctime; /* last time changed by semctl() */
- unsigned short int sem_nsems; /* number of semaphores in set */
-};
-
-/* 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
diff --git a/sysdeps/generic/bits/setjmp.h b/sysdeps/generic/bits/setjmp.h
deleted file mode 100644
index 9150d8d764..0000000000
--- a/sysdeps/generic/bits/setjmp.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Define the machine-dependent type `jmp_buf'. Stub version. */
-
-#ifndef _SETJMP_H
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
-#endif
-
-typedef int __jmp_buf[1];
diff --git a/sysdeps/generic/bits/shm.h b/sysdeps/generic/bits/shm.h
deleted file mode 100644
index 746a863486..0000000000
--- a/sysdeps/generic/bits/shm.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1995, 1996, 1997, 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 _SYS_SHM_H
-# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
-#endif
-
-#include <bits/types.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) */
-
-__BEGIN_DECLS
-
-/* Segment low boundary address multiple. */
-#define SHMLBA (__getpagesize ())
-extern int __getpagesize (void) __THROW __attribute__ ((__const__));
-
-
-/* Type to count number of attaches. */
-typedef unsigned short int shmatt_t;
-
-/* Data structure describing a set of semaphores. */
-struct shmid_ds
- {
- struct ipc_perm shm_perm; /* operation permission struct */
- int shm_segsz; /* size of segment in bytes */
- __time_t shm_atime; /* time of last shmat() */
- __time_t shm_dtime; /* time of last shmdt() */
- __time_t shm_ctime; /* time of last change by shmctl() */
- __pid_t shm_cpid; /* pid of creator */
- __pid_t shm_lpid; /* pid of last shmop */
- shmatt_t shm_nattch; /* number of current attaches */
- };
-
-__END_DECLS
diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h
deleted file mode 100644
index adcc276cc8..0000000000
--- a/sysdeps/generic/bits/sigaction.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Copyright (C) 1991,92,96,97,98,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 _SIGNAL_H
-# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
-#endif
-
-/* These definitions match those used by the 4.4 BSD kernel.
- If the operating system has a `sigaction' system call that correctly
- implements the POSIX.1 behavior, there should be a system-dependent
- version of this file that defines `struct sigaction' and the `SA_*'
- constants appropriately. */
-
-/* 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
-
- /* Additional set of signals to be blocked. */
- __sigset_t sa_mask;
-
- /* Special flags. */
- int sa_flags;
- };
-
-/* Bits in `sa_flags'. */
-#if defined __USE_UNIX98 || defined __USE_MISC
-# define SA_ONSTACK 0x0001 /* Take signal on signal stack. */
-# define SA_RESTART 0x0002 /* Restart syscall on signal return. */
-# define SA_NODEFER 0x0010 /* Don't automatically block the signal when
- its handler is being executed. */
-# define SA_RESETHAND 0x0004 /* Reset to SIG_DFL on entry to handler. */
-#endif
-#define SA_NOCLDSTOP 0x0008 /* Don't send SIGCHLD when children stop. */
-
-#ifdef __USE_MISC
-# define SA_INTERRUPT 0 /* Historical no-op ("not SA_RESTART"). */
-
-/* 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 1 /* Block signals. */
-#define SIG_UNBLOCK 2 /* Unblock signals. */
-#define SIG_SETMASK 3 /* Set the set of blocked signals. */
diff --git a/sysdeps/generic/bits/sigcontext.h b/sysdeps/generic/bits/sigcontext.h
deleted file mode 100644
index 7e90e78c4a..0000000000
--- a/sysdeps/generic/bits/sigcontext.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Structure describing state saved while handling a signal. Stub version.
- Copyright (C) 1991, 1994, 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 _SIGNAL_H
-# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
-#endif
-
-/* State of this thread when the signal was taken. */
-struct sigcontext
- {
- int sc_onstack;
- __sigset_t sc_mask;
-
- /* Registers and such. */
- };
-
-/* Signal subcodes should be defined here. */
diff --git a/sysdeps/generic/bits/siginfo.h b/sysdeps/generic/bits/siginfo.h
deleted file mode 100644
index fe7b3b5f9c..0000000000
--- a/sysdeps/generic/bits/siginfo.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* siginfo_t, sigevent and constants. Stub version.
- 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. */
-
-#if !defined _SIGNAL_H && !defined __need_siginfo_t \
- && !defined __need_sigevent_t
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-#if (!defined __have_sigval_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
-# define __have_sigval_t 1
-
-/* Type for data associated with a signal. */
-typedef union sigval
- {
- int sival_int;
- void *sival_ptr;
- } sigval_t;
-#endif
-
-#if (!defined __have_siginfo_t \
- && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t 1
-
-typedef struct siginfo
- {
- int si_signo; /* Signal number. */
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
- __pid_t si_pid; /* Sending process ID. */
- __uid_t si_uid; /* Real user ID of sending process. */
- void *si_addr; /* Address of faulting instruction. */
- int si_status; /* Exit value or signal. */
- long int si_band; /* Band event for SIGPOLL. */
- union sigval si_value; /* Signal value. */
- } siginfo_t;
-
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum
-{
- SI_ASYNCIO = -4, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER /* Sent by kill, sigsend, raise. */
-# define SI_USER SI_USER
-};
-
-
-/* `si_code' values for SIGILL signal. */
-enum
-{
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILL_OPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum
-{
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum
-{
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum
-{
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
-};
-
-/* `si_code' values for SIGTRAP signal. */
-enum
-{
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-
-/* `si_code' values for SIGCHLD signal. */
-enum
-{
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum
-{
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-
-# undef __need_siginfo_t
-#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
-
-
-#if (defined _SIGNAL_H || defined __need_sigevent_t) \
- && !defined __have_sigevent_t
-# define __have_sigevent_t 1
-
-/* Structure to transport application-defined values with signals. */
-# define SIGEV_MAX_SIZE 64
-# define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3)
-
-typedef struct sigevent
- {
- sigval_t sigev_value;
- int sigev_signo;
- int sigev_notify;
- void (*sigev_notify_function) (sigval_t); /* Function to start. */
- void *sigev_notify_attributes; /* Really pthread_attr_t.*/
- } sigevent_t;
-
-/* `sigev_notify' values. */
-enum
-{
- SIGEV_SIGNAL = 0, /* Notify via signal. */
-# define SIGEV_SIGNAL SIGEV_SIGNAL
- SIGEV_NONE, /* Other notification: meaningless. */
-# define SIGEV_NONE SIGEV_NONE
- SIGEV_THREAD /* Deliver via thread creation. */
-# define SIGEV_THREAD SIGEV_THREAD
-};
-
-#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/generic/bits/signum.h b/sysdeps/generic/bits/signum.h
deleted file mode 100644
index 25331f943c..0000000000
--- a/sysdeps/generic/bits/signum.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (C) 1991, 1993, 1996, 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. */
-
-#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 in the 1-15 range are defined with their historical numbers.
- Signals in the 20-25 range are relatively new and have no ingrained
- numbers. */
-
-/* ANSI signals. */
-#define SIGINT 2 /* Interactive attention signal. */
-#define SIGILL 4 /* Illegal instruction. */
-#define SIGABRT 6 /* Abnormal termination. */
-#define SIGFPE 8 /* Erroneous arithmetic operation. */
-#define SIGSEGV 11 /* Invalid access to storage. */
-#define SIGTERM 15 /* Termination request. */
-
-/* Historical signals specified by POSIX. */
-#define SIGHUP 1 /* Hangup. */
-#define SIGQUIT 3 /* Quit. */
-#define SIGKILL 9 /* Kill (cannot be blocked, caught, or ignored). */
-#define SIGPIPE 13 /* Broken pipe. */
-#define SIGALRM 14 /* Alarm clock. */
-
-/* New(er) POSIX signals. */
-#define SIGSTOP 20 /* Stop (cannot be blocked, caught, or ignored). */
-#define SIGCONT 21 /* Continue. */
-#define SIGTSTP 22 /* Keyboard stop. */
-#define SIGTTIN 23 /* Background read from control terminal. */
-#define SIGTTOU 24 /* Background write to control terminal. */
-#define SIGCHLD 25 /* Child terminated or stopped. */
-
-#define _NSIG 26
-
-/* Archaic names for compatibility. */
-#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP11 */
-#define SIGCLD SIGCHLD /* Old System V name */
-
-#endif /* <signal.h> included. */
diff --git a/sysdeps/generic/bits/sigset.h b/sysdeps/generic/bits/sigset.h
deleted file mode 100644
index 5fc8692df0..0000000000
--- a/sysdeps/generic/bits/sigset.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version.
- Copyright (C) 1991, 1992, 1994, 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 _SIGSET_H_types
-#define _SIGSET_H_types 1
-
-typedef int __sig_atomic_t;
-
-/* A `sigset_t' has a bit for each signal. */
-typedef unsigned long int __sigset_t;
-
-#endif
-
-
-/* We only want to define these functions if <signal.h> was actually
- included; otherwise we were included just to define the types. Since we
- are namespace-clean, it wouldn't hurt to define extra macros. But
- trouble can be caused by functions being defined (e.g., any global
- register vars declared later will cause compilation errors). */
-
-#if !defined _SIGSET_H_fns && defined _SIGNAL_H
-#define _SIGSET_H_fns 1
-
-#ifndef _EXTERN_INLINE
-# define _EXTERN_INLINE extern __inline
-#endif
-
-/* Return a mask that includes SIG only. The cast to `sigset_t' avoids
- overflow if `sigset_t' is wider than `int'. */
-#define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1))
-
-#define __sigemptyset(set) ((*(set) = (__sigset_t) 0), 0)
-#define __sigfillset(set) ((*(set) = ~(__sigset_t) 0), 0)
-
-#ifdef _GNU_SOURCE
-# define __sigisemptyset(set) (*(set) == (__sigset_t) 0)
-# define __sigandset(dest, left, right) \
- ((*(dest) = (*(left) & *(right))), 0)
-# define __sigorset(dest, left, right) \
- ((*(dest) = (*(left) | *(right))), 0)
-#endif
-
-/* These functions needn't check for a bogus signal number -- error
- checking is done in the non __ versions. */
-
-extern int __sigismember (__const __sigset_t *, int);
-extern int __sigaddset (__sigset_t *, int);
-extern int __sigdelset (__sigset_t *, int);
-
-#ifdef __USE_EXTERN_INLINES
-# define __SIGSETFN(NAME, BODY, CONST) \
- _EXTERN_INLINE int \
- NAME (CONST __sigset_t *__set, int __sig) \
- { \
- __sigset_t __mask = __sigmask (__sig); \
- return BODY; \
- }
-
-__SIGSETFN (__sigismember, (*__set & __mask) ? 1 : 0, __const)
-__SIGSETFN (__sigaddset, ((*__set |= __mask), 0), )
-__SIGSETFN (__sigdelset, ((*__set &= ~__mask), 0), )
-
-# undef __SIGSETFN
-#endif
-
-
-#endif /* ! _SIGSET_H_fns. */
diff --git a/sysdeps/generic/bits/sigstack.h b/sysdeps/generic/bits/sigstack.h
deleted file mode 100644
index de79c90afa..0000000000
--- a/sysdeps/generic/bits/sigstack.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* sigstack, sigaltstack definitions.
- Copyright (C) 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 _SIGNAL_H
-# error "Never include this file directly. Use <signal.h> instead"
-#endif
-
-
-/* Structure describing a signal stack (obsolete). */
-struct sigstack
- {
- __ptr_t ss_sp; /* Signal stack pointer. */
- int ss_onstack; /* Nonzero if executing on this stack. */
- };
-
-
-/* Alternate, preferred interface. */
-typedef struct sigaltstack
- {
- __ptr_t ss_sp;
- size_t ss_size;
- int ss_flags;
- } stack_t;
-
-
-/* Possible values for `ss_flags.'. */
-enum
-{
- SS_ONSTACK = 0x0001,
-#define SS_ONSTACK SS_ONSTACK
- SS_DISABLE = 0x0004
-#define SS_DISABLE SS_DISABLE
-};
-
-/* Minumum stack size for a signal handler. */
-#define MINSIGSTKSZ 8192
-
-/* System default stack size. */
-#define SIGSTKSZ (MINSIGSTKSZ + 32768)
diff --git a/sysdeps/generic/bits/sigthread.h b/sysdeps/generic/bits/sigthread.h
deleted file mode 100644
index 2edb58cd51..0000000000
--- a/sysdeps/generic/bits/sigthread.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Signal handling function for threaded programs. Generic version.
- Copyright (C) 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 _BITS_SIGTHREAD_H
-#define _BITS_SIGTHREAD_H 1
-
-#if !defined _SIGNAL_H && !defined _PTHREAD_H
-# error "Never include this file directly. Use <pthread.h> instead"
-#endif
-
-/* Modify the signal mask for the calling thread. The arguments have the
- same meaning as for sigprocmask; in fact, this and sigprocmask might be
- the same function. We declare this the same on all platforms, since it
- doesn't use any thread-related types. */
-extern int pthread_sigmask (int __how, __const __sigset_t *__newmask,
- __sigset_t *__oldmask) __THROW;
-
-
-#endif /* bits/sigthread.h */
diff --git a/sysdeps/generic/bits/sockaddr.h b/sysdeps/generic/bits/sockaddr.h
deleted file mode 100644
index 3e1d1312d8..0000000000
--- a/sysdeps/generic/bits/sockaddr.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version.
- Copyright (C) 1995,1996,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. */
-
-/*
- * Never include this file directly; use <sys/socket.h> instead.
- */
-
-#ifndef _BITS_SOCKADDR_H
-#define _BITS_SOCKADDR_H 1
-
-
-/* POSIX.1g specifies this type name for the `sa_family' member. */
-typedef unsigned short int sa_family_t;
-
-/* This macro is used to declare the initial common members
- of the data types used for socket addresses, `struct sockaddr',
- `struct sockaddr_in', `struct sockaddr_un', etc. */
-
-#define __SOCKADDR_COMMON(sa_prefix) \
- sa_family_t sa_prefix##family
-
-#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
-
-#endif /* bits/sockaddr.h */
diff --git a/sysdeps/generic/bits/socket.h b/sysdeps/generic/bits/socket.h
deleted file mode 100644
index 20e6f0337f..0000000000
--- a/sysdeps/generic/bits/socket.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/* System-specific socket constants and types. Generic/4.3 BSD version.
- Copyright (C) 1991,92,1994-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 __BITS_SOCKET_H
-#define __BITS_SOCKET_H 1
-
-#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
-# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
-#endif
-
-#include <limits.h>
-#include <bits/types.h>
-
-#define __need_size_t
-#include <stddef.h>
-
-/* Type for length arguments in socket calls. */
-#ifndef __socklen_t_defined
-typedef __socklen_t socklen_t;
-# define __socklen_t_defined
-#endif
-
-
-/* Types of sockets. */
-enum __socket_type
-{
- SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
- byte streams. */
-#define SOCK_STREAM SOCK_STREAM
- SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
- of fixed maximum length. */
-#define SOCK_DGRAM SOCK_DGRAM
- SOCK_RAW = 3, /* Raw protocol interface. */
-#define SOCK_RAW SOCK_RAW
- SOCK_RDM = 4, /* Reliably-delivered messages. */
-#define SOCK_RDM SOCK_RDM
- SOCK_SEQPACKET = 5 /* Sequenced, reliable, connection-based,
- datagrams of fixed maximum length. */
-#define SOCK_SEQPACKET SOCK_SEQPACKET
-};
-
-/* Protocol families. */
-#define PF_UNSPEC 0 /* Unspecified. */
-#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
-#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
-#define PF_FILE PF_LOCAL /* POSIX name for PF_LOCAL. */
-#define PF_INET 2 /* IP protocol family. */
-#define PF_IMPLINK 3 /* ARPAnet IMP protocol. */
-#define PF_PUP 4 /* PUP protocols. */
-#define PF_CHAOS 5 /* MIT Chaos protocols. */
-#define PF_NS 6 /* Xerox NS protocols. */
-#define PF_ISO 7 /* ISO protocols. */
-#define PF_OSI PF_ISO
-#define PF_ECMA 8 /* ECMA protocols. */
-#define PF_DATAKIT 9 /* AT&T Datakit protocols. */
-#define PF_CCITT 10 /* CCITT protocols (X.25 et al). */
-#define PF_SNA 11 /* IBM SNA protocol. */
-#define PF_DECnet 12 /* DECnet protocols. */
-#define PF_DLI 13 /* Direct data link interface. */
-#define PF_LAT 14 /* DEC Local Area Transport protocol. */
-#define PF_HYLINK 15 /* NSC Hyperchannel protocol. */
-#define PF_APPLETALK 16 /* Don't use this. */
-#define PF_ROUTE 17 /* Internal Routing Protocol. */
-#define PF_LINK 18 /* Link layer interface. */
-#define PF_XTP 19 /* eXpress Transfer Protocol (no AF). */
-#define PF_COIP 20 /* Connection-oriented IP, aka ST II. */
-#define PF_CNT 21 /* Computer Network Technology. */
-#define PF_RTIP 22 /* Help Identify RTIP packets. **/
-#define PF_IPX 23 /* Novell Internet Protocol. */
-#define PF_SIP 24 /* Simple Internet Protocol. */
-#define PF_PIP 25 /* Help Identify PIP packets. */
-#define PF_INET6 26 /* IP version 6. */
-#define PF_MAX 27
-
-/* Address families. */
-#define AF_UNSPEC PF_UNSPEC
-#define AF_LOCAL PF_LOCAL
-#define AF_UNIX PF_UNIX
-#define AF_FILE PF_FILE
-#define AF_INET PF_INET
-#define AF_IMPLINK PF_IMPLINK
-#define AF_PUP PF_PUP
-#define AF_CHAOS PF_CHAOS
-#define AF_NS PF_NS
-#define AF_ISO PF_ISO
-#define AF_OSI PF_OSI
-#define AF_ECMA PF_ECMA
-#define AF_DATAKIT PF_DATAKIT
-#define AF_CCITT PF_CCITT
-#define AF_SNA PF_SNA
-#define AF_DECnet PF_DECnet
-#define AF_DLI PF_DLI
-#define AF_LAT PF_LAT
-#define AF_HYLINK PF_HYLINK
-#define AF_APPLETALK PF_APPLETALK
-#define AF_ROUTE PF_ROUTE
-#define AF_LINK PF_LINK
-#define pseudo_AF_XTP PF_XTP
-#define AF_COIP PF_COIP
-#define AF_CNT PF_CNT
-#define pseudo_AF_RTIP PF_RTIP
-#define AF_IPX PF_IPX
-#define AF_SIP PF_SIP
-#define pseudo_AF_PIP PF_PIP
-#define AF_INET6 PF_INET6
-#define AF_MAX PF_MAX
-
-
-/* Get the definition of the macro to define the common sockaddr members. */
-#include <bits/sockaddr.h>
-
-/* Structure describing a generic socket address. */
-struct sockaddr
- {
- __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
- char sa_data[14]; /* Address data. */
- };
-
-
-/* Structure large enough to hold any socket address (with the historical
- exception of AF_UNIX). We reserve 128 bytes. */
-#if ULONG_MAX > 0xffffffff
-# define __ss_aligntype __uint64_t
-#else
-# define __ss_aligntype __uint32_t
-#endif
-#define _SS_SIZE 128
-#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
-
-struct sockaddr_storage
- {
- __SOCKADDR_COMMON (ss_); /* Address family, etc. */
- __ss_aligntype __ss_align; /* Force desired alignment. */
- char __ss_padding[_SS_PADSIZE];
- };
-
-
-/* Bits in the FLAGS argument to `send', `recv', et al. */
-enum
- {
- MSG_OOB = 0x01, /* Process out-of-band data. */
-#define MSG_OOB MSG_OOB
- MSG_PEEK = 0x02, /* Peek at incoming messages. */
-#define MSG_PEEK MSG_PEEK
- MSG_DONTROUTE = 0x04, /* Don't use local routing. */
-#define MSG_DONTROUTE MSG_DONTROUTE
- MSG_EOR = 0x08, /* Data completes record. */
-#define MSG_EOR MSG_EOR
- MSG_TRUNC = 0x10, /* Data discarded before delivery. */
-#define MSG_TRUNC MSG_TRUNC
- MSG_CTRUNC = 0x20, /* Control data lost before delivery. */
-#define MSG_CTRUNC MSG_CTRUNC
- MSG_WAITALL = 0x40, /* Wait for full request or error. */
-#define MSG_WAITALL MSG_WAITALL
- MSG_DONTWAIT = 0x80 /* This message should be nonblocking. */
-#define MSG_DONTWAIT MSG_DONTWAIT
- };
-
-
-/* Structure describing messages sent by
- `sendmsg' and received by `recvmsg'. */
-struct msghdr
- {
- __ptr_t msg_name; /* Address to send to/receive from. */
- socklen_t msg_namelen; /* Length of address data. */
-
- struct iovec *msg_iov; /* Vector of data to send/receive into. */
- int msg_iovlen; /* Number of elements in the vector. */
-
- __ptr_t msg_accrights; /* Access rights information. */
- socklen_t msg_accrightslen; /* Length of access rights information. */
-
- int msg_flags; /* Flags in received message. */
- };
-
-
-/* Protocol number used to manipulate socket-level options
- with `getsockopt' and `setsockopt'. */
-#define SOL_SOCKET 0xffff
-
-/* Socket-level options for `getsockopt' and `setsockopt'. */
-enum
- {
- SO_DEBUG = 0x0001, /* Record debugging information. */
-#define SO_DEBUG SO_DEBUG
- SO_ACCEPTCONN = 0x0002, /* Accept connections on socket. */
-#define SO_ACCEPTCONN SO_ACCEPTCONN
- SO_REUSEADDR = 0x0004, /* Allow reuse of local addresses. */
-#define SO_REUSEADDR SO_REUSEADDR
- SO_KEEPALIVE = 0x0008, /* Keep connections alive and send
- SIGPIPE when they die. */
-#define SO_KEEPALIVE SO_KEEPALIVE
- SO_DONTROUTE = 0x0010, /* Don't do local routing. */
-#define SO_DONTROUTE SO_DONTROUTE
- SO_BROADCAST = 0x0020, /* Allow transmission of
- broadcast messages. */
-#define SO_BROADCAST SO_BROADCAST
- SO_USELOOPBACK = 0x0040, /* Use the software loopback to avoid
- hardware use when possible. */
-#define SO_USELOOPBACK SO_USELOOPBACK
- SO_LINGER = 0x0080, /* Block on close of a reliable
- socket to transmit pending data. */
-#define SO_LINGER SO_LINGER
- SO_OOBINLINE = 0x0100, /* Receive out-of-band data in-band. */
-#define SO_OOBINLINE SO_OOBINLINE
- SO_REUSEPORT = 0x0200, /* Allow local address and port reuse. */
-#define SO_REUSEPORT SO_REUSEPORT
- SO_SNDBUF = 0x1001, /* Send buffer size. */
-#define SO_SNDBUF SO_SNDBUF
- SO_RCVBUF = 0x1002, /* Receive buffer. */
-#define SO_RCVBUF SO_RCVBUF
- SO_SNDLOWAT = 0x1003, /* Send low-water mark. */
-#define SO_SNDLOWAT SO_SNDLOWAT
- SO_RCVLOWAT = 0x1004, /* Receive low-water mark. */
-#define SO_RCVLOWAT SO_RCVLOWAT
- SO_SNDTIMEO = 0x1005, /* Send timeout. */
-#define SO_SNDTIMEO SO_SNDTIMEO
- SO_RCVTIMEO = 0x1006, /* Receive timeout. */
-#define SO_RCVTIMEO SO_RCVTIMEO
- SO_ERROR = 0x1007, /* Get and clear error status. */
-#define SO_ERROR SO_ERROR
- SO_STYLE = 0x1008, /* Get socket connection style. */
-#define SO_STYLE SO_STYLE
- SO_TYPE = SO_STYLE /* Compatible name for SO_STYLE. */
-#define SO_TYPE SO_TYPE
- };
-
-/* Structure used to manipulate the SO_LINGER option. */
-struct linger
- {
- int l_onoff; /* Nonzero to linger on close. */
- int l_linger; /* Time to linger. */
- };
-
-#endif /* bits/socket.h */
diff --git a/sysdeps/generic/bits/stat.h b/sysdeps/generic/bits/stat.h
deleted file mode 100644
index c8391fc87f..0000000000
--- a/sysdeps/generic/bits/stat.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (C) 1992, 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_STAT_H
-# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
-#endif
-
-/* This structure needs to be defined in accordance with the
- implementation of __stat, __fstat, and __lstat. */
-
-#include <bits/types.h>
-
-/* Structure describing file characteristics. */
-struct stat
- {
- /* These are the members that POSIX.1 requires. */
-
- __mode_t st_mode; /* File mode. */
-#ifndef __USE_FILE_OFFSET64
- __ino_t st_ino; /* File serial number. */
-#else
- __ino64_t st_ino; /* File serial number. */
-#endif
- __dev_t st_dev; /* Device containing the file. */
- __nlink_t st_nlink; /* Link count. */
-
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group. */
-#ifndef __USE_FILE_OFFSET64
- __off_t st_size; /* Size of file, in bytes. */
-#else
- __off64_t st_size; /* Size of file, in bytes. */
-#endif
-
- __time_t st_atime; /* Time of last access. */
- __time_t st_mtime; /* Time of last modification. */
- __time_t st_ctime; /* Time of last status change. */
-
- /* This should be defined if there is a `st_blksize' member. */
-#undef _STATBUF_ST_BLKSIZE
- };
-
-/* Encoding of the file mode. These are the standard Unix values,
- but POSIX.1 does not specify what values should be used. */
-
-#define __S_IFMT 0170000 /* These bits determine file type. */
-
-/* File types. */
-#define __S_IFDIR 0040000 /* Directory. */
-#define __S_IFCHR 0020000 /* Character device. */
-#define __S_IFBLK 0060000 /* Block device. */
-#define __S_IFREG 0100000 /* Regular file. */
-#define __S_IFIFO 0010000 /* FIFO. */
-
-/* POSIX.1b objects. */
-#define __S_TYPEISMQ(buf) 0
-#define __S_TYPEISSEM(buf) 0
-#define __S_TYPEISSHM(buf) 0
-
-/* Protection bits. */
-
-#define __S_ISUID 04000 /* Set user ID on execution. */
-#define __S_ISGID 02000 /* Set group ID on execution. */
-#define __S_IREAD 0400 /* Read by owner. */
-#define __S_IWRITE 0200 /* Write by owner. */
-#define __S_IEXEC 0100 /* Execute by owner. */
-
-#ifdef __USE_LARGEFILE64
-struct stat64
- {
- __mode_t st_mode; /* File mode. */
- __ino64_t st_ino; /* File serial number. */
- __dev_t st_dev; /* Device. */
- __nlink_t st_nlink; /* Link count. */
-
- __uid_t st_uid; /* User ID of the file's owner. */
- __gid_t st_gid; /* Group ID of the file's group.*/
- __off64_t st_size; /* Size of file, in bytes. */
-
- __time_t st_atime; /* Time of last access. */
- __time_t st_mtime; /* Time of last modification. */
- __time_t st_ctime; /* Time of last status change. */
- };
-#endif
diff --git a/sysdeps/generic/bits/statfs.h b/sysdeps/generic/bits/statfs.h
deleted file mode 100644
index 851e464fcc..0000000000
--- a/sysdeps/generic/bits/statfs.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Definition of `struct statfs', information about a filesystem.
- 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_STATFS_H
-# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* GNU Hurd NOTE: The size of this structure (16 ints) is known in
- <hurd/hurd_types.defs>, since it is used in the `file_statfs' RPC. MiG
- does not cope at all well with the passed C structure not being of the
- expected size. There are some filler words at the end to allow for
- future expansion. To increase the size of the structure used in the RPC
- and retain binary compatibility, we would need to assign a new message
- number. */
-
-struct statfs
- {
- unsigned int f_type;
- unsigned int f_bsize;
-#ifndef __USE_FILE_OFFSET64
- __fsblkcnt_t f_blocks;
- __fsblkcnt_t f_bfree;
- __fsblkcnt_t f_bavail;
- __fsblkcnt_t f_files;
- __fsblkcnt_t f_ffree;
-#else
- __fsblkcnt64_t f_blocks;
- __fsblkcnt64_t f_bfree;
- __fsblkcnt64_t f_bavail;
- __fsblkcnt64_t f_files;
- __fsblkcnt64_t f_ffree;
-#endif
- __fsid_t f_fsid;
- unsigned int f_namelen;
- unsigned int f_spare[6];
- };
-
-#ifdef __USE_LARGEFILE64
-struct statfs64
- {
- unsigned int f_type;
- unsigned int f_bsize;
- __fsblkcnt64_t f_blocks;
- __fsblkcnt64_t f_bfree;
- __fsblkcnt64_t f_bavail;
- __fsblkcnt64_t f_files;
- __fsblkcnt64_t f_ffree;
- __fsid_t f_fsid;
- unsigned int f_namelen;
- unsigned int f_spare[6];
- };
-#endif
diff --git a/sysdeps/generic/bits/statvfs.h b/sysdeps/generic/bits/statvfs.h
deleted file mode 100644
index 66841bf09a..0000000000
--- a/sysdeps/generic/bits/statvfs.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Definition of `struct statvfs', information about a filesystem.
- Copyright (C) 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. */
-
-#ifndef _SYS_STATVFS_H
-# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* GNU Hurd NOTE: The size of this structure (16 ints) is known in
- <hurd/hurd_types.defs>, since it is used in the `file_statfs' RPC. MiG
- does not cope at all well with the passed C structure not being of the
- expected size. There are some filler words at the end to allow for
- future expansion. To increase the size of the structure used in the RPC
- and retain binary compatibility, we would need to assign a new message
- number. */
-
-struct statvfs
- {
- unsigned long int f_bsize;
- unsigned long int f_frsize;
-#ifndef __USE_FILE_OFFSET64
- __fsblkcnt_t f_blocks;
- __fsblkcnt_t f_bfree;
- __fsblkcnt_t f_bavail;
- __fsfilcnt_t f_files;
- __fsfilcnt_t f_ffree;
- __fsfilcnt_t f_favail;
-#else
- __fsblkcnt64_t f_blocks;
- __fsblkcnt64_t f_bfree;
- __fsblkcnt64_t f_bavail;
- __fsfilcnt64_t f_files;
- __fsfilcnt64_t f_ffree;
- __fsfilcnt64_t f_favail;
-#endif
- __fsid_t f_fsid;
- unsigned long int f_flag;
- unsigned long int f_namemax;
- unsigned int f_spare[6];
- };
-
-#ifdef __USE_LARGEFILE64
-struct statvfs64
- {
- unsigned long int f_bsize;
- unsigned long int f_frsize;
- __fsblkcnt64_t f_blocks;
- __fsblkcnt64_t f_bfree;
- __fsblkcnt64_t f_bavail;
- __fsfilcnt64_t f_files;
- __fsfilcnt64_t f_ffree;
- __fsfilcnt64_t f_favail;
- __fsid_t f_fsid;
- unsigned long int f_flag;
- unsigned long int f_namemax;
- unsigned int f_spare[6];
- };
-#endif
-
-/* Definitions for the flag in `f_flag'. */
-enum
-{
- ST_RDONLY = 1,
-#define ST_RDONLY ST_RDONLY
- ST_NOSUID = 2
-#define ST_NOSUID ST_NOSUID
-};
diff --git a/sysdeps/generic/bits/stdio-lock.h b/sysdeps/generic/bits/stdio-lock.h
deleted file mode 100644
index d7c1db0132..0000000000
--- a/sysdeps/generic/bits/stdio-lock.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Thread package specific definitions of stream lock type. Generic version.
- Copyright (C) 2000, 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
- 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 _BITS_STDIO_LOCK_H
-#define _BITS_STDIO_LOCK_H 1
-
-#include <bits/libc-lock.h>
-
-__libc_lock_define_recursive (typedef, _IO_lock_t)
-
-/* We need recursive (counting) mutexes. */
-#ifdef _LIBC_LOCK_RECURSIVE_INITIALIZER
-# define _IO_lock_initializer _LIBC_LOCK_RECURSIVE_INITIALIZER
-#elif _IO_MTSAFE_IO
- #error libio needs recursive mutexes for _IO_MTSAFE_IO
-#endif
-
-#define _IO_lock_init(_name) __libc_lock_init_recursive (_name)
-#define _IO_lock_fini(_name) __libc_lock_fini_recursive (_name)
-#define _IO_lock_lock(_name) __libc_lock_lock_recursive (_name)
-#define _IO_lock_trylock(_name) __libc_lock_trylock_recursive (_name)
-#define _IO_lock_unlock(_name) __libc_lock_unlock_recursive (_name)
-
-
-#define _IO_cleanup_region_start(_fct, _fp) \
- __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
-#define _IO_cleanup_region_start_noarg(_fct) \
- __libc_cleanup_region_start (1, _fct, NULL)
-#define _IO_cleanup_region_end(_doit) \
- __libc_cleanup_region_end (_doit)
-
-#if defined _LIBC && !defined NOT_IN_libc
-# define _IO_acquire_lock(_fp) \
- _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
- _IO_flockfile (_fp)
-
-# define _IO_release_lock(_fp) \
- _IO_funlockfile (_fp); \
- _IO_cleanup_region_end (0)
-#endif
-
-#endif /* bits/stdio-lock.h */
diff --git a/sysdeps/generic/bits/string.h b/sysdeps/generic/bits/string.h
deleted file mode 100644
index ad68b038b6..0000000000
--- a/sysdeps/generic/bits/string.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This file should provide inline versions of string functions.
-
- Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-
- This file should define __STRING_INLINES if functions are actually defined
- as inlines. */
-
-#ifndef _BITS_STRING_H
-#define _BITS_STRING_H 1
-
-
-#endif /* bits/string.h */
diff --git a/sysdeps/generic/bits/stropts.h b/sysdeps/generic/bits/stropts.h
deleted file mode 100644
index c8e2c2c034..0000000000
--- a/sysdeps/generic/bits/stropts.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Copyright (C) 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. */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_STROPTS_H
-#define _BITS_STROPTS_H 1
-
-#include <bits/types.h>
-
-/* Macros used as `request' argument to `ioctl'. */
-#define __SID ('S' << 8)
-
-#define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data
- block in the first message. */
-#define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current
- STREAM, just below the STREAM head. */
-#define I_POP (__SID | 3) /* Remove STREAMS module from just below the
- STREAM head. */
-#define I_LOOK (__SID | 4) /* Retrieve the name of the module just below
- the STREAM head and place it in a character
- string. */
-#define I_FLUSH (__SID | 5) /* Flush all input and/or output. */
-#define I_SRDOPT (__SID | 6) /* Sets the read mode. */
-#define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */
-#define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl'
- message and send that message downstream. */
-#define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process
- wants the SIGPOLL signal issued. */
-#define I_GETSIG (__SID |10) /* Return the events for which the calling
- process is currently registered to be sent
- a SIGPOLL signal. */
-#define I_FIND (__SID |11) /* Compares the names of all modules currently
- present in the STREAM to the name pointed to
- by `arg'. */
-#define I_LINK (__SID |12) /* Connect two STREAMs. */
-#define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */
-#define I_PEEK (__SID |15) /* Allows a process to retrieve the information
- in the first message on the STREAM head read
- queue without taking the message off the
- queue. */
-#define I_FDINSERT (__SID |16) /* Create a message from the specified
- buffer(s), adds information about another
- STREAM, and send the message downstream. */
-#define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes'
- to send a message, containing a file
- pointer, to the STREAM head at the other end
- of a STREAMS pipe. */
-#define I_RECVFD (__SID |14) /* Non-EFT definition. */
-#define I_SWROPT (__SID |19) /* Set the write mode. */
-#define I_GWROPT (__SID |20) /* Return the current write mode setting. */
-#define I_LIST (__SID |21) /* List all the module names on the STREAM, up
- to and including the topmost driver name. */
-#define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent
- link. */
-#define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were
- connected with a persistent link. */
-#define I_FLUSHBAND (__SID |28) /* Flush only band specified. */
-#define I_CKBAND (__SID |29) /* Check if the message of a given priority
- band exists on the STREAM head read
- queue. */
-#define I_GETBAND (__SID |30) /* Return the priority band of the first
- message on the STREAM head read queue. */
-#define I_ATMARK (__SID |31) /* See if the current message on the STREAM
- head read queue is "marked" by some module
- downstream. */
-#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
- a STREAM is closing and there is data on
- the write queues. */
-#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */
-#define I_CANPUT (__SID |34) /* Check if a certain band is writable. */
-
-
-/* Used in `I_LOOK' request. */
-#define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */
-
-/* Flush options. */
-#define FLUSHR 0x01 /* Flush read queues. */
-#define FLUSHW 0x02 /* Flush write queues. */
-#define FLUSHRW 0x03 /* Flush read and write queues. */
-#ifdef __USE_GNU
-# define FLUSHBAND 0x04 /* Flush only specified band. */
-#endif
-
-/* Possible arguments for `I_SETSIG'. */
-#define S_INPUT 0x0001 /* A message, other than a high-priority
- message, has arrived. */
-#define S_HIPRI 0x0002 /* A high-priority message is present. */
-#define S_OUTPUT 0x0004 /* The write queue for normal data is no longer
- full. */
-#define S_MSG 0x0008 /* A STREAMS signal message that contains the
- SIGPOLL signal reaches the front of the
- STREAM head read queue. */
-#define S_ERROR 0x0010 /* Notification of an error condition. */
-#define S_HANGUP 0x0020 /* Notification of a hangup. */
-#define S_RDNORM 0x0040 /* A normal message has arrived. */
-#define S_WRNORM S_OUTPUT
-#define S_RDBAND 0x0080 /* A message with a non-zero priority has
- arrived. */
-#define S_WRBAND 0x0100 /* The write queue for a non-zero priority
- band is no longer full. */
-#define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND,
- SIGURG is generated instead of SIGPOLL when
- a priority message reaches the front of the
- STREAM head read queue. */
-
-/* Option for `I_PEEK'. */
-#define RS_HIPRI 0x01 /* Only look for high-priority messages. */
-
-/* Options for `I_SRDOPT'. */
-#define RNORM 0x0000 /* Byte-STREAM mode, the default. */
-#define RMSGD 0x0001 /* Message-discard mode. */
-#define RMSGN 0x0002 /* Message-nondiscard mode. */
-#define RPROTDAT 0x0004 /* Deliver the control part of a message as
- data. */
-#define RPROTDIS 0x0008 /* Discard the control part of a message,
- delivering any data part. */
-#define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message
- containing a control part is at the front
- of the STREAM head read queue. */
-#ifdef __USE_GNU
-# define RPROTMASK 0x001C /* The RPROT bits */
-#endif
-
-/* Possible mode for `I_SWROPT'. */
-#define SNDZERO 0x001 /* Send a zero-length message downstream when a
- `write' of 0 bytes occurs. */
-#ifdef __USE_GNU
-# define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if
- sd_werror is set. */
-#endif
-
-/* Arguments for `I_ATMARK'. */
-#define ANYMARK 0x01 /* Check if the message is marked. */
-#define LASTMARK 0x02 /* Check if the message is the last one marked
- on the queue. */
-
-/* Argument for `I_UNLINK'. */
-#ifdef __USE_GNU
-# define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM
- associated with `fildes'. */
-#endif
-
-
-/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */
-#define MSG_HIPRI 0x01 /* Send/receive high priority message. */
-#define MSG_ANY 0x02 /* Receive any message. */
-#define MSG_BAND 0x04 /* Receive message from specified band. */
-
-/* Values returned by getmsg and getpmsg */
-#define MORECTL 1 /* More control information is left in
- message. */
-#define MOREDATA 2 /* More data is left in message. */
-
-
-/* Structure used for the I_FLUSHBAND ioctl on streams. */
-struct bandinfo
- {
- unsigned char bi_pri;
- int bi_flag;
- };
-
-struct strbuf
- {
- int maxlen; /* Maximum buffer length. */
- int len; /* Length of data. */
- char *buf; /* Pointer to buffer. */
- };
-
-struct strpeek
- {
- struct strbuf ctlbuf;
- struct strbuf databuf;
- t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
- };
-
-struct strfdinsert
- {
- struct strbuf ctlbuf;
- struct strbuf databuf;
- t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
- int fildes;
- int offset;
- };
-
-struct strioctl
- {
- int ic_cmd;
- int ic_timout;
- int ic_len;
- char *ic_dp;
- };
-
-struct strrecvfd
- {
- int fd;
- uid_t uid;
- gid_t gid;
- char __fill[8]; /* UnixWare/Solaris compatibility */
- };
-
-
-struct str_mlist
- {
- char l_name[FMNAMESZ + 1];
- };
-
-struct str_list
- {
- int sl_nmods;
- struct str_mlist *sl_modlist;
- };
-
-#endif /* bits/stropts.h */
diff --git a/sysdeps/generic/bits/sys_errlist.h b/sysdeps/generic/bits/sys_errlist.h
deleted file mode 100644
index ab839b7073..0000000000
--- a/sysdeps/generic/bits/sys_errlist.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Declare sys_errlist and sys_nerr, or don't. Don't version.
- Copyright (C) 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 _STDIO_H
-# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead."
-#endif
-
-/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */
diff --git a/sysdeps/generic/bits/termios.h b/sysdeps/generic/bits/termios.h
deleted file mode 100644
index 43bb1ce52d..0000000000
--- a/sysdeps/generic/bits/termios.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/* termios type and macro definitions. 4.4 BSD/generic GNU version.
- Copyright (C) 1993,94,96,97,99,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 _TERMIOS_H
-# error "Never include <bits/termios.h> directly; use <termios.h> instead."
-#endif
-
-/* These macros are also defined in some <bits/ioctls.h> files (with
- numerically identical values), but this serves to shut up cpp's
- complaining. */
-#ifdef __USE_BSD
-
-# ifdef MDMBUF
-# undef MDMBUF
-# endif
-# ifdef FLUSHO
-# undef FLUSHO
-# endif
-# ifdef PENDIN
-# undef PENDIN
-# endif
-
-#endif /* __USE_BSD */
-
-#ifdef ECHO
-# undef ECHO
-#endif
-#ifdef TOSTOP
-# undef TOSTOP
-#endif
-#ifdef NOFLSH
-# undef NOFLSH
-#endif
-
-
-/* These definitions match those used by the 4.4 BSD kernel.
- If the operating system has termios system calls or ioctls that
- correctly implement the POSIX.1 behavior, there should be a
- system-dependent version of this file that defines `struct termios',
- `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately. */
-
-/* Type of terminal control flag masks. */
-typedef unsigned long int tcflag_t;
-
-/* Type of control characters. */
-typedef unsigned char cc_t;
-
-/* Type of baud rate specifiers. */
-typedef long int speed_t;
-
-/* Terminal control structure. */
-struct termios
-{
- /* Input modes. */
- tcflag_t c_iflag;
-#define IGNBRK (1 << 0) /* Ignore break condition. */
-#define BRKINT (1 << 1) /* Signal interrupt on break. */
-#define IGNPAR (1 << 2) /* Ignore characters with parity errors. */
-#define PARMRK (1 << 3) /* Mark parity and framing errors. */
-#define INPCK (1 << 4) /* Enable input parity check. */
-#define ISTRIP (1 << 5) /* Strip 8th bit off characters. */
-#define INLCR (1 << 6) /* Map NL to CR on input. */
-#define IGNCR (1 << 7) /* Ignore CR. */
-#define ICRNL (1 << 8) /* Map CR to NL on input. */
-#define IXON (1 << 9) /* Enable start/stop output control. */
-#define IXOFF (1 << 10) /* Enable start/stop input control. */
-#ifdef __USE_BSD
-# define IXANY (1 << 11) /* Any character will restart after stop. */
-# define IMAXBEL (1 << 13) /* Ring bell when input queue is full. */
-#endif
-#ifdef __USE_GNU
-# define IUCLC (1 << 14) /* Translate upper case input to lower case. */
-#endif
-
- /* Output modes. */
- tcflag_t c_oflag;
-#define OPOST (1 << 0) /* Perform output processing. */
-#ifdef __USE_BSD
-# define ONLCR (1 << 1) /* Map NL to CR-NL on output. */
-# define OXTABS (1 << 2) /* Expand tabs to spaces. */
-# define ONOEOT (1 << 3) /* Discard EOT (^D) on output. */
-#endif
-#ifdef __USE_GNU
-# define OLCUC (1 << 9) /* Translate lower case output to upper case */
-#endif
-
- /* Control modes. */
- tcflag_t c_cflag;
-#ifdef __USE_BSD
-# define CIGNORE (1 << 0) /* Ignore these control flags. */
-#endif
-#define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */
-#define CS5 0 /* 5 bits per byte. */
-#define CS6 (1 << 8) /* 6 bits per byte. */
-#define CS7 (1 << 9) /* 7 bits per byte. */
-#define CS8 (CS6|CS7) /* 8 bits per byte. */
-#define CSTOPB (1 << 10) /* Two stop bits instead of one. */
-#define CREAD (1 << 11) /* Enable receiver. */
-#define PARENB (1 << 12) /* Parity enable. */
-#define PARODD (1 << 13) /* Odd parity instead of even. */
-#define HUPCL (1 << 14) /* Hang up on last close. */
-#define CLOCAL (1 << 15) /* Ignore modem status lines. */
-#ifdef __USE_BSD
-# define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */
-# define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */
-# define CRTSCTS (CCTS_OFLOW|CRTS_IFLOW) /* CTS/RTS flow control. */
-# define MDMBUF (1 << 20) /* Carrier flow control of output. */
-#endif
-
- /* Local modes. */
- tcflag_t c_lflag;
-#ifdef __USE_BSD
-# define ECHOKE (1 << 0) /* Visual erase for KILL. */
-#endif
-#define _ECHOE (1 << 1) /* Visual erase for ERASE. */
-#define ECHOE _ECHOE
-#define _ECHOK (1 << 2) /* Echo NL after KILL. */
-#define ECHOK _ECHOK
-#define _ECHO (1 << 3) /* Enable echo. */
-#define ECHO _ECHO
-#define _ECHONL (1 << 4) /* Echo NL even if ECHO is off. */
-#define ECHONL _ECHONL
-#ifdef __USE_BSD
-# define ECHOPRT (1 << 5) /* Hardcopy visual erase. */
-# define ECHOCTL (1 << 6) /* Echo control characters as ^X. */
-#endif
-#define _ISIG (1 << 7) /* Enable signals. */
-#define ISIG _ISIG
-#define _ICANON (1 << 8) /* Do erase and kill processing. */
-#define ICANON _ICANON
-#ifdef __USE_BSD
-# define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */
-#endif
-#define _IEXTEN (1 << 10) /* Enable DISCARD and LNEXT. */
-#define IEXTEN _IEXTEN
-#define EXTPROC (1 << 11) /* External processing. */
-#define _TOSTOP (1 << 22) /* Send SIGTTOU for background output. */
-#define TOSTOP _TOSTOP
-#ifdef __USE_BSD
-# define FLUSHO (1 << 23) /* Output being flushed (state). */
-# define NOKERNINFO (1 << 25) /* Disable VSTATUS. */
-# define PENDIN (1 << 29) /* Retype pending input (state). */
-#endif
-#define _NOFLSH (1 << 31) /* Disable flush after interrupt. */
-#define NOFLSH _NOFLSH
-
- /* Control characters. */
-#define VEOF 0 /* End-of-file character [ICANON]. */
-#define VEOL 1 /* End-of-line character [ICANON]. */
-#ifdef __USE_BSD
-# define VEOL2 2 /* Second EOL character [ICANON]. */
-#endif
-#define VERASE 3 /* Erase character [ICANON]. */
-#ifdef __USE_BSD
-# define VWERASE 4 /* Word-erase character [ICANON]. */
-#endif
-#define VKILL 5 /* Kill-line character [ICANON]. */
-#ifdef __USE_BSD
-# define VREPRINT 6 /* Reprint-line character [ICANON]. */
-#endif
-#define VINTR 8 /* Interrupt character [ISIG]. */
-#define VQUIT 9 /* Quit character [ISIG]. */
-#define VSUSP 10 /* Suspend character [ISIG]. */
-#ifdef __USE_BSD
-# define VDSUSP 11 /* Delayed suspend character [ISIG]. */
-#endif
-#define VSTART 12 /* Start (X-ON) character [IXON, IXOFF]. */
-#define VSTOP 13 /* Stop (X-OFF) character [IXON, IXOFF]. */
-#ifdef __USE_BSD
-# define VLNEXT 14 /* Literal-next character [IEXTEN]. */
-# define VDISCARD 15 /* Discard character [IEXTEN]. */
-#endif
-#define VMIN 16 /* Minimum number of bytes read at once [!ICANON]. */
-#define VTIME 17 /* Time-out value (tenths of a second) [!ICANON]. */
-#ifdef __USE_BSD
-# define VSTATUS 18 /* Status character [ICANON]. */
-#endif
-#define NCCS 20 /* Value duplicated in <hurd/tioctl.defs>. */
- cc_t c_cc[NCCS];
-
- /* Input and output baud rates. */
- speed_t __ispeed, __ospeed;
-#define B0 0 /* Hang up. */
-#define B50 50 /* 50 baud. */
-#define B75 75 /* 75 baud. */
-#define B110 110 /* 110 baud. */
-#define B134 134 /* 134.5 baud. */
-#define B150 150 /* 150 baud. */
-#define B200 200 /* 200 baud. */
-#define B300 300 /* 300 baud. */
-#define B600 600 /* 600 baud. */
-#define B1200 1200 /* 1200 baud. */
-#define B1800 1800 /* 1800 baud. */
-#define B2400 2400 /* 2400 baud. */
-#define B4800 4800 /* 4800 baud. */
-#define B9600 9600 /* 9600 baud. */
-#define B19200 19200 /* 19200 baud. */
-#define B38400 38400 /* 38400 baud. */
-#ifdef __USE_MISC
-# define EXTA 19200
-# define EXTB 38400
-#endif
-#define B57600 57600
-#define B115200 115200
-#define B230400 230400
-#define B460800 460800
-#define B500000 500000
-#define B576000 576000
-#define B921600 921600
-#define B1000000 1000000
-#define B1152000 1152000
-#define B1500000 1500000
-#define B2000000 2000000
-#define B2500000 2500000
-#define B3000000 3000000
-#define B3500000 3500000
-#define B4000000 4000000
-};
-
-#define _IOT_termios /* Hurd ioctl type field. */ \
- _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
-
-/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
-#define TCSANOW 0 /* Change immediately. */
-#define TCSADRAIN 1 /* Change when pending output is written. */
-#define TCSAFLUSH 2 /* Flush pending input before changing. */
-#ifdef __USE_BSD
-# define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */
-#endif
-
-/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
-#define TCIFLUSH 1 /* Discard data received but not yet read. */
-#define TCOFLUSH 2 /* Discard data written but not yet sent. */
-#define TCIOFLUSH 3 /* Discard all pending data. */
-
-/* Values for the ACTION argument to `tcflow'. */
-#define TCOOFF 1 /* Suspend output. */
-#define TCOON 2 /* Restart suspended output. */
-#define TCIOFF 3 /* Send a STOP character. */
-#define TCION 4 /* Send a START character. */
diff --git a/sysdeps/generic/bits/time.h b/sysdeps/generic/bits/time.h
deleted file mode 100644
index b3184d1de9..0000000000
--- a/sysdeps/generic/bits/time.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* System-dependent timing definitions. Generic version.
- Copyright (C) 1996,1997,1999-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. */
-
-/*
- * Never include this file directly; use <time.h> instead.
- */
-
-#ifndef __need_timeval
-# ifndef _BITS_TIME_H
-# define _BITS_TIME_H 1
-
-/* ISO/IEC 9899:1990 7.12.1: <time.h>
- The macro `CLOCKS_PER_SEC' is the number per second of the value
- returned by the `clock' function. */
-/* CAE XSH, Issue 4, Version 2: <time.h>
- The value of CLOCKS_PER_SEC is required to be 1 million on all
- XSI-conformant systems. */
-# define CLOCKS_PER_SEC 1000000l
-
-# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
-/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
- presents the real value for clock ticks per second for the system. */
-# include <bits/types.h>
-extern long int __sysconf (int);
-# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
-# endif
-
-# ifdef __USE_POSIX199309
-/* Identifier for system-wide realtime clock. */
-# define CLOCK_REALTIME 0
-/* Monotonic system-wide clock. */
-# define CLOCK_MONOTONIC 1
-/* High-resolution timer from the CPU. */
-# define CLOCK_PROCESS_CPUTIME_ID 2
-/* Thread-specific CPU-time clock. */
-# define CLOCK_THREAD_CPUTIME_ID 3
-
-/* Flag to indicate time is absolute. */
-# define TIMER_ABSTIME 1
-# endif
-
-# endif /* bits/time.h */
-#endif
-
-#ifdef __need_timeval
-# undef __need_timeval
-# ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL 1
-# include <bits/types.h>
-
-/* A time value that is accurate to the nearest
- microsecond but also has a range of years. */
-struct timeval
- {
- __time_t tv_sec; /* Seconds. */
- __suseconds_t tv_usec; /* Microseconds. */
- };
-# endif /* struct timeval */
-#endif /* need timeval */
diff --git a/sysdeps/generic/bits/typesizes.h b/sysdeps/generic/bits/typesizes.h
deleted file mode 100644
index e9226c4174..0000000000
--- a/sysdeps/generic/bits/typesizes.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* bits/typesizes.h -- underlying types for *_t. Generic version.
- 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
- 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 _BITS_TYPES_H
-# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
-#endif
-
-#ifndef _BITS_TYPESIZES_H
-#define _BITS_TYPESIZES_H 1
-
-/* See <bits/types.h> for the meaning of these macros. This file exists so
- that <bits/types.h> need not vary across different GNU platforms. */
-
-#define __DEV_T_TYPE __UQUAD_TYPE
-#define __UID_T_TYPE __U32_TYPE
-#define __GID_T_TYPE __U32_TYPE
-#define __INO_T_TYPE __ULONGWORD_TYPE
-#define __INO64_T_TYPE __UQUAD_TYPE
-#define __MODE_T_TYPE __U32_TYPE
-#define __NLINK_T_TYPE __UWORD_TYPE
-#define __OFF_T_TYPE __SLONGWORD_TYPE
-#define __OFF64_T_TYPE __SQUAD_TYPE
-#define __PID_T_TYPE __S32_TYPE
-#define __RLIM_T_TYPE __ULONGWORD_TYPE
-#define __RLIM64_T_TYPE __UQUAD_TYPE
-#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
-#define __BLKCNT64_T_TYPE __SQUAD_TYPE
-#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
-#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
-#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
-#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
-#define __ID_T_TYPE __U32_TYPE
-#define __CLOCK_T_TYPE __SLONGWORD_TYPE
-#define __TIME_T_TYPE __SLONGWORD_TYPE
-#define __USECONDS_T_TYPE __U32_TYPE
-#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
-#define __DADDR_T_TYPE __S32_TYPE
-#define __SWBLK_T_TYPE __SLONGWORD_TYPE
-#define __KEY_T_TYPE __S32_TYPE
-#define __CLOCKID_T_TYPE __S32_TYPE
-#define __TIMER_T_TYPE void *
-#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
-#define __FSID_T_TYPE struct { int __val[2]; }
-#define __SSIZE_T_TYPE __SWORD_TYPE
-
-/* Number of descriptors that can fit in an `fd_set'. */
-#define __FD_SETSIZE 1024
-
-
-#endif /* bits/typesizes.h */
diff --git a/sysdeps/generic/bits/ustat.h b/sysdeps/generic/bits/ustat.h
deleted file mode 100644
index 69c6b72270..0000000000
--- a/sysdeps/generic/bits/ustat.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#ifndef _SYS_USTAT_H
-# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
-#endif
-
-#include <sys/types.h>
-
-struct ustat
- {
- __daddr_t f_tfree; /* Number of free blocks. */
- __ino_t f_tinode; /* Number of free inodes. */
- char f_fname[6];
- char f_fpack[6];
- };
diff --git a/sysdeps/generic/bits/utsname.h b/sysdeps/generic/bits/utsname.h
deleted file mode 100644
index 48e8a8e9b6..0000000000
--- a/sysdeps/generic/bits/utsname.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright (C) 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_UTSNAME_H
-# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
-#endif
-
-/* The size of the character arrays used to hold the information
- in a `struct utsname'. Enlarge this as necessary. */
-#define _UTSNAME_LENGTH 1024
diff --git a/sysdeps/generic/bits/waitflags.h b/sysdeps/generic/bits/waitflags.h
deleted file mode 100644
index 157dd1211a..0000000000
--- a/sysdeps/generic/bits/waitflags.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Definitions of flag bits for `waitpid' et al.
- Copyright (C) 1992, 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. */
-
-#if !defined _SYS_WAIT_H && !defined _STDLIB_H
-# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
-#endif
-
-
-/* Bits in the third argument to `waitpid'. */
-#define WNOHANG 1 /* Don't block waiting. */
-#define WUNTRACED 2 /* Report status of stopped children. */
diff --git a/sysdeps/generic/bits/wchar.h b/sysdeps/generic/bits/wchar.h
deleted file mode 100644
index ef1f56363a..0000000000
--- a/sysdeps/generic/bits/wchar.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* wchar_t type related definitions.
- Copyright (C) 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 _BITS_WCHAR_H
-#define _BITS_WCHAR_H 1
-
-#define __WCHAR_MIN (-2147483647 - 1)
-#define __WCHAR_MAX (2147483647)
-
-#endif /* bits/wchar.h */
diff --git a/sysdeps/generic/bits/wordsize.h b/sysdeps/generic/bits/wordsize.h
deleted file mode 100644
index 9ef0e8526a..0000000000
--- a/sysdeps/generic/bits/wordsize.h
+++ /dev/null
@@ -1 +0,0 @@
-#error "This file must be written based on the data type sizes of the target"
diff --git a/sysdeps/generic/bits/xtitypes.h b/sysdeps/generic/bits/xtitypes.h
deleted file mode 100644
index c21bfb036c..0000000000
--- a/sysdeps/generic/bits/xtitypes.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. Generic.
- Copyright (C) 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 _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H 1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>. */
-typedef __SLONGWORD_TYPE __t_scalar_t;
-typedef __ULONGWORD_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/sysdeps/generic/unwind-dw2.c b/sysdeps/generic/unwind-dw2.c
index 619250e614..301b53176e 100644
--- a/sysdeps/generic/unwind-dw2.c
+++ b/sysdeps/generic/unwind-dw2.c
@@ -1,6 +1,6 @@
/* DWARF2 exception handling and frame unwind runtime interface routines.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -256,7 +256,7 @@ extract_cie_info (struct dwarf_cie *cie, struct _Unwind_Context *context,
_Unwind_FrameState *fs)
{
const unsigned char *aug = cie->augmentation;
- const unsigned char *p = aug + strlen (aug) + 1;
+ const unsigned char *p = aug + strlen ((const char *) aug) + 1;
const unsigned char *ret = NULL;
_Unwind_Word utmp;
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 1508311a4a..56da01756d 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -1408,6 +1408,54 @@ TRANS error; @pxref{Cancel AIO Operations}. */
# define ERR_MAX EMEDIUMTYPE
# endif
#endif
+#ifdef ENOKEY
+/* */
+ [ERR_REMAP (ENOKEY)] = N_("Required key not available"),
+# if ENOKEY > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX ENOKEY
+# endif
+#endif
+#ifdef EKEYEXPIRED
+/* */
+ [ERR_REMAP (EKEYEXPIRED)] = N_("Key has expired"),
+# if EKEYEXPIRED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYEXPIRED
+# endif
+#endif
+#ifdef EKEYREVOKED
+/* */
+ [ERR_REMAP (EKEYREVOKED)] = N_("Key has been revoked"),
+# if EKEYREVOKED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYREVOKED
+# endif
+#endif
+#ifdef EKEYREJECTED
+/* */
+ [ERR_REMAP (EKEYREJECTED)] = N_("Key was rejected by service"),
+# if EKEYREJECTED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYREJECTED
+# endif
+#endif
+#ifdef EOWNERDEAD
+/* */
+ [ERR_REMAP (EOWNERDEAD)] = N_("Owner died"),
+# if EOWNERDEAD > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EOWNERDEAD
+# endif
+#endif
+#ifdef ENOTRECOVERABLE
+/* */
+ [ERR_REMAP (ENOTRECOVERABLE)] = N_("State not recoverable"),
+# if ENOTRECOVERABLE > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX ENOTRECOVERABLE
+# endif
+#endif
};
#define NERR \
diff --git a/sysdeps/i386/fpu/e_expl.c b/sysdeps/i386/fpu/e_expl.c
index a090d0dabc..2240ceac47 100644
--- a/sysdeps/i386/fpu/e_expl.c
+++ b/sysdeps/i386/fpu/e_expl.c
@@ -24,8 +24,8 @@
#include <math_private.h>
-static long double c0 = 1.44268798828125L;
-static long double c1 = 7.05260771340735992468e-6L;
+static const long double c0 = 1.44268798828125L;
+static const long double c1 = 7.05260771340735992468e-6L;
long double
__ieee754_expl (long double x)
diff --git a/sysdeps/i386/i586/memusage.h b/sysdeps/i386/i586/memusage.h
new file mode 100644
index 0000000000..c8170874d0
--- /dev/null
+++ b/sysdeps/i386/i586/memusage.h
@@ -0,0 +1 @@
+#include "../i686/memusage.h"
diff --git a/sysdeps/i386/memusage.h b/sysdeps/i386/memusage.h
index 73ce98c630..8d5749f655 100644
--- a/sysdeps/i386/memusage.h
+++ b/sysdeps/i386/memusage.h
@@ -17,6 +17,5 @@
02111-1307 USA. */
#define GETSP() ({ register uintptr_t stack_ptr asm ("esp"); stack_ptr; })
-#define GETTIME(low,high) asm ("rdtsc" : "=a" (low), "=d" (high))
#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/ieee754/dbl-64/e_exp2.c b/sysdeps/ieee754/dbl-64/e_exp2.c
index 397acd182c..b7ed7398a3 100644
--- a/sysdeps/ieee754/dbl-64/e_exp2.c
+++ b/sysdeps/ieee754/dbl-64/e_exp2.c
@@ -1,5 +1,5 @@
/* Double-precision floating point 2^x.
- Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -37,8 +37,15 @@
#include "t_exp2.h"
-static const volatile double TWO1023 = 8.988465674311579539e+307;
-static const volatile double TWOM1000 = 9.3326361850321887899e-302;
+/* XXX I know the assembler generates a warning about incorrect section
+ attributes. But without the attribute here the compiler places the
+ constants in the .data section. Ideally the constant is placed in
+ .rodata.cst8 so that it can be merged, but gcc sucks, it ICEs when
+ we try to force this section on it. --drepper */
+static const volatile double TWO1023 __attribute__ ((section (".rodata")))
+ = 8.988465674311579539e+307;
+static const volatile double TWOM1000 __attribute__ ((section (".rodata")))
+ = 9.3326361850321887899e-302;
double
__ieee754_exp2 (double x)
diff --git a/sysdeps/ieee754/dbl-64/halfulp.c b/sysdeps/ieee754/dbl-64/halfulp.c
index 9e1111b8db..478a4bacf6 100644
--- a/sysdeps/ieee754/dbl-64/halfulp.c
+++ b/sysdeps/ieee754/dbl-64/halfulp.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2005 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,7 +42,7 @@
double __ieee754_sqrt(double x);
-int4 tab54[32] = {
+static const int4 tab54[32] = {
262143, 11585, 1782, 511, 210, 107, 63, 42,
30, 22, 17, 14, 12, 10, 9, 7,
7, 6, 5, 5, 5, 4, 4, 4,
diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c
index 752272db46..ea55304d9a 100644
--- a/sysdeps/ieee754/flt-32/e_exp2f.c
+++ b/sysdeps/ieee754/flt-32/e_exp2f.c
@@ -1,5 +1,5 @@
/* Single-precision floating point 2^x.
- Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -38,8 +38,15 @@
#include "t_exp2f.h"
-static const volatile float TWOM100 = 7.88860905e-31;
-static const volatile float TWO127 = 1.7014118346e+38;
+/* XXX I know the assembler generates a warning about incorrect section
+ attributes. But without the attribute here the compiler places the
+ constants in the .data section. Ideally the constant is placed in
+ .rodata.cst4 so that it can be merged, but gcc sucks, it ICEs when
+ we try to force this section on it. --drepper */
+static const volatile float TWOM100 __attribute__ ((section (".rodata")))
+ = 7.88860905e-31;
+static const volatile float TWO127 __attribute__ ((section (".rodata")))
+ = 1.7014118346e+38;
float
__ieee754_exp2f (float x)
diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c
index 62448a9554..b3e458c3da 100644
--- a/sysdeps/ieee754/flt-32/e_expf.c
+++ b/sysdeps/ieee754/flt-32/e_expf.c
@@ -1,5 +1,5 @@
/* Single-precision floating point e^x.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
@@ -60,8 +60,15 @@
extern const float __exp_deltatable[178];
extern const double __exp_atable[355] /* __attribute__((mode(DF))) */;
-static const volatile float TWOM100 = 7.88860905e-31;
-static const volatile float TWO127 = 1.7014118346e+38;
+/* XXX I know the assembler generates a warning about incorrect section
+ attributes. But without the attribute here the compiler places the
+ constants in the .data section. Ideally the constant is placed in
+ .rodata.cst4 so that it can be merged, but gcc sucks, it ICEs when
+ we try to force this section on it. --drepper */
+static const volatile float TWOM100 __attribute__ ((section (".rodata")))
+ = 7.88860905e-31;
+static const volatile float TWO127 __attribute__ ((section (".rodata")))
+ = 1.7014118346e+38;
float
__ieee754_expf (float x)
diff --git a/sysdeps/ieee754/flt-32/s_expm1f.c b/sysdeps/ieee754/flt-32/s_expm1f.c
index 375e334c38..7d32dbb016 100644
--- a/sysdeps/ieee754/flt-32/s_expm1f.c
+++ b/sysdeps/ieee754/flt-32/s_expm1f.c
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -20,7 +20,15 @@ static char rcsid[] = "$NetBSD: s_expm1f.c,v 1.5 1995/05/10 20:47:11 jtc Exp $";
#include "math.h"
#include "math_private.h"
-static const volatile float huge = 1.0e+30, tiny = 1.0e-30;
+/* XXX I know the assembler generates a warning about incorrect section
+ attributes. But without the attribute here the compiler places the
+ constants in the .data section. Ideally the constant is placed in
+ .rodata.cst4 so that it can be merged, but gcc sucks, it ICEs when
+ we try to force this section on it. --drepper */
+static const volatile float huge __attribute__ ((section (".rodata")))
+ = 1.0e+30;
+static const volatile float tiny __attribute__ ((section (".rodata")))
+ = 1.0e-30;
#ifdef __STDC__
static const float
@@ -71,7 +79,7 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */
}
/* argument reduction */
- if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
+ if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */
if(xsb==0)
{hi = x - ln2_hi; lo = ln2_lo; k = 1;}
@@ -85,10 +93,10 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */
}
x = hi - lo;
c = (hi-x)-lo;
- }
+ }
else if(hx < 0x33000000) { /* when |x|<2**-25, return x */
t = huge+x; /* return x with inexact flags when x!=0 */
- return x - (t-(huge+x));
+ return x - (t-(huge+x));
}
else k = 0;
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 8728596915..fa7da60204 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1994,95,96,97,99,2001,02, 04 Free Software Foundation, Inc.
+/* Copyright (C) 1994,1995,1996,1997,1999,2001,2002,2004,2005
+ 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 +22,7 @@
#include <hurd.h>
#include <hurd/signal.h>
#include <setjmp.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <sysdep.h> /* For stack growth direction. */
#include "set-hooks.h"
#include <assert.h>
diff --git a/sysdeps/mach/hurd/hppa/trampoline.c b/sysdeps/mach/hurd/hppa/trampoline.c
index bbb5b960ac..fc811c5e7b 100644
--- a/sysdeps/mach/hurd/hppa/trampoline.c
+++ b/sysdeps/mach/hurd/hppa/trampoline.c
@@ -1,5 +1,5 @@
/* Set thread_state for sighandler, and sigcontext to recover. HPPA version.
- Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 1998, 2005 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 @@
02111-1307 USA. */
#include <hurd/signal.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <assert.h>
#include <errno.h>
#include "hurdfault.h"
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c
index 781a0441dc..dddc6f3ef6 100644
--- a/sysdeps/mach/hurd/i386/trampoline.c
+++ b/sysdeps/mach/hurd/i386/trampoline.c
@@ -1,5 +1,6 @@
/* Set thread_state for sighandler, and sigcontext to recover. i386 version.
- Copyright (C) 1994, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1994,1995,1996,1997,1998,1999,2005
+ 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,11 +20,11 @@
#include <hurd/signal.h>
#include <hurd/userlink.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <assert.h>
#include <errno.h>
#include "hurdfault.h"
-#include "intr-msg.h"
+#include <intr-msg.h>
struct sigcontext *
diff --git a/sysdeps/mach/hurd/ifreq.c b/sysdeps/mach/hurd/ifreq.c
index 258ea6368d..9da8a6803a 100644
--- a/sysdeps/mach/hurd/ifreq.c
+++ b/sysdeps/mach/hurd/ifreq.c
@@ -17,6 +17,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <ifreq.h>
+#include <hurd.h>
+#include <hurd/pfinet.h>
+#include <sys/mman.h>
+
+
void
__ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
{
diff --git a/sysdeps/mach/hurd/mips/trampoline.c b/sysdeps/mach/hurd/mips/trampoline.c
index dd42dfc1c6..34e363b1aa 100644
--- a/sysdeps/mach/hurd/mips/trampoline.c
+++ b/sysdeps/mach/hurd/mips/trampoline.c
@@ -1,5 +1,5 @@
/* Set thread_state for sighandler, and sigcontext to recover. MIPS version.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 2005 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,11 +19,11 @@
#include <hurd/signal.h>
#include <hurd/userlink.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <assert.h>
#include <errno.h>
#include "hurdfault.h"
-#include "intr-msg.h"
+#include <intr-msg.h>
struct sigcontext *
@@ -35,7 +35,7 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
__label__ trampoline, rpc_wait_trampoline, firewall;
void *volatile sigsp;
struct sigcontext *scp;
- struct
+ struct
{
int signo;
long int sigcode;
@@ -163,7 +163,7 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
still waiting for a reply. We will have it run the special
trampoline code which retries the message receive before running
the signal handler.
-
+
To do this we change the OPTION argument in its registers to
enable only message reception, since the request message has
already been sent. */
diff --git a/sysdeps/mach/hurd/powerpc/trampoline.c b/sysdeps/mach/hurd/powerpc/trampoline.c
index 4e5d675258..4e1ea4b9d9 100644
--- a/sysdeps/mach/hurd/powerpc/trampoline.c
+++ b/sysdeps/mach/hurd/powerpc/trampoline.c
@@ -1,5 +1,6 @@
/* Set thread_state for sighandler, and sigcontext to recover. For PowerPC.
- Copyright (C) 1994,95,96,97,98,99,2001 Free Software Foundation, Inc.
+ Copyright (C) 1994,1995,1996,1997,1998,1999,2001,2005
+ 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,11 +20,11 @@
#include <hurd/signal.h>
#include <hurd/userlink.h>
-#include "thread_state.h"
+#include <thread_state.h>
#include <assert.h>
#include <errno.h>
#include "hurdfault.h"
-#include "intr-msg.h"
+#include <intr-msg.h>
struct sigcontext *
_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
diff --git a/sysdeps/posix/sprofil.c b/sysdeps/posix/sprofil.c
index 04ca1688ec..853038d078 100644
--- a/sysdeps/posix/sprofil.c
+++ b/sysdeps/posix/sprofil.c
@@ -181,14 +181,14 @@ profil_count_uint (void *pcp)
interrupted code. */
#define profil_counter profil_counter_ushort
#define profil_count(pc) profil_count (pc, 0)
-#include "profil-counter.h"
+#include <profil-counter.h>
#undef profil_counter
#undef profil_count
#define profil_counter profil_counter_uint
#define profil_count(pc) profil_count (pc, 1)
-#include "profil-counter.h"
+#include <profil-counter.h>
static int
insert (int i, unsigned long int start, unsigned long int end, struct prof *p,
diff --git a/sysdeps/powerpc/fpu/libm-test-ulps b/sysdeps/powerpc/fpu/libm-test-ulps
index 272431307c..0b57006d40 100644
--- a/sysdeps/powerpc/fpu/libm-test-ulps
+++ b/sysdeps/powerpc/fpu/libm-test-ulps
@@ -345,22 +345,22 @@ ifloat: 1
# j0
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Test "j0 (2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
-double: 2
+double: 3
float: 1
-idouble: 2
+idouble: 3
ifloat: 1
Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
@@ -379,22 +379,22 @@ idouble: 1
# jn
Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
-double: 2
+double: 3
float: 1
-idouble: 2
+idouble: 3
ifloat: 1
Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
@@ -433,9 +433,9 @@ double: 1
idouble: 1
Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
double: 1
float: 2
@@ -618,7 +618,9 @@ float: 2
ifloat: 2
Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
double: 2
+float: 2
idouble: 2
+ifloat: 2
Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
double: 3
float: 1
@@ -820,9 +822,9 @@ float: 1
ifloat: 1
Function: "j0":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
Function: "j1":
diff --git a/sysdeps/pthread/aio_cancel.c b/sysdeps/pthread/aio_cancel.c
index a37b2c7896..aa1ee443a5 100644
--- a/sysdeps/pthread/aio_cancel.c
+++ b/sysdeps/pthread/aio_cancel.c
@@ -1,5 +1,5 @@
/* Cancel requests associated with given file descriptor.
- Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -34,7 +34,7 @@
#include <assert.h>
#include <errno.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/aio_fsync.c b/sysdeps/pthread/aio_fsync.c
index 4c90d69584..47cc29991f 100644
--- a/sysdeps/pthread/aio_fsync.c
+++ b/sysdeps/pthread/aio_fsync.c
@@ -1,5 +1,5 @@
/* Synchronize I/O in given file descriptor.
- Copyright (C) 1997, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -30,7 +30,7 @@
#undef aio_fsync64
#include <errno.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/aio_read.c b/sysdeps/pthread/aio_read.c
index 62646fb12d..973c6cdd48 100644
--- a/sysdeps/pthread/aio_read.c
+++ b/sysdeps/pthread/aio_read.c
@@ -1,5 +1,5 @@
/* Asynchronous read.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <aio.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/aio_read64.c b/sysdeps/pthread/aio_read64.c
index f91b08b6db..a3a427d804 100644
--- a/sysdeps/pthread/aio_read64.c
+++ b/sysdeps/pthread/aio_read64.c
@@ -1,5 +1,5 @@
/* Asynchronous read, 64bit offset version.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <aio.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/aio_suspend.c b/sysdeps/pthread/aio_suspend.c
index 207dad964e..8f8e33a7dc 100644
--- a/sysdeps/pthread/aio_suspend.c
+++ b/sysdeps/pthread/aio_suspend.c
@@ -1,5 +1,6 @@
/* Suspend until termination of a requests.
- Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2002,2003,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -36,7 +37,7 @@
#include <sys/time.h>
#include <bits/libc-lock.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
struct clparam
diff --git a/sysdeps/pthread/aio_write.c b/sysdeps/pthread/aio_write.c
index f5e89e9246..d61c5fbf9d 100644
--- a/sysdeps/pthread/aio_write.c
+++ b/sysdeps/pthread/aio_write.c
@@ -1,5 +1,5 @@
/* Asynchronous write.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <aio.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/aio_write64.c b/sysdeps/pthread/aio_write64.c
index b9c84b760b..4e23a3af95 100644
--- a/sysdeps/pthread/aio_write64.c
+++ b/sysdeps/pthread/aio_write64.c
@@ -1,5 +1,5 @@
/* Asynchronous write, 64bit offset version.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <aio.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
int
diff --git a/sysdeps/pthread/lio_listio.c b/sysdeps/pthread/lio_listio.c
index 5b98837b0d..29dc9d6eab 100644
--- a/sysdeps/pthread/lio_listio.c
+++ b/sysdeps/pthread/lio_listio.c
@@ -1,5 +1,6 @@
/* Enqueue and list of read or write requests.
- Copyright (C) 1997,1998,1999,2000,2001,2003 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2001,2003,2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -25,7 +26,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
#define LIO_OPCODE_BASE 0
#endif
diff --git a/sysdeps/pthread/lio_listio64.c b/sysdeps/pthread/lio_listio64.c
index fee1e591ef..4bec3f6195 100644
--- a/sysdeps/pthread/lio_listio64.c
+++ b/sysdeps/pthread/lio_listio64.c
@@ -1,5 +1,5 @@
/* Enqueue and list of read or write requests, 64bit offset version.
- Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
#define lio_listio lio_listio64
#define aiocb aiocb64
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index b34fd310a3..436573a428 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -117,6 +117,9 @@ libc {
}
GLIBC_2.4 {
inotify_init; inotify_add_watch; inotify_rm_watch;
+
+ #errlist-compat 132
+ _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
GLIBC_PRIVATE {
# functions used in other libraries
diff --git a/sysdeps/unix/sysv/linux/aio_sigqueue.c b/sysdeps/unix/sysv/linux/aio_sigqueue.c
index a6dbfb4eb1..30e9fbf7e5 100644
--- a/sysdeps/unix/sysv/linux/aio_sigqueue.c
+++ b/sysdeps/unix/sysv/linux/aio_sigqueue.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2003,2005
+ 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 +26,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include "aio_misc.h"
+#include <aio_misc.h>
#ifdef __NR_rt_sigqueueinfo
diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h
index 724dabaf10..4de8cbba57 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 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2005 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,12 +27,17 @@
/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP
-/* Linux also had no ECANCELED error code. Since it is not used here
- we define it to an invalid value. */
+/* Older Linux versions also had no ECANCELED error code. */
# 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/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 1ae69407ff..7db3e3eeac 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -12,3 +12,7 @@ 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/ucontext_i.h b/sysdeps/unix/sysv/linux/i386/ucontext_i.h
deleted file mode 100644
index c6319f2391..0000000000
--- a/sysdeps/unix/sysv/linux/i386/ucontext_i.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation.
- Copyright (C) 2001, 2005 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
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_link, oLINK); \
- TEST (uc_stack.ss_sp, oSS_SP); \
- TEST (uc_stack.ss_size, oSS_SIZE); \
- TEST (uc_mcontext.gregs[REG_GS], oGS); \
- TEST (uc_mcontext.gregs[REG_FS], oFS); \
- TEST (uc_mcontext.gregs[REG_EDI], oEDI); \
- TEST (uc_mcontext.gregs[REG_ESI], oESI); \
- TEST (uc_mcontext.gregs[REG_EBP], oEBP); \
- TEST (uc_mcontext.gregs[REG_ESP], oESP); \
- TEST (uc_mcontext.gregs[REG_EBX], oEBX); \
- TEST (uc_mcontext.gregs[REG_EDX], oEDX); \
- TEST (uc_mcontext.gregs[REG_ECX], oECX); \
- TEST (uc_mcontext.gregs[REG_EAX], oEAX); \
- TEST (uc_mcontext.gregs[REG_EIP], oEIP); \
- TEST (uc_mcontext.fpregs, oFPREGS); \
- TEST (uc_sigmask, oSIGMASK); \
- TEST (__fpregs_mem, oFPREGSMEM);
diff --git a/sysdeps/unix/sysv/linux/i386/ucontext_i.sym b/sysdeps/unix/sysv/linux/i386/ucontext_i.sym
new file mode 100644
index 0000000000..b11a5509cd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/i386/ucontext_i.sym
@@ -0,0 +1,30 @@
+#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/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile
index 671370ede0..55d2d0d273 100644
--- a/sysdeps/unix/sysv/linux/powerpc/Makefile
+++ b/sysdeps/unix/sysv/linux/powerpc/Makefile
@@ -2,3 +2,7 @@
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h
deleted file mode 100644
index f65b0ed58c..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation.
- Copyright (C) 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. */
-
-#define SIG_BLOCK 0
-#define SIG_SETMASK 2
-
-#define _FRAME_BACKCHAIN 0
-#define _FRAME_LR_SAVE 4
-#define _FRAME_PARM_SAVE1 8
-#define _FRAME_PARM_SAVE2 12
-#define _FRAME_PARM_SAVE3 16
-#define _FRAME_PARM_SAVE4 20
-
-#define _UC_LINK 4
-#define _UC_STACK_SP 8
-#define _UC_STACK_SIZE 16
-#define _UC_REGS_PTR 48
-#define _UC_SIGMASK 52
-#define _UC_REG_SPACE 180
-
-/* offsets within mcontext_t */
-#define _UC_GREGS 0
-#define _UC_FREGS 192
-#define _UC_VREGS 464
-#define _UC_VSCR 976
-#define _UC_VRSAVE 980
-
-/* The registers don't have a fixed offset within ucontext because the
- orginal ucontext only contained the regs pointer. Also with the
- addition of VMX to the register state the mcontext may require
- stronger alignment (16) then the containing ucontext (4). All access
- to register state (pt_regs/mcontext) must be indirect via the regs
- (uc_regs) pointer. This means we can't test the PPC32 mcontext
- register offsets here. */
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_link, _UC_LINK); \
- TEST (uc_stack.ss_sp, _UC_STACK_SP); \
- TEST (uc_stack.ss_size, _UC_STACK_SIZE); \
- TEST (uc_mcontext.regs, _UC_REGS_PTR); \
- TEST (uc_mcontext.uc_regs, _UC_REGS_PTR); \
- TEST (uc_sigmask, _UC_SIGMASK); \
- TEST (uc_reg_space, _UC_REG_SPACE);
-
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
new file mode 100644
index 0000000000..662c693303
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
@@ -0,0 +1,34 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_SETMASK
+
+-- XXX Do these correspond to some struct?
+_FRAME_BACKCHAIN 0
+_FRAME_LR_SAVE 4
+_FRAME_PARM_SAVE1 8
+_FRAME_PARM_SAVE2 12
+_FRAME_PARM_SAVE3 16
+_FRAME_PARM_SAVE4 20
+
+-- Offsets in ucontext_t.
+#define ucontext(member) offsetof (ucontext_t, member)
+_UC_LINK ucontext (uc_link)
+_UC_STACK_SP ucontext (uc_stack.ss_sp)
+_UC_STACK_SIZE ucontext (uc_stack.ss_size)
+_UC_REGS_PTR ucontext (uc_mcontext.uc_regs)
+_UC_SIGMASK ucontext (uc_sigmask)
+_UC_REG_SPACE ucontext (uc_reg_space)
+
+-- Offsets in mcontext_t.
+#define mcontext(member) offsetof (mcontext_t, member)
+_UC_GREGS mcontext (gregs)
+_UC_FREGS mcontext (fpregs)
+_UC_VREGS mcontext (vrregs)
+_UC_VREGS mcontext (vrregs)
+_UC_VSCR mcontext (vrregs.vscr)
+_UC_VRSAVE mcontext (vrregs.vrsave)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
deleted file mode 100644
index d540cfeaf1..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation.
- Copyright (C) 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. */
-
-#define SIG_BLOCK 0
-#define SIG_SETMASK 2
-
-/* Offsets of the fields in the powerpc64 ABI stack frame. */
-
-#define FRAME_BACKCHAIN 0
-#define FRAME_CR_SAVE 8
-#define FRAME_LR_SAVE 16
-#define FRAME_COMPILER_DW 24
-#define FRAME_LINKER_DW 32
-#define FRAME_TOC_SAVE 40
-#define FRAME_PARM_SAVE 48
-#define FRAME_PARM1_SAVE 48
-#define FRAME_PARM2_SAVE 56
-#define FRAME_PARM3_SAVE 64
-#define FRAME_PARM4_SAVE 72
-#define FRAME_PARM5_SAVE 80
-#define FRAME_PARM6_SAVE 88
-#define FRAME_PARM7_SAVE 96
-#define FRAME_PARM8_SAVE 104
-#define FRAME_PARM9_SAVE 112
-
-
-/* Offsets of the fields in the ucontext_t structure. */
-
-#define UCONTEXT_LINK 8
-#define UCONTEXT_STACK 16
-#define UCONTEXT_STACK_SP 16
-#define UCONTEXT_STACK_FLAGS 24
-#define UCONTEXT_STACK_SIZE 32
-#define UCONTEXT_SIGMASK 40
-#define UCONTEXT_MCONTEXT 168
-#define SIGCONTEXT_SIGNAL 200
-#define SIGCONTEXT_HANDLER 208
-#define SIGCONTEXT_OLDMASK 216
-#define SIGCONTEXT_PT_REGS 224
-#define SIGCONTEXT_GP_REGS 232
-#define SIGCONTEXT_FP_REGS 616
-#define SIGCONTEXT_V_REGS_PTR 880
-#define SIGCONTEXT_V_RESERVE 888
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_link, UCONTEXT_LINK); \
- TEST (uc_stack.ss_sp, UCONTEXT_STACK_SP); \
- TEST (uc_stack.ss_size, UCONTEXT_STACK_SIZE); \
- TEST (uc_sigmask, UCONTEXT_SIGMASK); \
- TEST (uc_mcontext.signal, SIGCONTEXT_SIGNAL); \
- TEST (uc_mcontext.handler, SIGCONTEXT_HANDLER); \
- TEST (uc_mcontext.oldmask, SIGCONTEXT_OLDMASK); \
- TEST (uc_mcontext.regs, SIGCONTEXT_PT_REGS); \
- TEST (uc_mcontext.gp_regs, SIGCONTEXT_GP_REGS); \
- TEST (uc_mcontext.fp_regs, SIGCONTEXT_FP_REGS); \
- TEST (uc_mcontext.v_regs, SIGCONTEXT_V_REGS_PTR); \
- TEST (uc_mcontext.vmx_reserve, SIGCONTEXT_V_RESERVE);
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
new file mode 100644
index 0000000000..a35418d9d4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
@@ -0,0 +1,50 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_SETMASK
+
+
+-- Offsets of the fields in the powerpc64 ABI stack frame.
+-- XXX Do these correspond to some struct?
+
+FRAME_BACKCHAIN 0
+FRAME_CR_SAVE 8
+FRAME_LR_SAVE 16
+FRAME_COMPILER_DW 24
+FRAME_LINKER_DW 32
+FRAME_TOC_SAVE 40
+FRAME_PARM_SAVE 48
+FRAME_PARM1_SAVE 48
+FRAME_PARM2_SAVE 56
+FRAME_PARM3_SAVE 64
+FRAME_PARM4_SAVE 72
+FRAME_PARM5_SAVE 80
+FRAME_PARM6_SAVE 88
+FRAME_PARM7_SAVE 96
+FRAME_PARM8_SAVE 104
+FRAME_PARM9_SAVE 112
+
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member) offsetof (ucontext_t, member)
+#define mcontext(member) ucontext (uc_mcontext.member)
+
+UCONTEXT_LINK ucontext (uc_link)
+UCONTEXT_STACK ucontext (uc_stack)
+UCONTEXT_STACK_SP ucontext (uc_stack.ss_sp)
+UCONTEXT_STACK_FLAGS ucontext (uc_stack.ss_flags)
+UCONTEXT_STACK_SIZE ucontext (uc_stack.ss_size)
+UCONTEXT_SIGMASK ucontext (uc_sigmask)
+UCONTEXT_MCONTEXT ucontext (uc_mcontext)
+SIGCONTEXT_SIGNAL mcontext (signal)
+SIGCONTEXT_HANDLER mcontext (handler)
+SIGCONTEXT_OLDMASK mcontext (oldmask)
+SIGCONTEXT_PT_REGS mcontext (regs)
+SIGCONTEXT_GP_REGS mcontext (gp_regs)
+SIGCONTEXT_FP_REGS mcontext (fp_regs)
+SIGCONTEXT_V_REGS_PTR mcontext (v_regs)
+SIGCONTEXT_V_RESERVE mcontext (vmx_reserve)
diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile
index 8d8df743ac..5c5381871b 100644
--- a/sysdeps/unix/sysv/linux/s390/Makefile
+++ b/sysdeps/unix/sysv/linux/s390/Makefile
@@ -2,3 +2,7 @@
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h b/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h
deleted file mode 100644
index 61f018621b..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger-Tang <davidm@hpl.hp.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. */
-
-/* Constants shared between setcontext() and getcontext(). Don't
- install this header file. */
-
-#define SIG_BLOCK 0
-#define SIG_UNBLOCK 1
-#define SIG_SETMASK 2
-
-#define SC_FLGS 0x000
-#define SC_LINK 0x004
-#define SC_STCK 0x008
-#define SC_STSZ 0x010
-#define SC_PSW 0x018
-#define SC_GPRS 0x020
-#define SC_ACRS 0x060
-#define SC_FPC 0x0A0
-#define SC_FPRS 0x0A8
-#define SC_MASK 0x128
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_flags, SC_FLGS); \
- TEST (uc_link, SC_LINK); \
- TEST (uc_stack.ss_sp, SC_STCK); \
- TEST (uc_stack.ss_size, SC_STSZ); \
- TEST (uc_mcontext.psw, SC_PSW); \
- TEST (uc_mcontext.gregs, SC_GPRS); \
- TEST (uc_mcontext.aregs, SC_ACRS); \
- TEST (uc_mcontext.fpregs.fpc, SC_FPC); \
- TEST (uc_mcontext.fpregs.fprs, SC_FPRS); \
- TEST (uc_sigmask, SC_MASK);
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h b/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h
deleted file mode 100644
index 28ef915fc1..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Mosberger-Tang <davidm@hpl.hp.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. */
-
-/* Constants shared between setcontext() and getcontext(). Don't
- install this header file. */
-
-#define SIG_BLOCK 0
-#define SIG_UNBLOCK 1
-#define SIG_SETMASK 2
-
-#define SC_FLGS 0x000
-#define SC_LINK 0x008
-#define SC_STCK 0x010
-#define SC_STSZ 0x020
-#define SC_PSW 0x028
-#define SC_GPRS 0x038
-#define SC_ACRS 0x0B8
-#define SC_FPC 0x0F8
-#define SC_FPRS 0x100
-#define SC_MASK 0x180
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_flags, SC_FLGS); \
- TEST (uc_link, SC_LINK); \
- TEST (uc_stack.ss_sp, SC_STCK); \
- TEST (uc_stack.ss_size, SC_STSZ); \
- TEST (uc_mcontext.psw, SC_PSW); \
- TEST (uc_mcontext.gregs, SC_GPRS); \
- TEST (uc_mcontext.aregs, SC_ACRS); \
- TEST (uc_mcontext.fpregs.fpc, SC_FPC); \
- TEST (uc_mcontext.fpregs.fprs, SC_FPRS); \
- TEST (uc_sigmask, SC_MASK);
diff --git a/sysdeps/unix/sysv/linux/s390/ucontext_i.sym b/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
new file mode 100644
index 0000000000..525b54300c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/ucontext_i.sym
@@ -0,0 +1,23 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_UNBLOCK
+SIG_SETMASK
+
+#define ucontext(member) offsetof (ucontext_t, member)
+#define mcontext(member) ucontext (uc_mcontext.member)
+
+SC_FLGS ucontext (uc_flags)
+SC_LINK ucontext (uc_link)
+SC_STCK ucontext (uc_stack.ss_sp)
+SC_STSZ ucontext (uc_stack.ss_size)
+SC_PSW mcontext (psw)
+SC_GPRS mcontext (gregs)
+SC_ACRS mcontext (aregs)
+SC_FPC mcontext (fpregs.fpc)
+SC_FPRS mcontext (fpregs.fprs)
+SC_MASK ucontext (uc_sigmask)
diff --git a/sysdeps/unix/sysv/linux/sh/Makefile b/sysdeps/unix/sysv/linux/sh/Makefile
index e8544b5dc6..6d72cb0294 100644
--- a/sysdeps/unix/sysv/linux/sh/Makefile
+++ b/sysdeps/unix/sysv/linux/sh/Makefile
@@ -5,3 +5,7 @@ endif
ifeq ($(subdir),misc)
sysdep_headers += sys/io.h
endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h b/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h
deleted file mode 100644
index d8483dbe64..0000000000
--- a/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation.
- Copyright (C) 2005 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 oR0 24
-#define oR1 28
-#define oR2 32
-#define oR3 36
-#define oR4 40
-#define oR5 44
-#define oR6 48
-#define oR7 52
-#define oR8 56
-#define oR9 60
-#define oR10 64
-#define oR11 68
-#define oR12 72
-#define oR13 76
-#define oR14 80
-#define oR15 84
-#define oPC 88
-#define oPR 92
-#define oSR 96
-#define oGBR 100
-#define oMACH 104
-#define oMACL 108
-#define oSIGMASK 112
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_link, oLINK); \
- TEST (uc_stack.ss_sp, oSS_SP); \
- TEST (uc_stack.ss_size, oSS_SIZE); \
- TEST (uc_mcontext.gregs[R0], oR0); \
- TEST (uc_mcontext.gregs[R1], oR1); \
- TEST (uc_mcontext.gregs[R2], oR2); \
- TEST (uc_mcontext.gregs[R3], oR3); \
- TEST (uc_mcontext.gregs[R4], oR4); \
- TEST (uc_mcontext.gregs[R5], oR5); \
- TEST (uc_mcontext.gregs[R6], oR6); \
- TEST (uc_mcontext.gregs[R7], oR7); \
- TEST (uc_mcontext.gregs[R8], oR8); \
- TEST (uc_mcontext.gregs[R9], oR9); \
- TEST (uc_mcontext.gregs[R10], oR10); \
- TEST (uc_mcontext.gregs[R11], oR11); \
- TEST (uc_mcontext.gregs[R12], oR12); \
- TEST (uc_mcontext.gregs[R13], oR13); \
- TEST (uc_mcontext.gregs[R14], oR14); \
- TEST (uc_mcontext.gregs[R15], oR15); \
- TEST (uc_mcontext.pc, oPC); \
- TEST (uc_mcontext.pr, oPR); \
- TEST (uc_mcontext.sr, oSR); \
- TEST (uc_mcontext.gbr, oGBR); \
- TEST (uc_mcontext.mach, oMACH); \
- TEST (uc_mcontext.macl, oMACL); \
- TEST (uc_sigmask, oSIGMASK);
diff --git a/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym b/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
new file mode 100644
index 0000000000..17397c5511
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
@@ -0,0 +1,38 @@
+#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)
+
+oLINK ucontext (uc_link)
+oSS_SP ucontext (uc_stack.ss_sp)
+oSS_SIZE ucontext (uc_stack.ss_size)
+oR0 mcontext (gregs[R0])
+oR1 mcontext (gregs[R1])
+oR2 mcontext (gregs[R2])
+oR3 mcontext (gregs[R3])
+oR4 mcontext (gregs[R4])
+oR5 mcontext (gregs[R5])
+oR6 mcontext (gregs[R6])
+oR7 mcontext (gregs[R7])
+oR8 mcontext (gregs[R8])
+oR9 mcontext (gregs[R9])
+oR10 mcontext (gregs[R10])
+oR11 mcontext (gregs[R11])
+oR12 mcontext (gregs[R12])
+oR13 mcontext (gregs[R13])
+oR14 mcontext (gregs[R14])
+oR15 mcontext (gregs[R15])
+oPC mcontext (pc)
+oPR mcontext (pr)
+oSR mcontext (sr)
+oGBR mcontext (gbr)
+oMACH mcontext (mach)
+oMACL mcontext (macl)
+oSIGMASK ucontext (uc_sigmask)
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h b/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h
deleted file mode 100644
index 88f774f0ad..0000000000
--- a/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation.
- Copyright (C) 2005 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 oR0 24
-#define oR1 28
-#define oR2 32
-#define oR3 36
-#define oR4 40
-#define oR5 44
-#define oR6 48
-#define oR7 52
-#define oR8 56
-#define oR9 60
-#define oR10 64
-#define oR11 68
-#define oR12 72
-#define oR13 76
-#define oR14 80
-#define oR15 84
-#define oPC 88
-#define oPR 92
-#define oSR 96
-#define oGBR 100
-#define oMACH 104
-#define oMACL 108
-#define oFR0 112
-#define oFR1 116
-#define oFR2 120
-#define oFR3 124
-#define oFR4 128
-#define oFR5 132
-#define oFR6 136
-#define oFR7 140
-#define oFR8 144
-#define oFR9 148
-#define oFR10 152
-#define oFR11 156
-#define oFR12 160
-#define oFR13 164
-#define oFR14 168
-#define oFR15 172
-#define oXFR0 176
-#define oXFR1 180
-#define oXFR2 184
-#define oXFR3 188
-#define oXFR4 192
-#define oXFR5 196
-#define oXFR6 200
-#define oXFR7 204
-#define oXFR8 208
-#define oXFR9 212
-#define oXFR10 216
-#define oXFR11 220
-#define oXFR12 224
-#define oXFR13 228
-#define oXFR14 232
-#define oXFR15 236
-#define oFPSCR 240
-#define oFPUL 244
-#define oOWNEDFP 248
-#define oSIGMASK 252
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_link, oLINK); \
- TEST (uc_stack.ss_sp, oSS_SP); \
- TEST (uc_stack.ss_size, oSS_SIZE); \
- TEST (uc_mcontext.gregs[R0], oR0); \
- TEST (uc_mcontext.gregs[R1], oR1); \
- TEST (uc_mcontext.gregs[R2], oR2); \
- TEST (uc_mcontext.gregs[R3], oR3); \
- TEST (uc_mcontext.gregs[R4], oR4); \
- TEST (uc_mcontext.gregs[R5], oR5); \
- TEST (uc_mcontext.gregs[R6], oR6); \
- TEST (uc_mcontext.gregs[R7], oR7); \
- TEST (uc_mcontext.gregs[R8], oR8); \
- TEST (uc_mcontext.gregs[R9], oR9); \
- TEST (uc_mcontext.gregs[R10], oR10); \
- TEST (uc_mcontext.gregs[R11], oR11); \
- TEST (uc_mcontext.gregs[R12], oR12); \
- TEST (uc_mcontext.gregs[R13], oR13); \
- TEST (uc_mcontext.gregs[R14], oR14); \
- TEST (uc_mcontext.gregs[R15], oR15); \
- TEST (uc_mcontext.pc, oPC); \
- TEST (uc_mcontext.pr, oPR); \
- TEST (uc_mcontext.sr, oSR); \
- TEST (uc_mcontext.gbr, oGBR); \
- TEST (uc_mcontext.mach, oMACH); \
- TEST (uc_mcontext.macl, oMACL); \
- TEST (uc_mcontext.fpregs[0], oFR0); \
- TEST (uc_mcontext.fpregs[1], oFR1); \
- TEST (uc_mcontext.fpregs[2], oFR2); \
- TEST (uc_mcontext.fpregs[3], oFR3); \
- TEST (uc_mcontext.fpregs[4], oFR4); \
- TEST (uc_mcontext.fpregs[5], oFR5); \
- TEST (uc_mcontext.fpregs[6], oFR6); \
- TEST (uc_mcontext.fpregs[7], oFR7); \
- TEST (uc_mcontext.fpregs[8], oFR8); \
- TEST (uc_mcontext.fpregs[9], oFR9); \
- TEST (uc_mcontext.fpregs[10], oFR10); \
- TEST (uc_mcontext.fpregs[11], oFR11); \
- TEST (uc_mcontext.fpregs[12], oFR12); \
- TEST (uc_mcontext.fpregs[13], oFR13); \
- TEST (uc_mcontext.fpregs[14], oFR14); \
- TEST (uc_mcontext.fpregs[15], oFR15); \
- TEST (uc_mcontext.xfpregs[0], oXFR0); \
- TEST (uc_mcontext.xfpregs[1], oXFR1); \
- TEST (uc_mcontext.xfpregs[2], oXFR2); \
- TEST (uc_mcontext.xfpregs[3], oXFR3); \
- TEST (uc_mcontext.xfpregs[4], oXFR4); \
- TEST (uc_mcontext.xfpregs[5], oXFR5); \
- TEST (uc_mcontext.xfpregs[6], oXFR6); \
- TEST (uc_mcontext.xfpregs[7], oXFR7); \
- TEST (uc_mcontext.xfpregs[8], oXFR8); \
- TEST (uc_mcontext.xfpregs[9], oXFR9); \
- TEST (uc_mcontext.xfpregs[10], oXFR10); \
- TEST (uc_mcontext.xfpregs[11], oXFR11); \
- TEST (uc_mcontext.xfpregs[12], oXFR12); \
- TEST (uc_mcontext.xfpregs[13], oXFR13); \
- TEST (uc_mcontext.xfpregs[14], oXFR14); \
- TEST (uc_mcontext.xfpregs[15], oXFR15); \
- TEST (uc_mcontext.fpscr, oFPSCR); \
- TEST (uc_mcontext.fpul, oFPUL); \
- TEST (uc_mcontext.ownedfp, oOWNEDFP); \
- TEST (uc_sigmask, oSIGMASK);
diff --git a/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym b/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
new file mode 100644
index 0000000000..65633fbcf4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
@@ -0,0 +1,73 @@
+#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)
+
+oLINK ucontext (uc_link)
+oSS_SP ucontext (uc_stack.ss_sp)
+oSS_SIZE ucontext (uc_stack.ss_size)
+oR0 mcontext (gregs[R0])
+oR1 mcontext (gregs[R1])
+oR2 mcontext (gregs[R2])
+oR3 mcontext (gregs[R3])
+oR4 mcontext (gregs[R4])
+oR5 mcontext (gregs[R5])
+oR6 mcontext (gregs[R6])
+oR7 mcontext (gregs[R7])
+oR8 mcontext (gregs[R8])
+oR9 mcontext (gregs[R9])
+oR10 mcontext (gregs[R10])
+oR11 mcontext (gregs[R11])
+oR12 mcontext (gregs[R12])
+oR13 mcontext (gregs[R13])
+oR14 mcontext (gregs[R14])
+oR15 mcontext (gregs[R15])
+oPC mcontext (pc)
+oPR mcontext (pr)
+oSR mcontext (sr)
+oGBR mcontext (gbr)
+oMACH mcontext (mach)
+oMACL mcontext (macl)
+oFR0 mcontext (fpregs[0])
+oFR1 mcontext (fpregs[1])
+oFR2 mcontext (fpregs[2])
+oFR3 mcontext (fpregs[3])
+oFR4 mcontext (fpregs[4])
+oFR5 mcontext (fpregs[5])
+oFR6 mcontext (fpregs[6])
+oFR7 mcontext (fpregs[7])
+oFR8 mcontext (fpregs[8])
+oFR9 mcontext (fpregs[9])
+oFR10 mcontext (fpregs[10])
+oFR11 mcontext (fpregs[11])
+oFR12 mcontext (fpregs[12])
+oFR13 mcontext (fpregs[13])
+oFR14 mcontext (fpregs[14])
+oFR15 mcontext (fpregs[15])
+oXFR0 mcontext (xfpregs[0])
+oXFR1 mcontext (xfpregs[1])
+oXFR2 mcontext (xfpregs[2])
+oXFR3 mcontext (xfpregs[3])
+oXFR4 mcontext (xfpregs[4])
+oXFR5 mcontext (xfpregs[5])
+oXFR6 mcontext (xfpregs[6])
+oXFR7 mcontext (xfpregs[7])
+oXFR8 mcontext (xfpregs[8])
+oXFR9 mcontext (xfpregs[9])
+oXFR10 mcontext (xfpregs[10])
+oXFR11 mcontext (xfpregs[11])
+oXFR12 mcontext (xfpregs[12])
+oXFR13 mcontext (xfpregs[13])
+oXFR14 mcontext (xfpregs[14])
+oXFR15 mcontext (xfpregs[15])
+oFPSCR mcontext (fpscr)
+oFPUL mcontext (fpul)
+oOWNEDFP mcontext (ownedfp)
+oSIGMASK ucontext (uc_sigmask)
diff --git a/sysdeps/unix/sysv/linux/x86_64/Makefile b/sysdeps/unix/sysv/linux/x86_64/Makefile
index 627275db09..0f20367236 100644
--- a/sysdeps/unix/sysv/linux/x86_64/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/Makefile
@@ -9,3 +9,7 @@ endif
ifeq ($(subdir),stdlib)
sysdep_routines += __start_context
endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h
deleted file mode 100644
index e5099084cf..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Offsets and other constants needed in the *context() function
- implementation for Linux/x86-64.
- Copyright (C) 2002, 2005 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
-
-/* Since we cannot include a header to define _NSIG/8, we define it
- here. */
-#define _NSIG8 8
-
-/* Offsets of the fields in the ucontext_t structure. */
-#define oRBP 120
-#define oRSP 160
-#define oRBX 128
-#define oR8 40
-#define oR9 48
-#define oR12 72
-#define oR13 80
-#define oR14 88
-#define oR15 96
-#define oRDI 104
-#define oRSI 112
-#define oRDX 136
-#define oRAX 144
-#define oRCX 152
-#define oRIP 168
-#define oFPREGS 224
-#define oSIGMASK 296
-#define oFPREGSMEM 424
-#define oMXCSR 448
-
-/* Tests run in stdlib/tst-ucontext-off. */
-#define TESTS \
- TEST (uc_mcontext.gregs[REG_RBP], oRBP); \
- TEST (uc_mcontext.gregs[REG_RSP], oRSP); \
- TEST (uc_mcontext.gregs[REG_RBX], oRBX); \
- TEST (uc_mcontext.gregs[REG_R8], oR8); \
- TEST (uc_mcontext.gregs[REG_R9], oR9); \
- TEST (uc_mcontext.gregs[REG_R12], oR12); \
- TEST (uc_mcontext.gregs[REG_R13], oR13); \
- TEST (uc_mcontext.gregs[REG_R14], oR14); \
- TEST (uc_mcontext.gregs[REG_R15], oR15); \
- TEST (uc_mcontext.gregs[REG_RDI], oRDI); \
- TEST (uc_mcontext.gregs[REG_RSI], oRSI); \
- TEST (uc_mcontext.gregs[REG_RDX], oRDX); \
- TEST (uc_mcontext.gregs[REG_RAX], oRAX); \
- TEST (uc_mcontext.gregs[REG_RCX], oRCX); \
- TEST (uc_mcontext.gregs[REG_RIP], oRIP); \
- TEST (uc_mcontext.fpregs, oFPREGS); \
- TEST (uc_sigmask, oSIGMASK); \
- TEST (__fpregs_mem, oFPREGSMEM); \
- TEST (__fpregs_mem.mxcsr, oMXCSR);
diff --git a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
new file mode 100644
index 0000000000..b3cfe9aa4c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
@@ -0,0 +1,34 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_SETMASK
+
+_NSIG8 (_NSIG / 8)
+
+#define ucontext(member) offsetof (ucontext_t, member)
+#define mcontext(member) ucontext (uc_mcontext.member)
+#define mreg(reg) mcontext (gregs[REG_##reg])
+
+oRBP mreg (RBP)
+oRSP mreg (RSP)
+oRBX mreg (RBX)
+oR8 mreg (R8)
+oR9 mreg (R9)
+oR12 mreg (R12)
+oR13 mreg (R13)
+oR14 mreg (R14)
+oR15 mreg (R15)
+oRDI mreg (RDI)
+oRSI mreg (RSI)
+oRDX mreg (RDX)
+oRAX mreg (RAX)
+oRCX mreg (RCX)
+oRIP mreg (RIP)
+oFPREGS mcontext (fpregs)
+oSIGMASK ucontext (uc_sigmask)
+oFPREGSMEM ucontext (__fpregs_mem)
+oMXCSR ucontext (__fpregs_mem.mxcsr)
diff --git a/sysdeps/unix/sysv/tcflow.c b/sysdeps/unix/sysv/tcflow.c
index 1a91bd47db..dc67d0664f 100644
--- a/sysdeps/unix/sysv/tcflow.c
+++ b/sysdeps/unix/sysv/tcflow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996, 1997, 2005 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 <sys/ioctl.h>
-#include "sysv_termio.h"
+#include <sysv_termio.h>
/* Suspend or restart transmission on FD. */
int
diff --git a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S
index becfb4f79d..dd797e8a7b 100644
--- a/sysdeps/x86_64/__longjmp.S
+++ b/sysdeps/x86_64/__longjmp.S
@@ -51,6 +51,8 @@ ENTRY(__longjmp)
movq (JB_PC*8)(%rdi),%rdx
movq (JB_RSP*8)(%rdi),%rsp
#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (%rbp)
+ PTR_DEMANGLE (%rsp)
PTR_DEMANGLE (%rdx)
#endif
jmpq *%rdx
diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
index 8af5502042..39c78c9981 100644
--- a/sysdeps/x86_64/setjmp.S
+++ b/sysdeps/x86_64/setjmp.S
@@ -26,12 +26,21 @@
ENTRY (__sigsetjmp)
/* Save registers. */
movq %rbx, (JB_RBX*8)(%rdi)
+#ifdef PTR_MANGLE
+ movq %rbp, %rax
+ PTR_MANGLE (%rax)
+ movq %rax, (JB_RBP*8)(%rdi)
+#else
movq %rbp, (JB_RBP*8)(%rdi)
+#endif
movq %r12, (JB_R12*8)(%rdi)
movq %r13, (JB_R13*8)(%rdi)
movq %r14, (JB_R14*8)(%rdi)
movq %r15, (JB_R15*8)(%rdi)
leaq 8(%rsp), %rdx /* Save SP as it will be after we return. */
+#ifdef PTR_MANGLE
+ PTR_MANGLE (%rdx)
+#endif
movq %rdx, (JB_RSP*8)(%rdi)
movq (%rsp), %rax /* Save PC we are returning to now. */
#ifdef PTR_MANGLE
diff --git a/test-skeleton.c b/test-skeleton.c
index dd5d8041dd..23e40124bd 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -152,7 +152,9 @@ timeout_handler (int sig __attribute__ ((unused)))
nanosleep() call return prematurely, all the better. We
won't restart it since this probably means the child process
finally died. */
- struct timespec ts = { .tv_sec = 0, .tv_nsec = 100000000 };
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 100000000;
nanosleep (&ts, NULL);
}
if (killed != 0 && killed != pid)