summaryrefslogtreecommitdiff
path: root/nptl/pthread_setcanceltype.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-11-20 13:43:35 -0800
committerRoland McGrath <roland@hack.frob.com>2014-11-20 13:43:35 -0800
commit2f531bbb7b0458a303e8969f1e830467ca684443 (patch)
tree28b2c5b70b7b886e4b910edd3cfe6b1d19fdba34 /nptl/pthread_setcanceltype.c
parentf214ff74f46275f6f1187730ac88b8a2407393f3 (diff)
NPTL: Conditionalize asynchronous cancellation support on [SIGCANCEL].
Diffstat (limited to 'nptl/pthread_setcanceltype.c')
-rw-r--r--nptl/pthread_setcanceltype.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c
index fb1631f0ab..32646dc759 100644
--- a/nptl/pthread_setcanceltype.c
+++ b/nptl/pthread_setcanceltype.c
@@ -26,12 +26,15 @@ __pthread_setcanceltype (type, oldtype)
int type;
int *oldtype;
{
- volatile struct pthread *self;
-
if (type < PTHREAD_CANCEL_DEFERRED || type > PTHREAD_CANCEL_ASYNCHRONOUS)
return EINVAL;
- self = THREAD_SELF;
+#ifndef SIGCANCEL
+ if (type == PTHREAD_CANCEL_ASYNCHRONOUS)
+ return ENOTSUP;
+#endif
+
+ volatile struct pthread *self = THREAD_SELF;
int oldval = THREAD_GETMEM (self, cancelhandling);
while (1)