If you touch sem_t directly rather than only using the sem_* functions, then the behavior is undefined. It's no different from if you clobbered a pointer-typed field in an internal data structure with a bogus pointer.