1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00
Files
glibc/conform/data/semaphore.h-data
Collin Funk d18213c699 conform: Add initial support for C23.
Hi Joseph,

As we discussed, this patch just makes C23 include every check that is
performed by C11.

I tested the commit by adding the ISO23 Make and Python variables to be
the same as ISO11.  So the only difference was compiling with -DISO23
instead of -DISO11.  And changed the temporary directories to instead
use the format f'/tmp/glibc-{self.standard}-{self.header}'.  Then I used
a shell script to run 'cmp' on each file in the ISO11 and ISO23
directories for each header to make sure they were the same.

-- 8< --

Make C23 checks include every test that is performed by C11.  Done by
running the following command:

find conform -name '*.h-data' | xargs sed -i \
  -e 's| !defined ISO11| !defined ISO11 \&\& !defined ISO23|g' \
  -e 's| defined ISO11| defined ISO11 \|\| defined ISO23|g' \
  -e 's|ifdef ISO11|if defined ISO11 \|\| defined ISO23|g' \
  -e 's|ifndef ISO11|if !defined ISO11 \&\& !defined ISO23|g'

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
2025-04-10 18:39:05 +00:00

33 lines
939 B
Plaintext

#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined ISO23 && !defined XPG4 && !defined XPG42
type sem_t
constant SEM_FAILED
function int sem_close (sem_t*)
function int sem_destroy (sem_t*)
function int sem_getvalue (sem_t*, int*)
function int sem_init (sem_t*, int, unsigned int)
function {sem_t*} sem_open (const char*, int, ...)
function int sem_post (sem_t*)
# if !defined POSIX && !defined UNIX98
function int sem_timedwait (sem_t*, const struct timespec*)
# endif
function int sem_trywait (sem_t*)
function int sem_unlink (const char*)
function int sem_wait (sem_t*)
allow-header fcntl.h
# if !defined POSIX2008 && !defined XOPEN2K8
allow-header sys/types.h
# endif
// Consider addition of this permission in POSIX.1:2008 as a bug fix,
// so allow for POSIX.1:2001 as well since that includes sem_timedwait.
# if !defined POSIX && !defined UNIX98
allow-header time.h
# endif
allow sem_*
allow SEM_*
allow *_t
#endif