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
),
33 N (PRIORITY_SCHEDULING
),
35 N (READER_WRITER_LOCKS
),
40 N (SHARED_MEMORY_OBJECTS
),
46 N (THREAD_ATTR_STACKADDR
),
47 N (THREAD_ATTR_STACKSIZE
),
49 N (THREAD_PRIO_INHERIT
),
50 N (THREAD_PRIO_PROTECT
),
51 N (THREAD_PRIORITY_SCHEDULING
),
52 N (THREAD_PROCESS_SHARED
),
53 N (THREAD_SAFE_FUNCTIONS
),
54 N (THREAD_SPORADIC_SERVER
),
59 N (TRACE_EVENT_FILTER
),
62 N (TYPED_MEMORY_OBJECTS
),
67 #define nposix_options (sizeof (posix_options) / sizeof (posix_options[0]))
74 for (int i
= 0; i
< nposix_options
; ++i
)
76 long int scret
= sysconf (posix_options
[i
]._SC_val
);
80 printf ("sysconf(_SC_%s%s) returned zero\n",
81 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
);
84 if (posix_options
[i
]._P_val
!= 0 && posix_options
[i
]._P_val
!= scret
)
86 printf ("sysconf(_SC_%s%s) = %ld does not match _POSIX%s_%s = %ld\n",
87 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
,
89 posix_options
[i
].posix2
? "2" : "", posix_options
[i
].name
,
90 posix_options
[i
]._P_val
);
93 else if (posix_options
[i
].positive
&& scret
< 0)
95 printf ("sysconf(_SC_%s%s) must be > 0\n",
96 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
);
100 #define STDVER 200112L
101 if (scret
> 0 && scret
!= STDVER
&& !posix_options
[i
].positive
)
103 printf ("sysconf(_SC_%s%s) must be %ldL\n",
104 posix_options
[i
].posix2
? "2_" : "", posix_options
[i
].name
,
113 #define TEST_FUNCTION do_test ()
114 #include "../test-skeleton.c"