diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-01 12:52:05 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-01 12:52:05 +0100 |
commit | 5e3ae1e8d8b6bf440b36ea2a6f553d4d365a8110 (patch) | |
tree | 97f7be3f78807103fdf124315c690568506411df | |
parent | 2c710f58079a5eaffc260b4270f831e31a827b03 (diff) | |
download | gnunet-fuse-5e3ae1e8d8b6bf440b36ea2a6f553d4d365a8110.tar.gz gnunet-fuse-5e3ae1e8d8b6bf440b36ea2a6f553d4d365a8110.zip |
Compiling gnunet-fuse fails on Arch due to
undefined reference to `pthread_mutexattr_setkind_np'
In the file that provokes the error there is this comment:
This prototype is somehow missing in various Linux pthread include files. But we need it and it seems to be available on all pthread-systems so far. Odd.
The reason is that pthread_mutexattr_setkind_np() is deprecated and non-standard. The standard version is called pthread_mutexattr_settype().
-rw-r--r-- | src/fuse/mutex.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/fuse/mutex.c b/src/fuse/mutex.c index beb6f93..f035ec8 100644 --- a/src/fuse/mutex.c +++ b/src/fuse/mutex.c | |||
@@ -35,16 +35,6 @@ | |||
35 | #endif | 35 | #endif |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /** | ||
39 | * This prototype is somehow missing in various Linux pthread | ||
40 | * include files. But we need it and it seems to be available | ||
41 | * on all pthread-systems so far. Odd. | ||
42 | */ | ||
43 | #ifndef _MSC_VER | ||
44 | extern int pthread_mutexattr_setkind_np (pthread_mutexattr_t * attr, | ||
45 | int kind); | ||
46 | #endif | ||
47 | |||
48 | 38 | ||
49 | /** | 39 | /** |
50 | * @brief Structure for MUTual EXclusion (Mutex). | 40 | * @brief Structure for MUTual EXclusion (Mutex). |
@@ -67,23 +57,13 @@ GNUNET_mutex_create (int isRecursive) | |||
67 | pthread_mutexattr_init (&attr); | 57 | pthread_mutexattr_init (&attr); |
68 | if (isRecursive) | 58 | if (isRecursive) |
69 | { | 59 | { |
70 | #ifdef __linux__ | ||
71 | GNUNET_assert (0 == pthread_mutexattr_setkind_np | ||
72 | (&attr, PTHREAD_MUTEX_RECURSIVE_NP)); | ||
73 | #elif BSD || SOLARIS || OSX || WINDOWS | ||
74 | GNUNET_assert (0 == pthread_mutexattr_settype | 60 | GNUNET_assert (0 == pthread_mutexattr_settype |
75 | (&attr, PTHREAD_MUTEX_RECURSIVE)); | 61 | (&attr, PTHREAD_MUTEX_RECURSIVE)); |
76 | #endif | ||
77 | } | 62 | } |
78 | else | 63 | else |
79 | { | 64 | { |
80 | #ifdef __linux__ | ||
81 | GNUNET_assert (0 == pthread_mutexattr_setkind_np | ||
82 | (&attr, PTHREAD_MUTEX_ERRORCHECK_NP)); | ||
83 | #else | ||
84 | GNUNET_assert (0 == pthread_mutexattr_settype | 65 | GNUNET_assert (0 == pthread_mutexattr_settype |
85 | (&attr, PTHREAD_MUTEX_ERRORCHECK)); | 66 | (&attr, PTHREAD_MUTEX_ERRORCHECK)); |
86 | #endif | ||
87 | } | 67 | } |
88 | mut = GNUNET_new (struct GNUNET_Mutex); | 68 | mut = GNUNET_new (struct GNUNET_Mutex); |
89 | GNUNET_assert (0 == pthread_mutex_init (&mut->pt, &attr)); | 69 | GNUNET_assert (0 == pthread_mutex_init (&mut->pt, &attr)); |