From 1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 2 Feb 2019 15:17:02 +0100 Subject: Linux: Add gettid system call wrapper [BZ #6399] This commit adds gettid to on Linux, and not to the kernel-independent GNU API. gettid is now supportable on Linux because too many things assume a 1:1 mapping between libpthread threads and kernel threads. Reviewed-by: Carlos O'Donell --- posix/Makefile | 3 ++- posix/bits/unistd_ext.h | 21 +++++++++++++++++++++ posix/unistd.h | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 posix/bits/unistd_ext.h (limited to 'posix') diff --git a/posix/Makefile b/posix/Makefile index 873947f72e..93c3a290d7 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -31,7 +31,8 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \ bits/local_lim.h tar.h bits/utsname.h bits/confname.h \ bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \ bits/sched.h bits/cpu-set.h re_comp.h wait.h bits/environments.h \ - cpio.h spawn.h bits/unistd.h bits/types/struct_sched_param.h + cpio.h spawn.h bits/unistd.h bits/types/struct_sched_param.h \ + bits/unistd_ext.h routines := \ uname \ diff --git a/posix/bits/unistd_ext.h b/posix/bits/unistd_ext.h new file mode 100644 index 0000000000..d6e88f3bd4 --- /dev/null +++ b/posix/bits/unistd_ext.h @@ -0,0 +1,21 @@ +/* System-specific extensions of , generic version. + Copyright (C) 2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _UNISTD_H +# error "Never include directly; use instead." +#endif diff --git a/posix/unistd.h b/posix/unistd.h index f67452122b..55a989f7bb 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -1166,6 +1166,9 @@ int getentropy (void *__buffer, size_t __length) __wur; # include #endif +/* System-specific extensions. */ +#include + __END_DECLS #endif /* unistd.h */ -- cgit 1.4.1