support glibc 2.16
authorAnas Nashif <anas.nashif@intel.com>
Tue, 6 Nov 2012 18:39:36 +0000 (10:39 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Tue, 6 Nov 2012 18:39:36 +0000 (10:39 -0800)
lib/read-files-group.c
lib/read-files.c

index 9f686fa..996396e 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 #include <nss.h>
-#include <bits/libc-lock.h>
+#include <pthread.h>
 #define __libc_lock_t pthread_mutex_t
+#define __libc_lock_define_initialized(CLASS,NAME) \
+  CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
+#define __libc_lock_lock(NAME) \
+  pthread_mutex_lock, (&(NAME))
+#define __libc_lock_unlock(NAME) \
+  pthread_mutex_unlock, (&(NAME))
 
 #include "read-files.h"
 
index 7eec401..53e1c7b 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 #include <nss.h>
-#include <bits/libc-lock.h>
+#include <pthread.h>
 #define __libc_lock_t pthread_mutex_t
+#define __libc_lock_define_initialized(CLASS,NAME) \
+  CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
+#define __libc_lock_lock(NAME) \
+  pthread_mutex_lock, (&(NAME))
+#define __libc_lock_unlock(NAME) \
+  pthread_mutex_unlock, (&(NAME))
 
 #include "read-files.h"