diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-14 12:27:09 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-06-15 14:00:23 +0200 |
commit | 2389017f787dd51e11e697c448071ecdd217169a (patch) | |
tree | 9b84222178e0e236d51590acdf1bba808a13b980 | |
parent | d5332f2fdd01396faf8cd6f925cca3916024a96f (diff) |
posix_opt.h: update to glibc's NPTL version
add uClibc_posix_opt.h to handle uClibc specific options/features
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | include/unistd.h | 1 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/posix_opt.h | 30 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/uClibc_posix_opt.h | 133 |
3 files changed, 147 insertions, 17 deletions
diff --git a/include/unistd.h b/include/unistd.h index 1b2fd4d15..a3cf288b2 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -171,6 +171,7 @@ __BEGIN_DECLS */ #include <bits/posix_opt.h> +#include <bits/uClibc_posix_opt.h> /* Get the environment definitions from Unix98. */ #ifdef __USE_UNIX98 diff --git a/libc/sysdeps/linux/common/bits/posix_opt.h b/libc/sysdeps/linux/common/bits/posix_opt.h index aa40eae43..2b370491f 100644 --- a/libc/sysdeps/linux/common/bits/posix_opt.h +++ b/libc/sysdeps/linux/common/bits/posix_opt.h @@ -1,5 +1,5 @@ /* Define POSIX options for Linux. - Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,8 +17,8 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _POSIX_OPT_H -#define _POSIX_OPT_H 1 +#ifndef _BITS_POSIX_OPT_H +#define _BITS_POSIX_OPT_H 1 /* Job control is supported. */ #define _POSIX_JOB_CONTROL 1 @@ -60,6 +60,9 @@ /* X/Open realtime support is available. */ #define _XOPEN_REALTIME 1 +/* X/Open thread realtime support is available. */ +#define _XOPEN_REALTIME_THREADS 1 + /* XPG4.2 shared memory is supported. */ #define _XOPEN_SHM 1 @@ -79,10 +82,15 @@ /* We support user-defined stacks. */ #define _POSIX_THREAD_ATTR_STACKADDR 200112L -#ifdef __UCLIBC_HAS_REALTIME__ +/* We support priority inheritence. */ +#define _POSIX_THREAD_PRIO_INHERIT 200112L + +/* We support priority protection, though only for non-robust + mutexes. */ +#define _POSIX_THREAD_PRIO_PROTECT 200112L + /* We support POSIX.1b semaphores. */ #define _POSIX_SEMAPHORES 200112L -#endif /* Real-time signals are supported. */ #define _POSIX_REALTIME_SIGNALS 200112L @@ -98,12 +106,10 @@ /* The LFS support in asynchronous I/O is also available. */ #define _LFS64_ASYNCHRONOUS_IO 1 -#ifdef __UCLIBC_HAS_LFS__ /* The rest of the LFS is also available. */ #define _LFS_LARGEFILE 1 #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 -#endif /* POSIX shared memory objects are implemented. */ #define _POSIX_SHARED_MEMORY_OBJECTS 200112L @@ -114,10 +120,8 @@ /* Clock support in threads must be also checked at runtime. */ #define _POSIX_THREAD_CPUTIME 0 -#ifdef __UCLIBC_HAS_REGEX__ /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 -#endif /* Reader/Writer locks are available. */ #define _POSIX_READER_WRITER_LOCKS 200112L @@ -157,15 +161,11 @@ /* Advisory information interfaces are available. */ #define _POSIX_ADVISORY_INFO 200112L -#ifdef __UCLIBC_HAS_IPV6__ /* IPv6 support is available. */ #define _POSIX_IPV6 200112L -#endif -#ifdef __UCLIBC_HAS_SOCKET__ /* Raw socket support is available. */ #define _POSIX_RAW_SOCKETS 200112L -#endif /* We have at least one terminal. */ #define _POSIX2_CHAR_TERM 200112L @@ -183,8 +183,4 @@ /* Typed memory objects are not available. */ #define _POSIX_TYPED_MEMORY_OBJECTS -1 -/* No support for priority inheritance or protection so far. */ -#define _POSIX_THREAD_PRIO_INHERIT -1 -#define _POSIX_THREAD_PRIO_PROTECT -1 - #endif /* posix_opt.h */ diff --git a/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h b/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h new file mode 100644 index 000000000..1ac4521eb --- /dev/null +++ b/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ +/* + * Never include this file directly; use <unistd.h> instead. + */ + +#ifndef _BITS_UCLIBC_POSIX_OPT_H +#define _BITS_UCLIBC_POSIX_OPT_H 1 + +/* This file works correctly only if posix_opt.h is the NPTL version */ +#ifndef _POSIX_THREADS +# error posix_opt.h was incorrectly updated, use the NPTL version from glibc +#endif + +/* change first options based on what glibc does */ + +#ifndef __UCLIBC_HAS_THREADS_NATIVE__ +# undef _POSIX_THREAD_PROCESS_SHARED +# define _POSIX_THREAD_PROCESS_SHARED -1 +# undef _POSIX_CLOCK_SELECTION +# define _POSIX_CLOCK_SELECTION -1 +# undef _POSIX_THREAD_PRIO_INHERIT +# define _POSIX_THREAD_PRIO_INHERIT -1 +# undef _POSIX_THREAD_PRIO_PROTECT +# define _POSIX_THREAD_PRIO_PROTECT -1 +#endif + +/* this has to be adapted to uClibc, not all are thread related */ +#ifndef __UCLIBC_HAS_THREADS__ +# undef _XOPEN_REALTIME_THREADS +# undef _POSIX_THREADS +# undef _POSIX_REENTRANT_FUNCTIONS +# undef _POSIX_THREAD_SAFE_FUNCTIONS +# undef _POSIX_THREAD_PRIORITY_SCHEDULING +# undef _POSIX_THREAD_ATTR_STACKSIZE +# undef _POSIX_THREAD_ATTR_STACKADDR +# undef _POSIX_THREAD_PRIO_INHERIT +# undef _POSIX_THREAD_PRIO_PROTECT +# undef _POSIX_SEMAPHORES +# undef _POSIX_ASYNCHRONOUS_IO +# undef _POSIX_ASYNC_IO +# undef _LFS_ASYNCHRONOUS_IO +# undef _POSIX_PRIORITIZED_IO +# undef _LFS64_ASYNCHRONOUS_IO +# undef _POSIX_CPUTIME +# undef _POSIX_THREAD_CPUTIME +# undef _POSIX_READER_WRITER_LOCKS +# undef _POSIX_TIMEOUTS +# undef _POSIX_SPIN_LOCKS +# undef _POSIX_BARRIERS +# undef _POSIX_MESSAGE_PASSING +# undef _POSIX_THREAD_PROCESS_SHARED +# undef _POSIX_CLOCK_SELECTION +# undef _POSIX_ADVISORY_INFO +/*# undef _POSIX_RAW_SOCKETS*/ +/*# undef _POSIX2_CHAR_TERM*/ +# undef _POSIX_SPORADIC_SERVER +# undef _POSIX_THREAD_SPORADIC_SERVER +/*# undef _POSIX_TRACE +# undef _POSIX_TRACE_EVENT_FILTER +# undef _POSIX_TRACE_INHERIT +# undef _POSIX_TRACE_LOG +# undef _POSIX_TYPED_MEMORY_OBJECTS*/ +#endif + +/* were in earlier version, used by sysconf */ +#define _POSIX_POLL 1 +#define _POSIX_SELECT 1 + +/* disable independently unsupported features */ +#undef _POSIX_TRACE +#undef _POSIX_TRACE_EVENT_FILTER +#undef _POSIX_TRACE_INHERIT +#undef _POSIX_TRACE_LOG +#undef _POSIX_TYPED_MEMORY_OBJECTS + +#if 0 /* does uClibc support these? */ +# undef _POSIX_ASYNCHRONOUS_IO +# undef _POSIX_ASYNC_IO +# undef _LFS_ASYNCHRONOUS_IO +# undef _POSIX_PRIORITIZED_IO +# undef _LFS64_ASYNCHRONOUS_IO +# undef _POSIX_MESSAGE_PASSING +#endif + +/* change options based on uClibc config options */ + +#if 0 /*ndef __UCLIBC_HAS_POSIX_TIMERS__*/ +# undef _POSIX_TIMERS +# undef _POSIX_THREAD_CPUTIME +#endif + +#if 0 /*ndef __UCLIBC_HAS_POSIX_BARRIERS__*/ +# undef _POSIX_BARRIERS +#endif + +#if 0 /*ndef __UCLIBC_HAS_POSIX_SPINLOCKS__*/ +# undef _POSIX_SPIN_LOCKS +#endif + +#ifndef __ARCH_USE_MMU__ +# undef _POSIX_MEMLOCK +# undef _POSIX_MEMLOCK_RANGE +# undef _POSIX_MEMORY_PROTECTION +#endif + +#ifndef __UCLIBC_HAS_LFS__ +# undef _LFS64_ASYNCHRONOUS_IO +# undef _LFS_LARGEFILE +# undef _LFS64_LARGEFILE +# undef _LFS64_STDIO +#endif + +#ifndef __UCLIBC_HAS_REALTIME__ +# undef _POSIX_SEMAPHORES +#endif + +#ifndef __UCLIBC_HAS_REGEX__ +# undef _POSIX_REGEXP +#endif + +#ifndef __UCLIBC_HAS_IPV6__ +# undef _POSIX_IPV6 +#endif + +#ifndef __UCLIBC_HAS_SOCKET__ +# undef _POSIX_RAW_SOCKETS +#endif + +#endif /* bits/uClibc_posix_opt.h */ |