unix.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _TOOLKIT_UNIX_HEADER_H_
  2. #define _TOOLKIT_UNIX_HEADER_H_
  3. #ifndef _WIN32
  4. #include <sys/types.h>
  5. #include <sys/stat.h>
  6. #include <fcntl.h>
  7. #include <dirent.h>
  8. #include <sys/socket.h>
  9. #include <netinet/in.h>
  10. #include <netinet/tcp.h>
  11. #include <arpa/inet.h>
  12. #include <netdb.h> /* MAXHOSTNAMELEN on Solaris */
  13. #include <termios.h>
  14. #include <pwd.h>
  15. #if !defined(__MVS__)
  16. #include <semaphore.h>
  17. #include <sys/param.h> /* MAXHOSTNAMELEN on Linux and the BSDs */
  18. #endif
  19. #include <pthread.h>
  20. #include <signal.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #include <pthread.h>
  25. #include <semaphore.h>
  26. typedef pthread_key_t toolkit_key_t;
  27. typedef pthread_t toolkit_thread_t;
  28. typedef pthread_mutex_t toolkit_mutex_t;
  29. typedef pthread_once_t toolkit_once_t;
  30. typedef pid_t toolkit_pid_t;
  31. #define TOOLKIT_ONCE_INIT PTHREAD_ONCE_INIT
  32. typedef struct {
  33. void* handle;
  34. char* errmsg;
  35. } toolkit_lib_t;
  36. typedef pthread_rwlock_t toolkit_rwlock_t;
  37. typedef sem_t toolkit_sem_t;
  38. typedef pthread_cond_t toolkit_cond_t;
  39. typedef pthread_barrier_t toolkit_barrier_t;
  40. #ifdef __cplusplus
  41. } // extern "C" {
  42. #endif
  43. #endif //NOT _WIN32
  44. #endif /** */