summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/bits/uClibc_posix_opt.h
blob: 6ec7da3de94224c88412bd623cb3d07ed7e57cfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
 * 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
# undef _POSIX_THREAD_ROBUST_PRIO_INHERIT
# undef _POSIX_THREAD_ROBUST_PRIO_PROTECT
#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
#undef _POSIX_SPAWN

#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_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 */