about summary refs log tree commit diff
path: root/misc/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-05-20 15:40:35 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-07-06 11:15:58 +0200
commit706ad1e7af37be1d25fc2359bda006d31fe0d11b (patch)
treed06e6a96c1d319a1d27fa6b6e87cfadf8bd6ef08 /misc/Makefile
parent8f4632deb3545b2949cec5454afc3cb21a0024ea (diff)
downloadglibc-706ad1e7af37be1d25fc2359bda006d31fe0d11b.tar.gz
glibc-706ad1e7af37be1d25fc2359bda006d31fe0d11b.tar.xz
glibc-706ad1e7af37be1d25fc2359bda006d31fe0d11b.zip
Add the __libc_single_threaded variable
The variable is placed in libc.so, and it can be true only in
an outer libc, not libcs loaded via dlmopen or static dlopen.
Since thread creation from inner namespaces does not work,
pthread_create can update __libc_single_threaded directly.

Using __libc_early_init and its initial flag, implementation of this
variable is very straightforward.  A future version may reset the flag
during fork (but not in an inner namespace), or after joining all
threads except one.

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'misc/Makefile')
-rw-r--r--misc/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 67c5237f97..58959f6913 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -37,7 +37,8 @@ headers	:= sys/uio.h bits/uio-ext.h bits/uio_lim.h \
 	   bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
 	   bits/select2.h bits/hwcap.h sys/auxv.h \
 	   sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
-	   bits/err-ldbl.h bits/error-ldbl.h
+	   bits/err-ldbl.h bits/error-ldbl.h \
+	   sys/single_threaded.h
 
 routines := brk sbrk sstk ioctl \
 	    readv writev preadv preadv64 pwritev pwritev64 \
@@ -72,7 +73,7 @@ routines := brk sbrk sstk ioctl \
 	    fgetxattr flistxattr fremovexattr fsetxattr getxattr \
 	    listxattr lgetxattr llistxattr lremovexattr lsetxattr \
 	    removexattr setxattr getauxval ifunc-impl-list makedev \
-	    allocate_once fd_to_filename
+	    allocate_once fd_to_filename single_threaded
 
 generated += tst-error1.mtrace tst-error1-mem.out \
   tst-allocate_once.mtrace tst-allocate_once-mem.out