glibc/conform/data
Adhemerval Zanella ce7528f637 nptl: Add C11 threads thrd_* functions
This patch adds the thrd_* definitions from C11 threads (ISO/IEC 9899:2011),
more specifically thrd_create, thrd_curent, rhd_detach, thrd_equal,
thrd_exit, thrd_join, thrd_sleep, thrd_yield, and required types.

Mostly of the definitions are composed based on POSIX conterparts, such as
thrd_t (using pthread_t).  For thrd_* function internally direct
POSIX pthread call are used with the exceptions:

  1. thrd_start uses pthread_create internal implementation, but changes
     how to actually calls the start routine.  This is due the difference
     in signature between POSIX and C11, where former return a 'void *'
     and latter 'int'.
     To avoid calling convention issues due 'void *' to int cast, routines
     from C11 threads are started slight different than default pthread one.
     Explicit cast to expected return are used internally on pthread_create
     and the result is stored back to void also with an explicit cast.

  2. thrd_sleep uses nanosleep internal direct syscall to avoid clobbering
     errno and to handle expected standard return codes.  It is a
     cancellation entrypoint to be consistent with both thrd_join and
     cnd_{timed}wait.

  3. thrd_yield also uses internal direct syscall to avoid errno clobbering.

Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu,
arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu,
powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu,
and x86_64-linux-gnu).

Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
arm-linux-gnueabhf, and powerpc64le-linux-gnu.

	[BZ #14092]
	* conform/Makefile (conformtest-headers-ISO11): Add threads.h.
	(linknamespace-libs-ISO11): Add libpthread.a.
	* conform/data/threads.h-data: New file: add C11 thrd_* types and
	functions.
	* include/stdc-predef.h (__STDC_NO_THREADS__): Remove definition.
	* nptl/Makefile (headers): Add threads.h.
	(libpthread-routines): Add new C11 thread thrd_create, thrd_current,
	thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, and
	thrd_yield.
	* nptl/Versions (libpthread) [GLIBC_2.28]): Add new C11 thread
	thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit,
	thrd_join, thrd_sleep, and thrd_yield symbols.
	* nptl/descr.h (struct pthread): Add c11 field.
	* nptl/pthreadP.h (ATTR_C11_THREAD): New define.
	* nptl/pthread_create.c (START_THREAD_DEFN): Call C11 thread start
	routine with expected function prototype.
	(__pthread_create_2_1): Add C11 threads check based on attribute
	value.
	* sysdeps/unix/sysdep.h (INTERNAL_SYSCALL_CANCEL): New macro.
	* nptl/thrd_create.c: New file.
	* nptl/thrd_current.c: Likewise.
	* nptl/thrd_detach.c: Likewise.
	* nptl/thrd_equal.c: Likewise.
	* nptl/thrd_exit.c: Likewise.
	* nptl/thrd_join.c: Likewise.
	* nptl/thrd_priv.h: Likewise.
	* nptl/thrd_sleep.c: Likewise.
	* nptl/thrd_yield.c: Likewise.
	* include/threads.h: Likewise.
2018-07-24 14:06:45 -03:00
..
arpa conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
net conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
netinet hurd: Fix symbols exposition 2018-04-19 20:14:45 +02:00
sys hurd xfails: Add missing bug references 2018-04-20 17:14:13 +02:00
aio.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
assert.h-data
complex.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
cpio.h-data
ctype.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
dirent.h-data
dlfcn.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
errno.h-data
fcntl.h-data hurd: xfail some structure fields ABI incompatibility with standards 2018-04-19 01:52:51 +02:00
fenv.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
float.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
fmtmsg.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
fnmatch.h-data
ftw.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
glob.h-data
grp.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
iconv.h-data
inttypes.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
iso646.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
langinfo.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
libgen.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
limits.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
locale.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
math.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
monetary.h-data
mqueue.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
ndbm.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
netdb.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
nl_types.h-data
poll.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
pthread.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
pwd.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
regex.h-data
sched.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
search.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
semaphore.h-data conformtest: Allow time.h inclusion from semaphore.h for XOPEN2K. 2017-04-28 16:52:16 +00:00
setjmp.h-data
signal.h-data hurd xfails: Add missing bug references 2018-04-20 17:14:13 +02:00
spawn.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
stdalign.h-data
stdarg.h-data
stdbool.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
stddef.h-data
stdint.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
stdio.h-data Don't install libio.h or _G_config.h. 2018-02-07 10:07:31 -05:00
stdlib.h-data Disallow use of DES encryption functions in new programs. 2018-06-29 16:53:18 +02:00
stdnoreturn.h-data
string.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
strings.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
stropts.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
syslog.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
tar.h-data
termios.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
tgmath.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
threads.h-data nptl: Add C11 threads thrd_* functions 2018-07-24 14:06:45 -03:00
time.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
uchar.h-data
ucontext.h-data conformtest: XFAIL uc_mcontext test for powerpc32 (bug 21635). 2017-06-20 17:51:36 +00:00
ulimit.h-data
unistd.h-data Disallow use of DES encryption functions in new programs. 2018-06-29 16:53:18 +02:00
utime.h-data
utmpx.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
varargs.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
wchar.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
wctype.h-data conformtest: Fix XPG standard naming. 2017-04-27 20:29:35 +00:00
wordexp.h-data