blob: 9674ed34138a1ed00be2588907e5331a1d1f2718 [file] [log] [blame]
Vitaly Buka33af9a32021-11-08 18:23:42 -08001// RUN: %clang -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
Bill Seurer67a18302016-03-07 01:30:02 +00002//
3// setuid(0) hangs on powerpc64 big endian. When this is fixed remove
4// the unsupported flag.
5// https://llvm.org/bugs/show_bug.cgi?id=25799
6//
7// UNSUPPORTED: powerpc64-unknown-linux-gnu
Vitaly Buka33af9a32021-11-08 18:23:42 -08008
9#include <pthread.h>
10#include <stdio.h>
Dmitry Vyukov3658f6f2015-04-23 09:33:27 +000011#include <sys/types.h>
12#include <unistd.h>
13
Vitaly Buka33af9a32021-11-08 18:23:42 -080014// Setuid call used to hang because the new thread did not handle
Dmitry Vyukov3658f6f2015-04-23 09:33:27 +000015// SIGSETXID signal. Note that we don't care whether setuid call succeeds
16// or not.
17
18static void *thread(void *arg) {
19 (void)arg;
20 sleep(1);
21 return 0;
22}
23
24int main() {
25 // Create another thread just for completeness of the picture.
26 pthread_t th;
27 pthread_create(&th, 0, thread, 0);
28 setuid(0);
29 pthread_join(th, 0);
30 fprintf(stderr, "DONE\n");
31 return 0;
32}
33
34// CHECK: DONE