aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/pthread/sem_open.c
diff options
context:
space:
mode:
authorgfleury <gfleury@disroot.org>2025-02-01 10:02:02 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-02-01 11:24:14 +0100
commitcf51d18b9daf510de1997d4d87328c03103a6b68 (patch)
tree6dad8b2cbef8aa8b9857280e5f5c7c2616a4b6d1 /sysdeps/pthread/sem_open.c
parent04588633cff835db7d838aa57c3def90d2621b76 (diff)
downloadglibc-cf51d18b9daf510de1997d4d87328c03103a6b68.tar.xz
glibc-cf51d18b9daf510de1997d4d87328c03103a6b68.zip
htl: move pthread_setcancelstate into libc.
sysdeps/pthread/sem_open.c: call pthread_setcancelstate directely since forward declaration is gone on hurd too Message-ID: <20250201080202.494671-1-gfleury@disroot.org>
Diffstat (limited to 'sysdeps/pthread/sem_open.c')
-rw-r--r--sysdeps/pthread/sem_open.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sysdeps/pthread/sem_open.c b/sysdeps/pthread/sem_open.c
index 9f242599d5..e5eacb5fed 100644
--- a/sysdeps/pthread/sem_open.c
+++ b/sysdeps/pthread/sem_open.c
@@ -26,6 +26,7 @@
#include <futex-internal.h>
#include <libc-lock.h>
+
#if !PTHREAD_IN_LIBC
/* The private names are not exported from libc. */
# define __link link
@@ -57,11 +58,7 @@ __sem_open (const char *name, int oflag, ...)
}
/* Disable asynchronous cancellation. */
-#ifdef __libc_ptf_call
- int state;
- __libc_ptf_call (__pthread_setcancelstate,
- (PTHREAD_CANCEL_DISABLE, &state), 0);
-#endif
+ int state = __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
/* If the semaphore object has to exist simply open it. */
if ((oflag & O_CREAT) == 0 || (oflag & O_EXCL) == 0)
@@ -214,9 +211,7 @@ __sem_open (const char *name, int oflag, ...)
}
out:
-#ifdef __libc_ptf_call
- __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
-#endif
+ __pthread_setcancelstate (state, NULL);
return result;
}