summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/bits')
-rw-r--r--sysdeps/mach/hurd/bits/fcntl.h15
-rw-r--r--sysdeps/mach/hurd/bits/ioctls.h23
-rw-r--r--sysdeps/mach/hurd/bits/libc-lock.h17
-rw-r--r--sysdeps/mach/hurd/bits/libc-tsd.h34
-rw-r--r--sysdeps/mach/hurd/bits/posix_opt.h46
-rw-r--r--sysdeps/mach/hurd/bits/sigaction.h81
-rw-r--r--sysdeps/mach/hurd/bits/stat.h33
7 files changed, 192 insertions, 57 deletions
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 135aba3bc9..9460be7ff0 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -163,9 +163,18 @@
# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
#endif
-#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info (non-blocking). */
-#define F_SETLKW 9 /* Set record locking info (blocking). */
+#ifdef __USE_FILE_OFFSET64
+# define F_GETLK F_GETLK64
+# define F_SETLK F_SETLK64
+# define F_SETLKW F_SETLKW64
+#else
+# define F_GETLK 7 /* Get record locking info. */
+# define F_SETLK 8 /* Set record locking info (non-blocking). */
+# define F_SETLKW 9 /* Set record locking info (blocking). */
+#endif
+#define F_GETLK64 10 /* Get record locking info. */
+#define F_SETLK64 11 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 12 /* Set record locking info (blocking). */
#ifdef __USE_XOPEN2K8
# define F_DUPFD_CLOEXEC 1030 /* Duplicate, set FD_CLOEXEC on new one. */
diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index e5203ad7e9..efa7bdf0c4 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -148,9 +148,26 @@ enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 };
#define _IOT_SIMPLE(type) _IOT (_IOTS (type), 1, 0, 0, 0, 0)
/* Basic C types. */
-#define _IOT__IOTBASE_int _IOT_SIMPLE (int)
#define _IOT__IOTBASE_char _IOT_SIMPLE (char)
#define _IOT__IOTBASE_short _IOT_SIMPLE (short)
+#define _IOT__IOTBASE_int _IOT_SIMPLE (int)
+#define _IOT__IOTBASE_long _IOT_SIMPLE (long)
+#define _IOT_char _IOT_SIMPLE (char)
+#define _IOT_short _IOT_SIMPLE (short)
+#define _IOT_int _IOT_SIMPLE (int)
+#define _IOT_long _IOT_SIMPLE (long)
+
+#define _IOT__IOTBASE_int8_t _IOT_SIMPLE (int8_t)
+#define _IOT__IOTBASE_uint8_t _IOT_SIMPLE (uint8_t)
+#define _IOT__IOTBASE_int16_t _IOT_SIMPLE (int16_t)
+#define _IOT__IOTBASE_uint16_t _IOT_SIMPLE (uint16_t)
+#define _IOT__IOTBASE_int32_t _IOT_SIMPLE (int32_t)
+#define _IOT__IOTBASE_uint32_t _IOT_SIMPLE (uint32_t)
+#define _IOT__IOTBASE_int64_t _IOT_SIMPLE (int64_t)
+#define _IOT__IOTBASE_uint64_t _IOT_SIMPLE (uint64_t)
+
+#define _IOT__IOTBASE_size_t _IOT_SIMPLE (size_t)
+#define _IOT__IOTBASE_ssize_t _IOT_SIMPLE (ssize_t)
/* Standard flavors of ioctls.
@@ -173,6 +190,10 @@ enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 };
#define _IOC_ENCODE_TYPE_1(typespec) _IOC_ENCODE_TYPE_2(typespec)
#define _IOC_ENCODE_TYPE_2(typespec) _IOT_##typespec
+/* Also, ignore signedness. */
+#define _IOTBASE_unsigned
+#define _IOTBASE_signed
+
/* ioctls verbatim from 4.4 <sys/ioctl.h>. */
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h
index 28c69fa0b4..cc4afb1507 100644
--- a/sysdeps/mach/hurd/bits/libc-lock.h
+++ b/sysdeps/mach/hurd/bits/libc-lock.h
@@ -20,8 +20,10 @@
#define _BITS_LIBC_LOCK_H 1
#if (_LIBC - 0) || (_CTHREADS_ - 0)
+# if (_LIBC - 0)
+# include <tls.h>
+# endif
#include <cthreads.h>
-#include <hurd/threadvar.h>
typedef struct mutex __libc_lock_t;
typedef struct
@@ -32,7 +34,12 @@ typedef struct
} __libc_lock_recursive_t;
typedef __libc_lock_recursive_t __rtld_lock_recursive_t;
-#define __libc_lock_owner_self() ((void *) __hurd_threadvar_location (0))
+extern char __libc_lock_self0[0];
+/* We have to hide the __libc_lock_self access behind a function call,
+ otherwise gcc >= 4.9 would try to prefetch the TLS dereference even before
+ the __LIBC_NO_TLS test is finished... */
+extern void *__libc_get_lock_self(void);
+#define __libc_lock_owner_self() (__LIBC_NO_TLS() ? &__libc_lock_self0 : __libc_get_lock_self())
#else
typedef struct __libc_lock_opaque__ __libc_lock_t;
@@ -203,4 +210,10 @@ void *__libc_getspecific (__libc_key_t key);
#endif /* _CTHREADS_ */
+/* Hide the definitions which are only supposed to be used inside libc in
+ a separate file. This file is not present in the installation! */
+#ifdef _LIBC
+# include <bits/libc-lockP.h>
+#endif
+
#endif /* bits/libc-lock.h */
diff --git a/sysdeps/mach/hurd/bits/libc-tsd.h b/sysdeps/mach/hurd/bits/libc-tsd.h
deleted file mode 100644
index e2ea911a2c..0000000000
--- a/sysdeps/mach/hurd/bits/libc-tsd.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* libc-internal interface for thread-specific data. Hurd version.
- Copyright (C) 1998-2014 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef _BITS_LIBC_TSD_H
-#define _BITS_LIBC_TSD_H 1
-
-#include <hurd/threadvar.h>
-
-#define __libc_tsd_define(CLASS, TYPE, KEY) /* nothing, always have threadvars */
-
-#define __libc_tsd_address(TYPE, KEY) \
- ((TYPE *) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
-
-#define __libc_tsd_get(TYPE, KEY) \
- (*__libc_tsd_address (TYPE, KEY))
-#define __libc_tsd_set(TYPE, KEY, VALUE) \
- (*__libc_tsd_address (TYPE, KEY) = (VALUE))
-
-#endif /* bits/libc-tsd.h */
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index a897cb1640..9ab9c9f493 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
+++ b/sysdeps/mach/hurd/bits/posix_opt.h
@@ -68,27 +68,41 @@
/* X/Open thread realtime support is not supported. */
#undef _XOPEN_REALTIME_THREADS
-/* XPG4.2 shared memory is not supported. */
-#undef _XOPEN_SHM
+/* XPG4.2 shared memory is supported. */
+#define _XOPEN_SHM 1
-/* We do not have the POSIX threads interface. */
-#define _POSIX_THREADS -1
+/* Tell we have POSIX threads. */
+#define _POSIX_THREADS 200112L
/* We have the reentrant functions described in POSIX. */
#define _POSIX_REENTRANT_FUNCTIONS 1
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
-/* These are all things that won't be supported when _POSIX_THREADS is not. */
+/* We do not provide priority scheduling for threads. */
#define _POSIX_THREAD_PRIORITY_SCHEDULING -1
-#define _POSIX_THREAD_ATTR_STACKSIZE -1
-#define _POSIX_THREAD_ATTR_STACKADDR -1
+
+/* We support user-defined stack sizes. */
+#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
+
+/* We support user-defined stacks. */
+#define _POSIX_THREAD_ATTR_STACKADDR 200112L
+
+/* We do not support priority inheritence. */
#define _POSIX_THREAD_PRIO_INHERIT -1
+
+/* We do not support priority protection. */
#define _POSIX_THREAD_PRIO_PROTECT -1
+
#ifdef __USE_XOPEN2K8
+/* We do not support priority inheritence for robust mutexes. */
# define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1
+
+/* We do not support priority protection for robust mutexes. */
# define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1
#endif
-#define _POSIX_SEMAPHORES -1
+
+/* We support POSIX.1b semaphores. */
+#define _POSIX_SEMAPHORES 200112L
/* Real-time signals are not yet supported. */
#define _POSIX_REALTIME_SIGNALS -1
@@ -121,17 +135,17 @@
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
-/* Reader/Writer locks are not available. */
-#define _POSIX_READER_WRITER_LOCKS -1
+/* Reader/Writer locks are available. */
+#define _POSIX_READER_WRITER_LOCKS 200112L
/* We have a POSIX shell. */
#define _POSIX_SHELL 1
-/* We cannot support the Timeouts option without _POSIX_THREADS. */
-#define _POSIX_TIMEOUTS -1
+/* We support the Timeouts option. */
+#define _POSIX_TIMEOUTS 200112L
-/* We do not support spinlocks. */
-#define _POSIX_SPIN_LOCKS -1
+/* We support spinlocks. */
+#define _POSIX_SPIN_LOCKS 200112L
/* The `spawn' function family is supported. */
#define _POSIX_SPAWN 200809L
@@ -139,8 +153,8 @@
/* We do not have POSIX timers, but could in future without ABI change. */
#define _POSIX_TIMERS 0
-/* The barrier functions are not available. */
-#define _POSIX_BARRIERS -1
+/* We support barrier functions. */
+#define _POSIX_BARRIERS 200112L
/* POSIX message queues could be available in future. */
#define _POSIX_MESSAGE_PASSING 0
diff --git a/sysdeps/mach/hurd/bits/sigaction.h b/sysdeps/mach/hurd/bits/sigaction.h
new file mode 100644
index 0000000000..7204fc6b86
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/sigaction.h
@@ -0,0 +1,81 @@
+/* Copyright (C) 1991-2015 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. */
+#endif
+#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
+# 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. */
+# define SA_SIGINFO 0x0040 /* Signal handler with SA_SIGINFO args */
+#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/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index e6bec34660..f60a58ae9c 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -222,9 +222,40 @@ struct stat64
S_IUSEUNK|S_IUNKNOWN|07777))
#endif
-/* Default file creation mask (umask). */
#ifdef __USE_BSD
+
+/* Default file creation mask (umask). */
# define CMASK 0022
+
+
+/* Definitions of flags stored in file flags word. */
+
+/* Super-user and owner changeable flags. */
+# define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */
+# define UF_NODUMP 0x00000001 /* do not dump file */
+# define UF_IMMUTABLE 0x00000002 /* file may not be changed */
+# define UF_APPEND 0x00000004 /* writes to file may only append */
+# define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */
+# define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */
+
+/* Super-user changeable flags. */
+# define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */
+# define SF_ARCHIVED 0x00010000 /* file is archived */
+# define SF_IMMUTABLE 0x00020000 /* file may not be changed */
+# define SF_APPEND 0x00040000 /* writes to file may only append */
+# define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */
+# define SF_SNAPSHOT 0x00200000 /* snapshot inode */
+
+__BEGIN_DECLS
+
+/* Set file flags for FILE to FLAGS. */
+extern int chflags (__const char *__file, unsigned long int __flags) __THROW;
+
+/* Set file flags of the file referred to by FD to FLAGS. */
+extern int fchflags (int __fd, unsigned long int __flags) __THROW;
+
+__END_DECLS
+
#endif
#endif /* bits/stat.h */