From 0bc66bfb3dda9b1d7d1db266a9046705bda1cd15 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Fri, 25 Jul 2025 13:06:53 -0400 Subject: libthread: remove check for LinuxThreads libthread had code in `_pthreadinit` to test for LinuxThreads, and error if it was in use. This hasn't been relevant since Linux 2.6, and I can't imagine there are many people trying to build (recent) plan9port on systems that old. Unfortunately, this code violated aliasing rules, and compilers were complaining about it. But, since it likely hasn't had much relevance in 20ish years, we can probably just remove it. --- src/libthread/pthread.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/libthread/pthread.c') diff --git a/src/libthread/pthread.c b/src/libthread/pthread.c index 35f6ffe3..c2cc92ed 100644 --- a/src/libthread/pthread.c +++ b/src/libthread/pthread.c @@ -171,21 +171,6 @@ _threadsetproc(Proc *p) void _pthreadinit(void) { - static struct utsname un; - pthread_t id; - - if(uname(&un) < 0) - fprint(2, "warning: uname failed: %r\n"); - if(strcmp(un.sysname, "Linux") == 0){ - /* - * Want to distinguish between the old LinuxThreads pthreads - * and the new NPTL implementation. NPTL uses much bigger - * thread IDs. - */ - id = pthread_self(); - if(*(ulong*)(void*)&id < 1024*1024) - sysfatal("cannot use LinuxThreads as pthread library; see %s/src/libthread/README.Linux", get9root()); - } pthread_key_create(&prockey, 0); } -- cgit v1.2.3