semaphore.h 596 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * This file is subject to the terms and conditions of the LGPL V2.1
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2019 Kalray Inc.
  7. */
  8. #ifndef _SEMAPHORE_H
  9. # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
  10. #endif
  11. #include <bits/wordsize.h>
  12. #if __WORDSIZE == 64
  13. # define __SIZEOF_SEM_T 32
  14. #else
  15. # define __SIZEOF_SEM_T 16
  16. #endif
  17. /* Value returned if `sem_open' failed. */
  18. #define SEM_FAILED ((sem_t *) 0)
  19. typedef union
  20. {
  21. char __size[__SIZEOF_SEM_T];
  22. long int __align;
  23. } sem_t;