Advertisement
Guest User

Untitled

a guest
May 25th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.22 KB | None | 0 0
  1. /*
  2.  
  3. /nxb-bin/usr/bin/cc -o conftest -O2 -pipe -mfloat-abi=softfp -DMDB_DSYNC=O_SYNC -Dfdatasync=fsync -fno-strict-aliasing -I/usr/local/include conftest.c -pthread -L/usr/local/lib
  4.  
  5. */
  6.  
  7.  
  8. /* confdefs.h */
  9. #define PACKAGE_NAME ""
  10. #define PACKAGE_TARNAME ""
  11. #define PACKAGE_VERSION ""
  12. #define PACKAGE_STRING ""
  13. #define PACKAGE_BUGREPORT ""
  14. #define PACKAGE_URL ""
  15. #define OPENLDAP_PACKAGE "OpenLDAP"
  16. #define OPENLDAP_VERSION "2.4.40"
  17. #define LDAP_VENDOR_VERSION 20440
  18. #define LDAP_VENDOR_VERSION_MAJOR 2
  19. #define LDAP_VENDOR_VERSION_MINOR 4
  20. #define LDAP_VENDOR_VERSION_PATCH 40
  21. #define HAVE_MKVERSION 1
  22. #define STDC_HEADERS 1
  23. #define HAVE_SYS_TYPES_H 1
  24. #define HAVE_SYS_STAT_H 1
  25. #define HAVE_STDLIB_H 1
  26. #define HAVE_STRING_H 1
  27. #define HAVE_MEMORY_H 1
  28. #define HAVE_STRINGS_H 1
  29. #define HAVE_INTTYPES_H 1
  30. #define HAVE_STDINT_H 1
  31. #define HAVE_UNISTD_H 1
  32. #define HAVE_DLFCN_H 1
  33. #define EXEEXT ""
  34. #define STDC_HEADERS 1
  35. #define HAVE_DIRENT_H 1
  36. #define HAVE_SYS_WAIT_H 1
  37. #define HAVE_ARPA_INET_H 1
  38. #define HAVE_ARPA_NAMESER_H 1
  39. #define HAVE_ASSERT_H 1
  40. #define HAVE_ERRNO_H 1
  41. #define HAVE_FCNTL_H 1
  42. #define HAVE_GETOPT_H 1
  43. #define HAVE_GRP_H 1
  44. #define HAVE_LIBUTIL_H 1
  45. #define HAVE_LIMITS_H 1
  46. #define HAVE_LOCALE_H 1
  47. #define HAVE_MEMORY_H 1
  48. #define HAVE_PWD_H 1
  49. #define HAVE_STDDEF_H 1
  50. #define HAVE_STRING_H 1
  51. #define HAVE_STRINGS_H 1
  52. #define HAVE_SYSEXITS_H 1
  53. #define HAVE_SYS_FILE_H 1
  54. #define HAVE_SYS_FILIO_H 1
  55. #define HAVE_SYS_ERRNO_H 1
  56. #define HAVE_SYS_IOCTL_H 1
  57. #define HAVE_SYS_PARAM_H 1
  58. #define HAVE_SYS_RESOURCE_H 1
  59. #define HAVE_SYS_SELECT_H 1
  60. #define HAVE_SYS_SOCKET_H 1
  61. #define HAVE_SYS_STAT_H 1
  62. #define HAVE_SYS_SYSLOG_H 1
  63. #define HAVE_SYS_TIME_H 1
  64. #define HAVE_SYS_TYPES_H 1
  65. #define HAVE_SYS_UIO_H 1
  66. #define HAVE_SYSLOG_H 1
  67. #define HAVE_TERMIOS_H 1
  68. #define HAVE_UNISTD_H 1
  69. #define HAVE_UTIME_H 1
  70. #define HAVE_RESOLV_H 1
  71. #define HAVE_NETINET_TCP_H 1
  72. #define HAVE_SYS_UCRED_H 1
  73. #define HAVE_SIGACTION 1
  74. #define HAVE_SIGSET 1
  75. #define HAVE_SYS_SELECT_H 1
  76. #define HAVE_SYS_SOCKET_H 1
  77. #define SELECT_TYPE_ARG1 int
  78. #define SELECT_TYPE_ARG234 (fd_set *)
  79. #define SELECT_TYPE_ARG5 (struct timeval *)
  80. #define HAVE_POLL 1
  81. #define HAVE_POLL_H 1
  82. #define HAVE_SYS_POLL_H 1
  83. #define HAVE_SYS_ERRLIST 1
  84. #define HAVE_STRERROR 1
  85. #define HAVE_STRERROR_R 1
  86. #define HAVE_REGEX_H 1
  87. #define HAVE_SYS_UUID_H 1
  88. #define HAVE_RES_QUERY 1
  89. #define HAVE_HSTRERROR 1
  90. #define HAVE_GETADDRINFO 1
  91. #define HAVE_GETNAMEINFO 1
  92. #define HAVE_GAI_STRERROR 1
  93. #define HAVE_INET_NTOP 1
  94. #define HAVE_SYS_UN_H 1
  95. #define HAVE_OPENSSL_SSL_H 1
  96. #define HAVE_OPENSSL 1
  97. #define HAVE_OPENSSL_CRL 1
  98. #define HAVE_TLS 1
  99. #define HAVE_PTHREAD_H 1
  100. #define HAVE_PTHREADS 10
  101. #define HAVE_SCHED_H 1
  102. /* end confdefs.h.  */
  103.  
  104. /* pthread test headers */
  105. #include <pthread.h>
  106. #if HAVE_PTHREADS < 7
  107. #include <errno.h>
  108. #endif
  109. #ifndef NULL
  110. #define NULL (void*)0
  111. #endif
  112.  
  113. static void *task(p)
  114.         void *p;
  115. {
  116.         return (void *) (p == NULL);
  117. }
  118.  
  119.  
  120. int main(argc, argv)
  121.         int argc;
  122.         char **argv;
  123. {
  124.  
  125.         /* pthread test function */
  126. #ifndef PTHREAD_CREATE_DETACHED
  127. #define PTHREAD_CREATE_DETACHED 1
  128. #endif
  129.         pthread_t t;
  130.         int status;
  131.         int detach = PTHREAD_CREATE_DETACHED;
  132.  
  133. #if HAVE_PTHREADS > 4
  134.         /* Final pthreads */
  135.         pthread_attr_t attr;
  136.  
  137.         status = pthread_attr_init(&attr);
  138.         if( status ) return status;
  139.  
  140. #if HAVE_PTHREADS < 7
  141.         status = pthread_attr_setdetachstate(&attr, &detach);
  142.         if( status < 0 ) status = errno;
  143. #else
  144.         status = pthread_attr_setdetachstate(&attr, detach);
  145. #endif
  146.         if( status ) return status;
  147.         status = pthread_create( &t, &attr, task, NULL );
  148. #if HAVE_PTHREADS < 7
  149.         if( status < 0 ) status = errno;
  150. #endif
  151.         if( status ) return status;
  152. #else
  153.         /* Draft 4 pthreads */
  154.         status = pthread_create( &t, pthread_attr_default, task, NULL );
  155.         if( status ) return errno;
  156.  
  157.         /* give thread a chance to complete */
  158.         /* it should remain joinable and hence detachable */
  159.         sleep( 1 );
  160.  
  161.         status = pthread_detach( &t );
  162.         if( status ) return errno;
  163. #endif
  164.  
  165. #ifdef HAVE_LINUX_THREADS
  166.         pthread_kill_other_threads_np();
  167. #endif
  168.  
  169.         return 0;
  170.  
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement