POSIX.1-2008 moved support for unnamed semaphores from the semaphore option to the base specification. macOS has never followed up on that. To make things more confusing, it does provide the function prototypes (though with a deprecated declaration annotation) and just has sem_init(3) return -1 unconditionally: https://github.com/apple-oss-distributions/xnu/blob/a5e7219620fa69943647714baaf632196f37249e/libsyscall/wrappers/posix_sem_obsolete.c
Fun!