14 #define N_(name, pos) { _POSIX_##name, #name, _SC_##name, pos, false }
15 #define NP(name) N_ (name, true)
16 #define N(name) N_ (name, false)
17 #define N2(name) { _POSIX2_##name, #name, _SC_2_##name, false, true }
29 N (MEMORY_PROTECTION
),
32 #ifdef _POSIX_PRIORITIZED_IO
35 #ifdef _POSIX_PRIORITY_SCHEDULING
36 N (PRIORITY_SCHEDULING
),
39 N (READER_WRITER_LOCKS
),
44 N (SHARED_MEMORY_OBJECTS
),
49 #ifdef _POSIX_SYNCHRONIZED_IO
52 N (THREAD_ATTR_STACKADDR
),
53 N (THREAD_ATTR_STACKSIZE
),
55 N (THREAD_PRIO_INHERIT
),
56 N (THREAD_PRIO_PROTECT
),
57 N (THREAD_PRIORITY_SCHEDULING
),
58 N (THREAD_PROCESS_SHARED
),
59 N (THREAD_SAFE_FUNCTIONS
),
60 N (THREAD_SPORADIC_SERVER
),
65 N (TRACE_EVENT_FILTER
),
68 N (TYPED_MEMORY_OBJECTS
),
73 #define nposix_options (sizeof (posix_options) / sizeof (posix_options[0]))
80 for (int i
= 0; i
< nposix_options
; ++i
)
82 long int scret
= sysconf (posix_options
[i
]._SC_val
);
86 printf ("sysconf(_SC_%s%s) returned zero\n",
87 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
);
90 if (posix_options
[i
]._P_val
!= 0 && posix_options
[i
]._P_val
!= scret
)
92 printf ("sysconf(_SC_%s%s) = %ld does not match _POSIX%s_%s = %ld\n",
93 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
,
95 posix_options
[i
].posix2
? "2" : "", posix_options
[i
].name
,
96 posix_options
[i
]._P_val
);
99 else if (posix_options
[i
].positive
&& scret
< 0)
101 printf ("sysconf(_SC_%s%s) must be > 0\n",
102 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
);
106 #define STDVER 200809L
107 if (scret
> 0 && scret
!= STDVER
&& !posix_options
[i
].positive
)
109 printf ("sysconf(_SC_%s%s) must be %ldL\n",
110 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
,
119 #define TEST_FUNCTION do_test ()
120 #include "../test-skeleton.c"