From patchwork Mon Jan 6 15:57:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108461-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="mxiHjulm"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="JmQGzMU5"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Ws4K44z9s29 for ; Tue, 7 Jan 2020 02:57:29 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=BNOx480nZahJaKrqyP03WP9tDk114d3 lzJXWEeJDPhEn+bw6Buosr4PEiaxcbGsJ31n6OWM2tjAWibtTbEME7b+Fr5hx0qx 5pQUf/TyesFpZyztPPdRT2kKWlxvWUAybqZtxxNn3hsL/8k3w7WulysPaxmoTaWr +uC3GMorHkPo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=sNRlV3z/9eEdpYbULgRHAhqsi2s=; b=mxiHj ulma4WI3opGk9eDAeKgKPjtAFhtT+SchPKVB68Az+bzxBJcUuLvvYtd2ZsB8drDC 15Rvif4lz06un0/wVCpXc674F2W5nChafDyDFcpLFuwFprK7tb23OUTKDqrl/yel 1293Vtv9Yhv3bHMMkhoHLNg8AAX3xpXRcabHUc= Received: (qmail 94023 invoked by alias); 6 Jan 2020 15:57:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 94005 invoked by uid 89); 6 Jan 2020 15:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=weimer, Weimer, Florian, florian X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com B698F1EA155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326237; bh=roAM21L7KMBxvrKVYDcBVKZuT0eCoakAKZV2K8hV/ow=; h=From:To:Date:Message-Id; b=JmQGzMU5MyAu7tjCOe6zP1itUb5DResGj99vUfIul9A6QXUy1pJfTrF7zrM3hh48C M8As5/kRQVQhZsOdnOzfBXy+r9JR+Viw88hvhIq5OrjiOmZF6uUxT6G7tqws0hYAw5 0B4DahPNnZLuV4Y6mzbL/rYZdgn1bc6d3OsHc/8ESMOqMHHBG5gwsGvB4kbwLC3Nxb sXlcO6VW/VSAe2gKp8SJ16TejQQ+3MdnsfalLrnAwMr4KUJDh21zZ1wgDxeMZol7z6 sl1owdcJ9TheHMRv9iQpe/ozHqbi7OYOR7u5YzAg58cWKxVWW9Bc9q/DJRTbKwjiVV UmK2wJMdKKprQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 01/13] Introduce Date: Mon, 6 Jan 2020 10:57:01 -0500 Message-Id: <20200106155713.397-2-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer MIPS needs to ignore certain existing symbols during symbol lookup. The old scheme uses the ELF_MACHINE_SYM_NO_MATCH macro, with an inline function, within its own header, with a sysdeps override for MIPS. This allows re-use of the function from another file (without having to include or providing the default definition for ELF_MACHINE_SYM_NO_MATCH). Built with build-many-glibcs.py, with manual verification that sysdeps/mips/elf_machine_sym_no_match.h is picked up on MIPS. Tested on aarch64-linux-gnu, i686-linux-gnu, powerpc64-linux-gnu, s390x-linux-gnu, x86_64-linux-gnu. * elf/elf_machine_sym_no_match.h: New file. * elf/dl-lookip.c (ELF_MACHINE_SYM_NO_MATCH): Do not define. * elf/dl-lookup.c (check_match) Call elf_machine_sym_no_match instead of ELF_MACHINE_SYM_NO_MATCH. * sysdeps/mips/dl-machine.h (ELF_MACHINE_SYM_NO_MATCH): Remove definition. * sysdeps/mips/elf_machine_sym_no_match.h: New file. Extracted from sysdeps/mips/dl-machine.h. --- elf/dl-lookup.c | 10 ++---- elf/elf_machine_sym_no_match.h | 34 +++++++++++++++++++ sysdeps/mips/dl-machine.h | 15 --------- sysdeps/mips/elf_machine_sym_no_match.h | 43 +++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 23 deletions(-) create mode 100644 elf/elf_machine_sym_no_match.h create mode 100644 sysdeps/mips/elf_machine_sym_no_match.h diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 759b45a2c9..55e521988e 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -28,18 +28,12 @@ #include #include #include +#include #include -/* Return nonzero if check_match should consider SYM to fail to match a - symbol reference for some machine-specific reason. */ -#ifndef ELF_MACHINE_SYM_NO_MATCH -# define ELF_MACHINE_SYM_NO_MATCH(sym) 0 -#endif - #define VERSTAG(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (tag)) - struct sym_val { const ElfW(Sym) *s; @@ -78,7 +72,7 @@ check_match (const char *const undef_name, if (__glibc_unlikely ((sym->st_value == 0 /* No value. */ && sym->st_shndx != SHN_ABS && stt != STT_TLS) - || ELF_MACHINE_SYM_NO_MATCH (sym) + || elf_machine_sym_no_match (sym) || (type_class & (sym->st_shndx == SHN_UNDEF)))) return NULL; diff --git a/elf/elf_machine_sym_no_match.h b/elf/elf_machine_sym_no_match.h new file mode 100644 index 0000000000..6e299e5ee8 --- /dev/null +++ b/elf/elf_machine_sym_no_match.h @@ -0,0 +1,34 @@ +/* Function to ignore certain symbol matches for machine-specific reasons. + 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 _ELF_MACHINE_SYM_NO_MATCH_H +#define _ELF_MACHINE_SYM_NO_MATCH_H + +#include +#include + +/* This can be customized to ignore certain symbols during lookup in + case there are machine-specific rules to disregard some + symbols. */ +static inline bool +elf_machine_sym_no_match (const ElfW(Sym) *sym) +{ + return false; +} + +#endif /* _ELF_MACHINE_SYM_NO_MATCH_H */ diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index c036c7a905..b238ab6476 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -467,21 +467,6 @@ elf_machine_plt_value (struct link_map *map, const ElfW(Rel) *reloc, return value; } -/* The semantics of zero/non-zero values of undefined symbols differs - depending on whether the non-PIC ABI is in use. Under the non-PIC - ABI, a non-zero value indicates that there is an address reference - to the symbol and thus it must always be resolved (except when - resolving a jump slot relocation) to the PLT entry whose address is - provided as the symbol's value; a zero value indicates that this - canonical-address behaviour is not required. Yet under the classic - MIPS psABI, a zero value indicates that there is an address - reference to the function and the dynamic linker must resolve the - symbol immediately upon loading. To avoid conflict, symbols for - which the dynamic linker must assume the non-PIC ABI semantics are - marked with the STO_MIPS_PLT flag. */ -#define ELF_MACHINE_SYM_NO_MATCH(sym) \ - ((sym)->st_shndx == SHN_UNDEF && !((sym)->st_other & STO_MIPS_PLT)) - #endif /* !dl_machine_h */ #ifdef RESOLVE_MAP diff --git a/sysdeps/mips/elf_machine_sym_no_match.h b/sysdeps/mips/elf_machine_sym_no_match.h new file mode 100644 index 0000000000..f2be74caaf --- /dev/null +++ b/sysdeps/mips/elf_machine_sym_no_match.h @@ -0,0 +1,43 @@ +/* MIPS-specific handling of undefined symbols. + Copyright (C) 2008-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 _ELF_MACHINE_SYM_NO_MATCH_H +#define _ELF_MACHINE_SYM_NO_MATCH_H + +#include +#include + +/* The semantics of zero/non-zero values of undefined symbols differs + depending on whether the non-PIC ABI is in use. Under the non-PIC + ABI, a non-zero value indicates that there is an address reference + to the symbol and thus it must always be resolved (except when + resolving a jump slot relocation) to the PLT entry whose address is + provided as the symbol's value; a zero value indicates that this + canonical-address behaviour is not required. Yet under the classic + MIPS psABI, a zero value indicates that there is an address + reference to the function and the dynamic linker must resolve the + symbol immediately upon loading. To avoid conflict, symbols for + which the dynamic linker must assume the non-PIC ABI semantics are + marked with the STO_MIPS_PLT flag. */ +static inline bool +elf_machine_sym_no_match (const ElfW(Sym) *sym) +{ + return sym->st_shndx == SHN_UNDEF && !(sym->st_other & STO_MIPS_PLT); +} + +#endif /* _ELF_MACHINE_SYM_NO_MATCH_H */ From patchwork Mon Jan 6 15:57:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108464-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="fgxQgC7t"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="eaNk7D0M"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0XR6hyMz9s29 for ; Tue, 7 Jan 2020 02:57:59 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Z9vepxwr+lWvNw6Nxp4hLJdpMWe/LYR wqgqVIdywIqxm7q04jVuXZu5Trke0hO6jOaIwpor8aWcQ5dZtPbrrCqfglXPCoW8 C3kq9Rrt4pzc3/eHCmskQOzdY80uTST/sVPT1MnF+5DWIzzDBSEG5V+03M3W/cer uyP6SrHDqNOs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=6N/oQt2BVwoxKH2jd57svlHcoOk=; b=fgxQg C7tLcU4dpX1lozlgnRQSMTRutB/jVrabKmHvUpJ5nFZuWFZPTUuxIs1fEF31AoYG LNE8GjmSeISK5vPPWTBWQE8cMeGvPm/j+u5VDTONpDWKCoTMl9CccOjQ58MKsYoj KLoIEKdVM67plgeTF3I6RhRUJtTqPGeOMbYsUk= Received: (qmail 94501 invoked by alias); 6 Jan 2020 15:57:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 94403 invoked by uid 89); 6 Jan 2020 15:57:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=weimer, Weimer, Florian, florian X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com DDD581EA162 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326237; bh=nnmHahLQlyN6wUReFshx8SaH+IAbEgQadZIccC9yug4=; h=From:To:Date:Message-Id; b=eaNk7D0MxT0BdkVKqW75KyLa+VMMOb9UVOvoQTGlDBFWwo1LXsg6XCog8UXpsDlBe 1eOutgh8trrKNNbGYnOAOa776UuM+mA3W3zA+WKq9ivxeqQOZ9uK35ValmOOLNFTXl /1oslS3T4WbEG4nnk3aNPiH9uXWcT2YxT54S3ClNpwToQ2LlA+fm8DNDsc+MguTzyj jc6z/qcAdmtPuPaEtkMugkYdnlsf4F4UjiYIrC4tyGmlrW78r/WkB65UPb6/APGlOz qPhTxNve//NBQYCpDbTiIKwUn3y5BZxP/CacdilLtr78HATvUiT3uXIndtiVYB9Ppc cmGbSr+GA7UWw== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 02/13] Implement __libc_early_init Date: Mon, 6 Jan 2020 10:57:02 -0500 Message-Id: <20200106155713.397-3-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer This function is defined in libc.so, and the dynamic loader calls right after relocation has been finished, before any ELF constructors or the preinit function is invoked. It is also used in the static build for initializing parts of the static libc. To locate __libc_early_init, a direct symbol lookup function is used, _dl_lookup_direct. It does not search the entire symbol scope and consults merely a single link map. This function could also be used to implement lookups in the vDSO (as an optimization). A per-namespace variable (libc_map) is added for locating libc.so, to avoid repeated traversals of the search scope. It is similar to GL(dl_initfirst). An alternative would have been to thread a context argument from _dl_open down to _dl_map_object_from_fd (where libc.so is identified). This could have avoided the global variable, but the change would be larger as a result. It would not have been possible to use this to replace GL(dl_initfirst) because that global variable is used to pass the function pointer past the stack switch from dl_main to the main program. Replacing that requires adding a new argument to _dl_init, which in turn needs changes to the architecture-specific libc.so startup code written in assembler. __libc_early_init should not be used to replace _dl_var_init (as it exists today on some architectures). Instead, _dl_lookup_direct should be used to look up a new variable symbol in libc.so, and that should then be initialized from the dynamic loader, immediately after the object has been loaded in _dl_map_object_from_fd (before relocation is run). This way, more IFUNC resolvers which depend on these variables will work. This version was tested on x86_64-linux-gnu. * csu/init-first.c (_init): Remove call to __ctype_init. Moved to __libc_early_init. * csu/libc-start.c [!SHARED] (LIBC_START_MAIN): Call __libc_early_init. * elf/Makefile (routines): Add libc_early_init. (dl-routines): Add dl-call-libc-early-init. * elf/Versions (libc): Export __libc_early_init under GLIBC_PRIVATE. * elf/dl-call-libc-early-init.c: New file. * elf/dl-load.c (_dl_map_object_from_fd): Record in the namespace description if libc.so has been loaded. * elf/dl-lookup-direct.c: New file. Extracted from elf/dl-lookup.c. * elf/dl-open.c (struct dl_open_args): Add libc_already_loaded. (dl_open_worker): Set libc_already_loaded. Call _dl_call_libc_early_init if libc.so has been loaded. (_dl_open): Initialize libc_already_loaded. Reset libc_map on failure if necessary. * elf/libc-early-init.h: New file. * elf/libc_early_init.c: Likewise. * elf/rtld.c (dl_main): Call _dl_call_libc_early_init. * sysdeps/generic/ldsodefs.h (struct rtld_global): Add libc_map member to the namespace description. (_dl_lookup_direct): Declare. * sysdeps/mach/hurd/i386/init-first.c (posixland_init): Do not call __ctype_init. --- csu/init-first.c | 4 - csu/libc-start.c | 5 ++ elf/Makefile | 5 +- elf/Versions | 1 + elf/dl-call-libc-early-init.c | 41 ++++++++++ elf/dl-load.c | 9 +++ elf/dl-lookup-direct.c | 116 ++++++++++++++++++++++++++++ elf/dl-open.c | 24 ++++++ elf/libc-early-init.h | 35 +++++++++ elf/libc_early_init.c | 27 +++++++ elf/rtld.c | 4 + sysdeps/generic/ldsodefs.h | 17 ++++ sysdeps/mach/hurd/i386/init-first.c | 4 - 13 files changed, 282 insertions(+), 10 deletions(-) create mode 100644 elf/dl-call-libc-early-init.c create mode 100644 elf/dl-lookup-direct.c create mode 100644 elf/libc-early-init.h create mode 100644 elf/libc_early_init.c diff --git a/csu/init-first.c b/csu/init-first.c index e0f489ee6d..8caec305b7 100644 --- a/csu/init-first.c +++ b/csu/init-first.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include #include #include #include @@ -80,9 +79,6 @@ _init (int argc, char **argv, char **envp) __init_misc (argc, argv, envp); - /* Initialize ctype data. */ - __ctype_init (); - #if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS __libc_global_ctors (); #endif diff --git a/csu/libc-start.c b/csu/libc-start.c index e9e8e44fe5..b2d83a503a 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -238,6 +239,10 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), __cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL); #ifndef SHARED + /* Perform early initialization. In the shared case, this function + is called from the dynamic loader as early as possible. */ + __libc_early_init (); + /* Call the initializer of the libc. This is only needed here if we are compiling for the static library in which case we haven't run the constructors in `_dl_start_user'. */ diff --git a/elf/Makefile b/elf/Makefile index 72a5aa88b1..5d4fbb639f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -25,7 +25,7 @@ headers = elf.h bits/elfclass.h link.h bits/link.h routines = $(all-dl-routines) dl-support dl-iteratephdr \ dl-addr dl-addr-obj enbl-secure dl-profstub \ dl-origin dl-libc dl-sym dl-sysdep dl-error \ - dl-reloc-static-pie + dl-reloc-static-pie libc_early_init # The core dynamic linking functions are in libc for the static and # profiled libraries. @@ -33,7 +33,8 @@ dl-routines = $(addprefix dl-,load lookup object reloc deps hwcaps \ runtime init fini debug misc \ version profile tls origin scope \ execstack open close trampoline \ - exception sort-maps) + exception sort-maps lookup-direct \ + call-libc-early-init) ifeq (yes,$(use-ldconfig)) dl-routines += dl-cache endif diff --git a/elf/Versions b/elf/Versions index 3b09901f6c..f26d2817c3 100644 --- a/elf/Versions +++ b/elf/Versions @@ -26,6 +26,7 @@ libc { _dl_open_hook; _dl_open_hook2; _dl_sym; _dl_vsym; __libc_dlclose; __libc_dlopen_mode; __libc_dlsym; __libc_dlvsym; + __libc_early_init; # Internal error handling support. Interposes the functions in ld.so. _dl_signal_exception; _dl_catch_exception; diff --git a/elf/dl-call-libc-early-init.c b/elf/dl-call-libc-early-init.c new file mode 100644 index 0000000000..6c3ac5bfe7 --- /dev/null +++ b/elf/dl-call-libc-early-init.c @@ -0,0 +1,41 @@ +/* Invoke the early initialization function in libc.so. + 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 + . */ + +#include +#include +#include +#include +#include + +void +_dl_call_libc_early_init (struct link_map *libc_map) +{ + /* There is nothing to do if we did not actually load libc.so. */ + if (libc_map == NULL) + return; + + const ElfW(Sym) *sym + = _dl_lookup_direct (libc_map, "__libc_early_init", + 0x69682ac, /* dl_new_hash output. */ + "GLIBC_PRIVATE", + 0x0963cf85); /* _dl_elf_hash output. */ + assert (sym != NULL); + __typeof (__libc_early_init) *early_init + = DL_SYMBOL_ADDRESS (libc_map, sym); + early_init (); +} diff --git a/elf/dl-load.c b/elf/dl-load.c index 6cdd11e6b0..dcaa5a8a53 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -30,6 +30,7 @@ #include #include #include +#include /* Type for the buffer we put the ELF header and hopefully the program header. This buffer does not really have to be too large. In most @@ -1374,6 +1375,14 @@ cannot enable executable stack as shared object requires"); add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB]) + l->l_info[DT_SONAME]->d_un.d_val)); + /* If we have newly loaded libc.so, update the namespace + description. */ + if (GL(dl_ns)[nsid].libc_map == NULL + && l->l_info[DT_SONAME] != NULL + && strcmp (((const char *) D_PTR (l, l_info[DT_STRTAB]) + + l->l_info[DT_SONAME]->d_un.d_val), LIBC_SO) == 0) + GL(dl_ns)[nsid].libc_map = l; + /* _dl_close can only eventually undo the module ID assignment (via remove_slotinfo) if this function returns a pointer to a link map. Therefore, delay this step until all possibilities for diff --git a/elf/dl-lookup-direct.c b/elf/dl-lookup-direct.c new file mode 100644 index 0000000000..190b826e1e --- /dev/null +++ b/elf/dl-lookup-direct.c @@ -0,0 +1,116 @@ +/* Look up a symbol in a single specified object. + Copyright (C) 1995-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 + . */ + +#include +#include +#include +#include + +/* This function corresponds to do_lookup_x in elf/dl-lookup.c. The + variant here is simplified because it requires symbol + versioning. */ +static const ElfW(Sym) * +check_match (const struct link_map *const map, const char *const undef_name, + const char *version, uint32_t version_hash, + const Elf_Symndx symidx) +{ + const ElfW(Sym) *symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]); + const ElfW(Sym) *sym = &symtab[symidx]; + + unsigned int stt = ELFW(ST_TYPE) (sym->st_info); + if (__glibc_unlikely ((sym->st_value == 0 /* No value. */ + && sym->st_shndx != SHN_ABS + && stt != STT_TLS) + || elf_machine_sym_no_match (sym))) + return NULL; + + /* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC, + STT_COMMON, STT_TLS, and STT_GNU_IFUNC since these are no + code/data definitions. */ +#define ALLOWED_STT \ + ((1 << STT_NOTYPE) | (1 << STT_OBJECT) | (1 << STT_FUNC) \ + | (1 << STT_COMMON) | (1 << STT_TLS) | (1 << STT_GNU_IFUNC)) + if (__glibc_unlikely (((1 << stt) & ALLOWED_STT) == 0)) + return NULL; + + const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); + + if (strcmp (strtab + sym->st_name, undef_name) != 0) + /* Not the symbol we are looking for. */ + return NULL; + + ElfW(Half) ndx = map->l_versyms[symidx] & 0x7fff; + if (map->l_versions[ndx].hash != version_hash + || strcmp (map->l_versions[ndx].name, version) != 0) + /* It's not the version we want. */ + return NULL; + + return sym; +} + + +/* This function corresponds to do_lookup_x in elf/dl-lookup.c. The + variant here is simplified because it does not search object + dependencies. It is optimized for a successful lookup. */ +const ElfW(Sym) * +_dl_lookup_direct (struct link_map *map, + const char *undef_name, uint32_t new_hash, + const char *version, uint32_t version_hash) +{ + const ElfW(Addr) *bitmask = map->l_gnu_bitmask; + if (__glibc_likely (bitmask != NULL)) + { + Elf32_Word bucket = map->l_gnu_buckets[new_hash % map->l_nbuckets]; + if (bucket != 0) + { + const Elf32_Word *hasharr = &map->l_gnu_chain_zero[bucket]; + + do + if (((*hasharr ^ new_hash) >> 1) == 0) + { + Elf_Symndx symidx = ELF_MACHINE_HASH_SYMIDX (map, hasharr); + const ElfW(Sym) *sym = check_match (map, undef_name, + version, version_hash, + symidx); + if (sym != NULL) + return sym; + } + while ((*hasharr++ & 1u) == 0); + } + } + else + { + /* Fallback code for lack of GNU_HASH support. */ + uint32_t old_hash = _dl_elf_hash (undef_name); + + /* Use the old SysV-style hash table. Search the appropriate + hash bucket in this object's symbol table for a definition + for the same symbol name. */ + for (Elf_Symndx symidx = map->l_buckets[old_hash % map->l_nbuckets]; + symidx != STN_UNDEF; + symidx = map->l_chain[symidx]) + { + const ElfW(Sym) *sym = check_match (map, undef_name, + version, version_hash, symidx); + if (sym != NULL) + return sym; + } + } + + return NULL; +} diff --git a/elf/dl-open.c b/elf/dl-open.c index 5a1c5b5326..df920543d7 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,13 @@ struct dl_open_args (non-negative). */ unsigned int original_global_scope_pending_adds; + /* Set to true if libc.so was already loaded into the namespace at + the time dl_open_worker was called. This is used to determine + whether libc.so early initialization needs to before, and whether + to roll back the cached libc_map value in the namespace in case + of a dlopen failure. */ + bool libc_already_loaded; + /* Original parameters to the program and the current environment. */ int argc; char **argv; @@ -500,6 +508,11 @@ dl_open_worker (void *a) args->nsid = call_map->l_ns; } + /* The namespace ID is now known. Keep track of whether libc.so was + already loaded, to determine whether it is necessary to call the + early initialization routine (or clear libc_map on error). */ + args->libc_already_loaded = GL(dl_ns)[args->nsid].libc_map != NULL; + /* Retain the old value, so that it can be restored. */ args->original_global_scope_pending_adds = GL (dl_ns)[args->nsid]._ns_global_scope_pending_adds; @@ -735,6 +748,11 @@ dl_open_worker (void *a) if (relocation_in_progress) LIBC_PROBE (reloc_complete, 3, args->nsid, r, new); + /* If libc.so was not there before, attempt to call its early + initialization routine. */ + if (!args->libc_already_loaded) + _dl_call_libc_early_init (GL(dl_ns)[args->nsid].libc_map); + #ifndef SHARED DL_STATIC_INIT (new); #endif @@ -829,6 +847,7 @@ no more namespaces available for dlmopen()")); args.caller_dlopen = caller_dlopen; args.map = NULL; args.nsid = nsid; + args.libc_already_loaded = true; /* No reset below with early failure. */ args.argc = argc; args.argv = argv; args.env = env; @@ -857,6 +876,11 @@ no more namespaces available for dlmopen()")); /* See if an error occurred during loading. */ if (__glibc_unlikely (exception.errstring != NULL)) { + /* Avoid keeping around a dangling reference to the libc.so link + map in case it has been cached in libc_map. */ + if (!args.libc_already_loaded) + GL(dl_ns)[nsid].libc_map = NULL; + /* Remove the object from memory. It may be in an inconsistent state if relocation failed, for example. */ if (args.map) diff --git a/elf/libc-early-init.h b/elf/libc-early-init.h new file mode 100644 index 0000000000..02b855754e --- /dev/null +++ b/elf/libc-early-init.h @@ -0,0 +1,35 @@ +/* Early initialization of libc.so. + 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 _LIBC_EARLY_INIT_H +#define _LIBC_EARLY_INIT_H + +struct link_map; + +/* If LIBC_MAP is not NULL, look up the __libc_early_init symbol in it + and call this function. */ +void _dl_call_libc_early_init (struct link_map *libc_map) attribute_hidden; + +/* In the shared case, this function is defined in libc.so and invoked + from ld.so (or on the fist static dlopen) after complete relocation + of a new loaded libc.so, but before user-defined ELF constructors + run. In the static case, this function is called directly from the + startup code. */ +void __libc_early_init (void); + +#endif /* _LIBC_EARLY_INIT_H */ diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c new file mode 100644 index 0000000000..1ac66d895d --- /dev/null +++ b/elf/libc_early_init.c @@ -0,0 +1,27 @@ +/* Early initialization of libc.so, libc.so side. + 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 + . */ + +#include +#include + +void +__libc_early_init (void) +{ + /* Initialize ctype data. */ + __ctype_init (); +} diff --git a/elf/rtld.c b/elf/rtld.c index dd8fc5e6c6..8c27c62aa0 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -2315,6 +2316,9 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]); rtld_timer_accum (&relocate_time, start); } + /* Relocation is complete. Perform early libc initialization. */ + _dl_call_libc_early_init (GL(dl_ns)[LM_ID_BASE].libc_map); + /* Do any necessary cleanups for the startup OS interface code. We do these now so that no calls are made after rtld re-relocation which might be resolved to different functions than we expect. diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index fc25a81e1c..f767baea83 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -336,6 +336,10 @@ struct rtld_global recursive dlopen calls from ELF constructors. */ unsigned int _ns_global_scope_pending_adds; + /* Once libc.so has been loaded into the namespace, this points to + its link map. */ + struct link_map *libc_map; + /* Search table for unique objects. */ struct unique_sym_table { @@ -940,6 +944,19 @@ extern lookup_t _dl_lookup_symbol_x (const char *undef, attribute_hidden; +/* Restricted version of _dl_lookup_symbol_x. Searches MAP (and only + MAP) for the symbol UNDEF_NAME, with GNU hash NEW_HASH (computed + with dl_new_hash), symbol version VERSION, and symbol version hash + VERSION_HASH (computed with _dl_elf_hash). Returns a pointer to + the symbol table entry in MAP on success, or NULL on failure. MAP + must have symbol versioning information, or otherwise the result is + undefined. */ +const ElfW(Sym) *_dl_lookup_direct (struct link_map *map, + const char *undef_name, + uint32_t new_hash, + const char *version, + uint32_t version_hash) attribute_hidden; + /* Add the new link_map NEW to the end of the namespace list. */ extern void _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid) attribute_hidden; diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index 5c21ebb958..6c18e83195 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/i386/init-first.c @@ -17,7 +17,6 @@ . */ #include -#include #include #include #include @@ -85,9 +84,6 @@ posixland_init (int argc, char **argv, char **envp) #endif __init_misc (argc, argv, envp); - /* Initialize ctype data. */ - __ctype_init (); - #if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS __libc_global_ctors (); #endif From patchwork Mon Jan 6 15:57:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108463-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ZbB3NPt/"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="VdaRCGF9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0XG0mNVz9s29 for ; Tue, 7 Jan 2020 02:57:49 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=slp2rBN1+k6dsPNaBachvSmHDudjK7w FRF16kfVUqSQDrCFtkioxABvWo1ofZO4NN0BtUBG8I0BvMcktXxez1o8qogQ4YbU U2ATBUjSwYv4GWoUQL1KlyZCtmyJ+2tajJc1QMJB/OIm7m5pZD3iNgbTMPo4Q4tC 681hQKsjwjL0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=nQJ9vVqa+sOkN1ROgv+hzmxQcIc=; b=ZbB3N Pt/alcD0dj7h5uEGWZOS18uijiABejyeiPc95nBaCh/WM2LnM5W9p4LXBHXwzpD9 V9z57Z66qxflNWuvuEyJOojkFyXDKctAaSkbl/rkAh+tipNkBQVOKQOBz6LUz7l3 TwlLQXix/LD3IJe32z7+ghtvlIlIxbz7tcQBb8= Received: (qmail 94432 invoked by alias); 6 Jan 2020 15:57:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 94354 invoked by uid 89); 6 Jan 2020 15:57:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=NOTES, Local, cancel, formerly X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 427E51EA17C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326238; bh=BJ5M7IBGK9K+rzpolsPdt5cqMU4qJ74RY3HSNcYtXI0=; h=From:To:Date:Message-Id; b=VdaRCGF94Wj0H3+xk8AqMfzFpYOM5uf6x/8sptyRpb8ajsDN2E7AsCzP3rDLHPTXQ g+Uzd1R/SQZlPQz82Oma6uscCzpsInETS4B+RKFgdfPz5YaD1rtbL8R1vXdfsyoxpM 0S4YycK54ZeiBG+RB5sutieTLYZFi9F++LN4TL+fLpXWafYIvD6KE8JsKj8hnRKkA2 oVoed145D7773jib2HKR/5GdvRFvDi7nY7w89elkRv+6ojLd1NdP+B+v3HmvS0Rxjh /YO8SFbQ//zexTeyE0fvz1dcuTH5Bp2ZhXrsYl9BL0lUHVmGWBBh2mo3D9pG5HLXdl MdekVoJwOtJVQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 03/13] nptl: Start new threads with all signals blocked [BZ #25098] Date: Mon, 6 Jan 2020 10:57:03 -0500 Message-Id: <20200106155713.397-4-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer New threads inherit the signal mask from the current thread. This means that signal handlers can run on the newly created thread immediately after the kernel has created the userspace thread, even before glibc has initialized the TCB. Consequently, new threads can observe uninitialized ctype data, among other things. To address this, block all signals before starting the thread, and pass the original signal mask to the start routine wrapper. On the new thread, first perform all thread initialization, and then unblock signals. The cost of doing this is two rt_sigprocmask system calls on the old thread, and one rt_sigprocmask system call on the new thread. (If there was a way to clone a new thread with a signals disabled, this could be brought down to one system call each.) The thread descriptor increases in size, too, and sigset_t is fairly large. This increase could be brought down by reusing space the in the descriptor which is not needed before running user code, or by switching to an internal sigset_t definition which only covers the signals supported by the kernel definition. (Part of the thread descriptor size increase is already offset by reduced stack usage in the thread start wrapper routine after this commit.) ----- nptl/descr.h | 10 +++++++--- nptl/pthread_create.c | 47 +++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 25 deletions(-) --- nptl/descr.h | 10 ++++++--- nptl/pthread_create.c | 47 +++++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/nptl/descr.h b/nptl/descr.h index d3f863aa18..70d76bc63b 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -332,9 +332,8 @@ struct pthread /* True if thread must stop at startup time. */ bool stopped_start; - /* The parent's cancel handling at the time of the pthread_create - call. This might be needed to undo the effects of a cancellation. */ - int parent_cancelhandling; + /* Formerly used for dealing with cancellation. */ + int parent_cancelhandling_unsed; /* Lock to synchronize access to the descriptor. */ int lock; @@ -391,6 +390,11 @@ struct pthread /* Resolver state. */ struct __res_state res; + /* Signal mask for the new thread. Used during thread startup to + restore the signal mask. (Threads are launched with all signals + masked.) */ + sigset_t sigmask; + /* Indicates whether is a C11 thread created by thrd_creat. */ bool c11; diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 5682c9c2c0..b220ec526b 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -369,7 +369,6 @@ __free_tcb (struct pthread *pd) } } - /* Local function to start thread and handle cleanup. createthread.c defines the macro START_THREAD_DEFN to the declaration that its create_thread function will refer to, and @@ -385,10 +384,6 @@ START_THREAD_DEFN /* Initialize pointers to locale data. */ __ctype_init (); - /* Allow setxid from now onwards. */ - if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2)) - futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE); - #ifdef __NR_set_robust_list # ifndef __ASSUME_SET_ROBUST_LIST if (__set_robust_list_avail >= 0) @@ -402,19 +397,6 @@ START_THREAD_DEFN } #endif - /* If the parent was running cancellation handlers while creating - the thread the new thread inherited the signal mask. Reset the - cancellation signal mask. */ - if (__glibc_unlikely (pd->parent_cancelhandling & CANCELING_BITMASK)) - { - INTERNAL_SYSCALL_DECL (err); - sigset_t mask; - __sigemptyset (&mask); - __sigaddset (&mask, SIGCANCEL); - (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &mask, - NULL, _NSIG / 8); - } - /* This is where the try/finally block should be created. For compilers without that support we do use setjmp. */ struct pthread_unwind_buf unwind_buf; @@ -436,6 +418,12 @@ START_THREAD_DEFN unwind_buf.priv.data.prev = NULL; unwind_buf.priv.data.cleanup = NULL; + __libc_signal_restore_set (&pd->sigmask); + + /* Allow setxid from now onwards. */ + if (__glibc_unlikely (atomic_exchange_acq (&pd->setxid_futex, 0) == -2)) + futex_wake (&pd->setxid_futex, 1, FUTEX_PRIVATE); + if (__glibc_likely (! not_first_call)) { /* Store the new cleanup handler info. */ @@ -726,10 +714,6 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, CHECK_THREAD_SYSINFO (pd); #endif - /* Inform start_thread (above) about cancellation state that might - translate into inherited signal state. */ - pd->parent_cancelhandling = THREAD_GETMEM (THREAD_SELF, cancelhandling); - /* Determine scheduling parameters for the thread. */ if (__builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0) && (iattr->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)) != 0) @@ -775,6 +759,21 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, ownership of PD (see CONCURRENCY NOTES above). */ bool stopped_start = false; bool thread_ran = false; + /* Block all signals, so that the new thread starts out with + signals disabled. This avoids race conditions in the thread + startup. */ + sigset_t original_sigmask; + __libc_signal_block_all (&original_sigmask); + + /* Conceptually, the new thread needs to inherit the signal mask of + this thread. Therefore, it needs to restore the saved signal + mask of this thread, so save it in the startup information. */ + pd->sigmask = original_sigmask; + + /* Reset the cancellation signal mask in case this thread is running + cancellation. */ + __sigdelset (&pd->sigmask, SIGCANCEL); + /* Start the thread. */ if (__glibc_unlikely (report_thread_creation (pd))) { @@ -817,6 +816,10 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, retval = create_thread (pd, iattr, &stopped_start, STACK_VARIABLES_ARGS, &thread_ran); + /* Return to the previous signal mask, after creating the new + thread. */ + __libc_signal_restore_set (&original_sigmask); + if (__glibc_unlikely (retval != 0)) { if (thread_ran) From patchwork Mon Jan 6 15:57:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108475-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="VCPSWTZB"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="arqkAo5l"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0lq6WxZz9sQp for ; Tue, 7 Jan 2020 03:07:51 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=uqpUszlyBAd2R3mNuhvJo1l5FPMYerm46feWJPbGzkW FSp6ww7l7eRdaXXA4r7wHJuZotca1Lg29DV1Ap7oaJ7ONPt60nGEkQWk3Gr3/vL5 ogNO5ZsFNaM1hcGcUO7uBs0Y2LW0J7rdpGj+ojFvaMLoIXJLeqVV5ZpGe0uCQZ/4 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=hz7+r85r17fsfOJynZCHrBkXmMI=; b=VCPSWTZBrKKDzr7/8 tDAXc3NyWT5fYVVAlYXZFytU4A55CXbT3Fihku7cVBs9CaPZU9YGxVD0T99bIXPG ABdBrbuw5QQVGT/pHVXTLtZPrqK8nSSlRqzj0yQEP1G2a6tLvefuPZS9P3gpjwwE faJcZXhRhFAc+/fmGElGPLnzKQ= Received: (qmail 18306 invoked by alias); 6 Jan 2020 16:07:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 18289 invoked by uid 89); 6 Jan 2020 16:07:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS, WEIRD_QUOTING autolearn=ham version=3.3.1 spammy=4268, 5236, formatted, 6280 X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com C54AE1EA19C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326240; bh=nR5umDFAE2iF10xylB+ISCQN79kw+PZSpeC86UKHarg=; h=From:To:Date:Message-Id:MIME-Version; b=arqkAo5lK+YICu5uNrY8EIiecsfRz8VcsjZ1pjjoz1qtDGprdFGuh26vD2RqNwcx/ C+qXULV4QV95eUDGWvILSweBtKACkkyHtHex4UF2Qt2Q8mBWDAFerAFmlw1MRVIcYB 5UvlVUMmJhYkxUN/pi6Htm+IubzAFsFUEIjMH/vi5JZHAq9K6EbtjJtAvfse/QWhpy i0rwzxhtzIUSiIAE1R5ikaI25+5Tv4JK2eCO9P3BQ67Rz8AgnC7IyURREcpjZ0RvYL c3EKayernjsAEcCWNjDqyXqS86iuqAyiOqlAkm8PC6Pq6e3dpV1D8Fj3cTDMISt0GA 31yOxKdubQKJQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 04/13] Linux: Add tables with system call numbers Date: Mon, 6 Jan 2020 10:57:04 -0500 Message-Id: <20200106155713.397-5-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 From: Florian Weimer The new tables are currently only used for consistency checks with the installed kernel headers and the architecture-independent system call names table. They are based on Linux 5.4. The goal is to use these architecture-specific tables to ensure that system call wrappers are available irrespective of the version of the installed kernel headers. The tables are formatted in the form of C header files so that they can be used directly in an #include directive, without external preprocessing. (External preprocessing of a plain table file would introduce cross-subdirectory dependency issues.) However, the intent is that they can still be treated as tables and can be processed by simple tools. The irregular system call names on 32-bit arm add a complication. The header is introduced to work around that, and the system calls are listed under regular names in the file. A make target, update-syscalls-list, is added to patch the glibc sources with data from the current kernel headers. --- sysdeps/unix/sysv/linux/Makefile | 73 ++- .../unix/sysv/linux/aarch64/arch-syscall.h | 290 +++++++++++ sysdeps/unix/sysv/linux/alpha/arch-syscall.h | 468 ++++++++++++++++++ sysdeps/unix/sysv/linux/arm/arch-syscall.h | 392 +++++++++++++++ .../unix/sysv/linux/arm/fixup-asm-unistd.h | 24 + sysdeps/unix/sysv/linux/csky/arch-syscall.h | 309 ++++++++++++ sysdeps/unix/sysv/linux/fixup-asm-unistd.h | 28 ++ sysdeps/unix/sysv/linux/glibcsyscalls.py | 165 ++++++ sysdeps/unix/sysv/linux/hppa/arch-syscall.h | 371 ++++++++++++++ sysdeps/unix/sysv/linux/i386/arch-syscall.h | 425 ++++++++++++++++ sysdeps/unix/sysv/linux/ia64/arch-syscall.h | 340 +++++++++++++ sysdeps/unix/sysv/linux/m68k/arch-syscall.h | 407 +++++++++++++++ .../unix/sysv/linux/microblaze/arch-syscall.h | 429 ++++++++++++++++ .../sysv/linux/mips/mips32/arch-syscall.h | 402 +++++++++++++++ .../sysv/linux/mips/mips64/n32/arch-syscall.h | 362 ++++++++++++++ .../sysv/linux/mips/mips64/n64/arch-syscall.h | 338 +++++++++++++ sysdeps/unix/sysv/linux/nios2/arch-syscall.h | 311 ++++++++++++ .../linux/powerpc/powerpc32/arch-syscall.h | 417 ++++++++++++++++ .../linux/powerpc/powerpc64/arch-syscall.h | 389 +++++++++++++++ .../unix/sysv/linux/riscv/rv64/arch-syscall.h | 291 +++++++++++ .../sysv/linux/s390/s390-32/arch-syscall.h | 406 +++++++++++++++ .../sysv/linux/s390/s390-64/arch-syscall.h | 354 +++++++++++++ sysdeps/unix/sysv/linux/sh/arch-syscall.h | 400 +++++++++++++++ .../sysv/linux/sparc/sparc32/arch-syscall.h | 405 +++++++++++++++ .../sysv/linux/sparc/sparc64/arch-syscall.h | 368 ++++++++++++++ sysdeps/unix/sysv/linux/tst-glibcsyscalls.py | 88 ++++ sysdeps/unix/sysv/linux/tst-mman-consts.py | 12 +- .../unix/sysv/linux/update-syscall-lists.py | 66 +++ .../unix/sysv/linux/x86_64/64/arch-syscall.h | 347 +++++++++++++ .../unix/sysv/linux/x86_64/x32/arch-syscall.h | 336 +++++++++++++ 30 files changed, 8991 insertions(+), 22 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/aarch64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/alpha/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/arm/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h create mode 100644 sysdeps/unix/sysv/linux/csky/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/fixup-asm-unistd.h create mode 100644 sysdeps/unix/sysv/linux/glibcsyscalls.py create mode 100644 sysdeps/unix/sysv/linux/hppa/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/i386/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/ia64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/m68k/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/microblaze/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/nios2/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/sh/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/tst-glibcsyscalls.py create mode 100644 sysdeps/unix/sysv/linux/update-syscall-lists.py create mode 100644 sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 07776d28ea..502589c330 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -1,3 +1,41 @@ +# Option to pass to Python scripts to set the C compiler. Rewriting +# MODULE_NAME is required to enable the _ISOMAC verbatim header +# environment. +sysdeps-linux-python-cc = \ + --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" + +# Additional dependencies for Python scripts. +sysdeps-linux-python-deps = \ + $(..)sysdeps/unix/sysv/linux/glibcsyscalls.py \ + $(..)scripts/glibcextract.py + +# Invocation of the Python interpreter with the Python search path. +sysdeps-linux-python = \ + PYTHONPATH=$(..)scripts:$(..)sysdeps/unix/sysv/linux $(PYTHON) + +ifndef subdir +# This target performs two actions: +# +# Replace with a file generated from kernel headers +# and . Both files are located via the sysdeps +# override search path. +# +# Update sysdeps/unix/sysv/linux/syscall-names.list with additional +# names found in the generated file, so that the +# global system call names list is a superset of the +# architecture-specific system call names. +# +# To bootstrap a new architecture, create an empty file in the right +# place and run “make update-arch-syscall” from the top-level of a +# configured, but not-yet-built glibc tree. +.PHONY: update-syscall-lists +update-syscall-lists: arch-syscall.h + $(sysdeps-linux-python) \ + sysdeps/unix/sysv/linux/update-syscall-lists.py \ + $(sysdeps-linux-python-cc) $< \ + sysdeps/unix/sysv/linux/syscall-names.list +endif + ifeq ($(subdir),csu) sysdep_routines += errno-loc endif @@ -103,6 +141,19 @@ $(objpfx)tst-syscall-list.out: \ $(objpfx)tst-syscall-list-sys.list $(BASH) $^ $(AWK) > $@; $(evaluate-test) +tests-special += $(objpfx)tst-glibcsyscalls.out +# arch-syscall.h is located via the sysdeps override search path. +$(objpfx)tst-glibcsyscalls.out: arch-syscall.h \ + ../sysdeps/unix/sysv/linux/syscall-names.list + $(sysdeps-linux-python) \ + ../sysdeps/unix/sysv/linux/tst-glibcsyscalls.py \ + $(sysdeps-linux-python-cc) $< \ + ../sysdeps/unix/sysv/linux/syscall-names.list \ + < /dev/null > $@ 2>&1; $(evaluate-test) +$(objpfx)tst-glibcsyscalls.out: \ + ../sysdeps/unix/sysv/linux/tst-glibcsyscalls.py \ + $(sysdeps-linux-python-deps) + # Separate object file for access to the constant from the UAPI header. $(objpfx)tst-sysconf-iov_max: $(objpfx)tst-sysconf-iov_max-uapi.o @@ -110,12 +161,11 @@ $(objpfx)tst-pkey: $(shared-thread-library) tests-special += $(objpfx)tst-mman-consts.out $(objpfx)tst-mman-consts.out: ../sysdeps/unix/sysv/linux/tst-mman-consts.py - PYTHONPATH=../scripts \ - $(PYTHON) ../sysdeps/unix/sysv/linux/tst-mman-consts.py \ - --cc="$(CC) $(patsubst -DMODULE_NAME=%, \ - -DMODULE_NAME=testsuite, \ - $(CPPFLAGS))" \ - < /dev/null > $@ 2>&1; $(evaluate-test) + $(sysdeps-linux-python) \ + ../sysdeps/unix/sysv/linux/tst-mman-consts.py \ + $(sysdeps-linux-python-cc) \ + < /dev/null > $@ 2>&1; $(evaluate-test) +$(objpfx)tst-mman-consts.out: $(sysdeps-linux-python-deps) $(objpfx)tst-gettid: $(shared-thread-library) $(objpfx)tst-gettid-kill: $(shared-thread-library) @@ -138,12 +188,11 @@ tests-special += $(objpfx)tst-signal-numbers.out $(objpfx)tst-signal-numbers.out: \ ../sysdeps/unix/sysv/linux/tst-signal-numbers.py \ $(objpfx)signal.o* - PYTHONPATH=../scripts \ - $(PYTHON) ../sysdeps/unix/sysv/linux/tst-signal-numbers.py \ - --cc="$(CC) $(patsubst -DMODULE_NAME=%, \ - -DMODULE_NAME=testsuite, \ - $(CPPFLAGS))" \ - < /dev/null > $@ 2>&1; $(evaluate-test) + $(sysdeps-linux-python) \ + ../sysdeps/unix/sysv/linux/tst-signal-numbers.py \ + $(sysdeps-linux-python-cc) \ + < /dev/null > $@ 2>&1; $(evaluate-test) +$(objpfx)tst-signal-numbers.out: $(sysdeps-linux-python-deps) endif ifeq ($(subdir),socket) diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h new file mode 100644 index 0000000000..163f618499 --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/arch-syscall.h @@ -0,0 +1,290 @@ +#define __NR_accept 202 +#define __NR_accept4 242 +#define __NR_acct 89 +#define __NR_add_key 217 +#define __NR_adjtimex 171 +#define __NR_bind 200 +#define __NR_bpf 280 +#define __NR_brk 214 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_chdir 49 +#define __NR_chroot 51 +#define __NR_clock_adjtime 266 +#define __NR_clock_getres 114 +#define __NR_clock_gettime 113 +#define __NR_clock_nanosleep 115 +#define __NR_clock_settime 112 +#define __NR_clone 220 +#define __NR_close 57 +#define __NR_connect 203 +#define __NR_copy_file_range 285 +#define __NR_delete_module 106 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_eventfd2 19 +#define __NR_execve 221 +#define __NR_execveat 281 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_faccessat 48 +#define __NR_fadvise64 223 +#define __NR_fallocate 47 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_fchdir 50 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchown 55 +#define __NR_fchownat 54 +#define __NR_fcntl 25 +#define __NR_fdatasync 83 +#define __NR_fgetxattr 10 +#define __NR_finit_module 273 +#define __NR_flistxattr 13 +#define __NR_flock 32 +#define __NR_fremovexattr 16 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 7 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 80 +#define __NR_fstatfs 44 +#define __NR_fsync 82 +#define __NR_ftruncate 46 +#define __NR_futex 98 +#define __NR_get_mempolicy 236 +#define __NR_get_robust_list 100 +#define __NR_getcpu 168 +#define __NR_getcwd 17 +#define __NR_getdents64 61 +#define __NR_getegid 177 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getgroups 158 +#define __NR_getitimer 102 +#define __NR_getpeername 205 +#define __NR_getpgid 155 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getpriority 141 +#define __NR_getrandom 278 +#define __NR_getresgid 150 +#define __NR_getresuid 148 +#define __NR_getrlimit 163 +#define __NR_getrusage 165 +#define __NR_getsid 156 +#define __NR_getsockname 204 +#define __NR_getsockopt 209 +#define __NR_gettid 178 +#define __NR_gettimeofday 169 +#define __NR_getuid 174 +#define __NR_getxattr 8 +#define __NR_init_module 105 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_init1 26 +#define __NR_inotify_rm_watch 28 +#define __NR_io_cancel 3 +#define __NR_io_destroy 1 +#define __NR_io_getevents 4 +#define __NR_io_pgetevents 292 +#define __NR_io_setup 0 +#define __NR_io_submit 2 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 29 +#define __NR_ioprio_get 31 +#define __NR_ioprio_set 30 +#define __NR_kcmp 272 +#define __NR_kexec_file_load 294 +#define __NR_kexec_load 104 +#define __NR_keyctl 219 +#define __NR_kill 129 +#define __NR_lgetxattr 9 +#define __NR_linkat 37 +#define __NR_listen 201 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_lookup_dcookie 18 +#define __NR_lremovexattr 15 +#define __NR_lseek 62 +#define __NR_lsetxattr 6 +#define __NR_madvise 233 +#define __NR_mbind 235 +#define __NR_membarrier 283 +#define __NR_memfd_create 279 +#define __NR_migrate_pages 238 +#define __NR_mincore 232 +#define __NR_mkdirat 34 +#define __NR_mknodat 33 +#define __NR_mlock 228 +#define __NR_mlock2 284 +#define __NR_mlockall 230 +#define __NR_mmap 222 +#define __NR_mount 40 +#define __NR_move_mount 429 +#define __NR_move_pages 239 +#define __NR_mprotect 226 +#define __NR_mq_getsetattr 185 +#define __NR_mq_notify 184 +#define __NR_mq_open 180 +#define __NR_mq_timedreceive 183 +#define __NR_mq_timedsend 182 +#define __NR_mq_unlink 181 +#define __NR_mremap 216 +#define __NR_msgctl 187 +#define __NR_msgget 186 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_msync 227 +#define __NR_munlock 229 +#define __NR_munlockall 231 +#define __NR_munmap 215 +#define __NR_name_to_handle_at 264 +#define __NR_nanosleep 101 +#define __NR_newfstatat 79 +#define __NR_nfsservctl 42 +#define __NR_open_by_handle_at 265 +#define __NR_open_tree 428 +#define __NR_openat 56 +#define __NR_perf_event_open 241 +#define __NR_personality 92 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe2 59 +#define __NR_pivot_root 41 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_pkey_mprotect 288 +#define __NR_ppoll 73 +#define __NR_prctl 167 +#define __NR_pread64 67 +#define __NR_preadv 69 +#define __NR_preadv2 286 +#define __NR_prlimit64 261 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_pselect6 72 +#define __NR_ptrace 117 +#define __NR_pwrite64 68 +#define __NR_pwritev 70 +#define __NR_pwritev2 287 +#define __NR_quotactl 60 +#define __NR_read 63 +#define __NR_readahead 213 +#define __NR_readlinkat 78 +#define __NR_readv 65 +#define __NR_reboot 142 +#define __NR_recvfrom 207 +#define __NR_recvmmsg 243 +#define __NR_recvmsg 212 +#define __NR_remap_file_pages 234 +#define __NR_removexattr 14 +#define __NR_renameat 38 +#define __NR_renameat2 276 +#define __NR_request_key 218 +#define __NR_restart_syscall 128 +#define __NR_rseq 293 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_getaffinity 123 +#define __NR_sched_getattr 275 +#define __NR_sched_getparam 121 +#define __NR_sched_getscheduler 120 +#define __NR_sched_rr_get_interval 127 +#define __NR_sched_setaffinity 122 +#define __NR_sched_setattr 274 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_yield 124 +#define __NR_seccomp 277 +#define __NR_semctl 191 +#define __NR_semget 190 +#define __NR_semop 193 +#define __NR_semtimedop 192 +#define __NR_sendfile 71 +#define __NR_sendmmsg 269 +#define __NR_sendmsg 211 +#define __NR_sendto 206 +#define __NR_set_mempolicy 237 +#define __NR_set_robust_list 99 +#define __NR_set_tid_address 96 +#define __NR_setdomainname 162 +#define __NR_setfsgid 152 +#define __NR_setfsuid 151 +#define __NR_setgid 144 +#define __NR_setgroups 159 +#define __NR_sethostname 161 +#define __NR_setitimer 103 +#define __NR_setns 268 +#define __NR_setpgid 154 +#define __NR_setpriority 140 +#define __NR_setregid 143 +#define __NR_setresgid 149 +#define __NR_setresuid 147 +#define __NR_setreuid 145 +#define __NR_setrlimit 164 +#define __NR_setsid 157 +#define __NR_setsockopt 208 +#define __NR_settimeofday 170 +#define __NR_setuid 146 +#define __NR_setxattr 5 +#define __NR_shmat 196 +#define __NR_shmctl 195 +#define __NR_shmdt 197 +#define __NR_shmget 194 +#define __NR_shutdown 210 +#define __NR_sigaltstack 132 +#define __NR_signalfd4 74 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_splice 76 +#define __NR_statfs 43 +#define __NR_statx 291 +#define __NR_swapoff 225 +#define __NR_swapon 224 +#define __NR_symlinkat 36 +#define __NR_sync 81 +#define __NR_sync_file_range 84 +#define __NR_syncfs 267 +#define __NR_sysinfo 179 +#define __NR_syslog 116 +#define __NR_tee 77 +#define __NR_tgkill 131 +#define __NR_timer_create 107 +#define __NR_timer_delete 111 +#define __NR_timer_getoverrun 109 +#define __NR_timer_gettime 108 +#define __NR_timer_settime 110 +#define __NR_timerfd_create 85 +#define __NR_timerfd_gettime 87 +#define __NR_timerfd_settime 86 +#define __NR_times 153 +#define __NR_tkill 130 +#define __NR_truncate 45 +#define __NR_umask 166 +#define __NR_umount2 39 +#define __NR_uname 160 +#define __NR_unlinkat 35 +#define __NR_unshare 97 +#define __NR_userfaultfd 282 +#define __NR_utimensat 88 +#define __NR_vhangup 58 +#define __NR_vmsplice 75 +#define __NR_wait4 260 +#define __NR_waitid 95 +#define __NR_write 64 +#define __NR_writev 66 diff --git a/sysdeps/unix/sysv/linux/alpha/arch-syscall.h b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h new file mode 100644 index 0000000000..7ef908ba9b --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/arch-syscall.h @@ -0,0 +1,468 @@ +#define __NR__sysctl 319 +#define __NR_accept 99 +#define __NR_accept4 502 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 439 +#define __NR_adjtimex 366 +#define __NR_afs_syscall 338 +#define __NR_bdflush 300 +#define __NR_bind 104 +#define __NR_bpf 515 +#define __NR_brk 17 +#define __NR_capget 368 +#define __NR_capset 369 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 16 +#define __NR_chroot 61 +#define __NR_clock_adjtime 499 +#define __NR_clock_getres 421 +#define __NR_clock_gettime 420 +#define __NR_clock_nanosleep 422 +#define __NR_clock_settime 419 +#define __NR_clone 312 +#define __NR_close 6 +#define __NR_connect 98 +#define __NR_copy_file_range 519 +#define __NR_create_module 306 +#define __NR_delete_module 308 +#define __NR_dipc 373 +#define __NR_dup 41 +#define __NR_dup2 90 +#define __NR_dup3 487 +#define __NR_epoll_create 407 +#define __NR_epoll_create1 486 +#define __NR_epoll_ctl 408 +#define __NR_epoll_pwait 474 +#define __NR_epoll_wait 409 +#define __NR_eventfd 478 +#define __NR_eventfd2 485 +#define __NR_exec_with_loader 25 +#define __NR_execve 59 +#define __NR_execveat 513 +#define __NR_exit 1 +#define __NR_exit_group 405 +#define __NR_faccessat 462 +#define __NR_fadvise64 413 +#define __NR_fallocate 480 +#define __NR_fanotify_init 494 +#define __NR_fanotify_mark 495 +#define __NR_fchdir 13 +#define __NR_fchmod 124 +#define __NR_fchmodat 461 +#define __NR_fchown 123 +#define __NR_fchownat 453 +#define __NR_fcntl 92 +#define __NR_fdatasync 447 +#define __NR_fgetxattr 387 +#define __NR_finit_module 507 +#define __NR_flistxattr 390 +#define __NR_flock 131 +#define __NR_fork 2 +#define __NR_fremovexattr 393 +#define __NR_fsconfig 541 +#define __NR_fsetxattr 384 +#define __NR_fsmount 542 +#define __NR_fsopen 540 +#define __NR_fspick 543 +#define __NR_fstat 91 +#define __NR_fstat64 427 +#define __NR_fstatat64 455 +#define __NR_fstatfs 329 +#define __NR_fstatfs64 529 +#define __NR_fsync 95 +#define __NR_ftruncate 130 +#define __NR_futex 394 +#define __NR_futimesat 454 +#define __NR_get_kernel_syms 309 +#define __NR_get_mempolicy 430 +#define __NR_get_robust_list 467 +#define __NR_getcpu 473 +#define __NR_getcwd 367 +#define __NR_getdents 305 +#define __NR_getdents64 377 +#define __NR_getdtablesize 89 +#define __NR_getegid 530 +#define __NR_geteuid 531 +#define __NR_getgid 47 +#define __NR_getgroups 79 +#define __NR_gethostname 87 +#define __NR_getitimer 361 +#define __NR_getpagesize 64 +#define __NR_getpeername 141 +#define __NR_getpgid 233 +#define __NR_getpgrp 63 +#define __NR_getpid 20 +#define __NR_getppid 532 +#define __NR_getpriority 100 +#define __NR_getrandom 511 +#define __NR_getresgid 372 +#define __NR_getresuid 344 +#define __NR_getrlimit 144 +#define __NR_getrusage 364 +#define __NR_getsid 234 +#define __NR_getsockname 150 +#define __NR_getsockopt 118 +#define __NR_gettid 378 +#define __NR_gettimeofday 359 +#define __NR_getuid 24 +#define __NR_getxattr 385 +#define __NR_getxgid 47 +#define __NR_getxpid 20 +#define __NR_getxuid 24 +#define __NR_init_module 307 +#define __NR_inotify_add_watch 445 +#define __NR_inotify_init 444 +#define __NR_inotify_init1 489 +#define __NR_inotify_rm_watch 446 +#define __NR_io_cancel 402 +#define __NR_io_destroy 399 +#define __NR_io_getevents 400 +#define __NR_io_pgetevents 523 +#define __NR_io_setup 398 +#define __NR_io_submit 401 +#define __NR_io_uring_enter 536 +#define __NR_io_uring_register 537 +#define __NR_io_uring_setup 535 +#define __NR_ioctl 54 +#define __NR_ioprio_get 443 +#define __NR_ioprio_set 442 +#define __NR_kcmp 506 +#define __NR_kexec_load 448 +#define __NR_keyctl 441 +#define __NR_kill 37 +#define __NR_lchown 208 +#define __NR_lgetxattr 386 +#define __NR_link 9 +#define __NR_linkat 458 +#define __NR_listen 106 +#define __NR_listxattr 388 +#define __NR_llistxattr 389 +#define __NR_lookup_dcookie 406 +#define __NR_lremovexattr 392 +#define __NR_lseek 19 +#define __NR_lsetxattr 383 +#define __NR_lstat 68 +#define __NR_lstat64 426 +#define __NR_madvise 75 +#define __NR_mbind 429 +#define __NR_membarrier 517 +#define __NR_memfd_create 512 +#define __NR_migrate_pages 449 +#define __NR_mincore 375 +#define __NR_mkdir 136 +#define __NR_mkdirat 451 +#define __NR_mknod 14 +#define __NR_mknodat 452 +#define __NR_mlock 314 +#define __NR_mlock2 518 +#define __NR_mlockall 316 +#define __NR_mmap 71 +#define __NR_mount 302 +#define __NR_move_mount 539 +#define __NR_move_pages 472 +#define __NR_mprotect 74 +#define __NR_mq_getsetattr 437 +#define __NR_mq_notify 436 +#define __NR_mq_open 432 +#define __NR_mq_timedreceive 435 +#define __NR_mq_timedsend 434 +#define __NR_mq_unlink 433 +#define __NR_mremap 341 +#define __NR_msgctl 200 +#define __NR_msgget 201 +#define __NR_msgrcv 202 +#define __NR_msgsnd 203 +#define __NR_msync 217 +#define __NR_munlock 315 +#define __NR_munlockall 317 +#define __NR_munmap 73 +#define __NR_name_to_handle_at 497 +#define __NR_nanosleep 340 +#define __NR_nfsservctl 342 +#define __NR_old_adjtimex 303 +#define __NR_oldumount 321 +#define __NR_open 45 +#define __NR_open_by_handle_at 498 +#define __NR_open_tree 538 +#define __NR_openat 450 +#define __NR_osf_adjtime 140 +#define __NR_osf_afs_syscall 258 +#define __NR_osf_alt_plock 181 +#define __NR_osf_alt_setsid 188 +#define __NR_osf_alt_sigpending 187 +#define __NR_osf_asynch_daemon 163 +#define __NR_osf_audcntl 252 +#define __NR_osf_audgen 253 +#define __NR_osf_chflags 34 +#define __NR_osf_execve 11 +#define __NR_osf_exportfs 169 +#define __NR_osf_fchflags 35 +#define __NR_osf_fdatasync 261 +#define __NR_osf_fpathconf 248 +#define __NR_osf_fstat 226 +#define __NR_osf_fstatfs 161 +#define __NR_osf_fstatfs64 228 +#define __NR_osf_fuser 243 +#define __NR_osf_getaddressconf 214 +#define __NR_osf_getdirentries 159 +#define __NR_osf_getdomainname 165 +#define __NR_osf_getfh 164 +#define __NR_osf_getfsstat 18 +#define __NR_osf_gethostid 142 +#define __NR_osf_getitimer 86 +#define __NR_osf_getlogin 49 +#define __NR_osf_getmnt 184 +#define __NR_osf_getrusage 117 +#define __NR_osf_getsysinfo 256 +#define __NR_osf_gettimeofday 116 +#define __NR_osf_kloadcall 223 +#define __NR_osf_kmodcall 77 +#define __NR_osf_lstat 225 +#define __NR_osf_memcntl 260 +#define __NR_osf_mincore 78 +#define __NR_osf_mount 21 +#define __NR_osf_mremap 65 +#define __NR_osf_msfs_syscall 240 +#define __NR_osf_msleep 215 +#define __NR_osf_mvalid 213 +#define __NR_osf_mwakeup 216 +#define __NR_osf_naccept 30 +#define __NR_osf_nfssvc 158 +#define __NR_osf_ngetpeername 31 +#define __NR_osf_ngetsockname 32 +#define __NR_osf_nrecvfrom 29 +#define __NR_osf_nrecvmsg 27 +#define __NR_osf_nsendmsg 28 +#define __NR_osf_ntp_adjtime 245 +#define __NR_osf_ntp_gettime 246 +#define __NR_osf_old_creat 8 +#define __NR_osf_old_fstat 62 +#define __NR_osf_old_getpgrp 81 +#define __NR_osf_old_killpg 146 +#define __NR_osf_old_lstat 40 +#define __NR_osf_old_open 5 +#define __NR_osf_old_sigaction 46 +#define __NR_osf_old_sigblock 109 +#define __NR_osf_old_sigreturn 139 +#define __NR_osf_old_sigsetmask 110 +#define __NR_osf_old_sigvec 108 +#define __NR_osf_old_stat 38 +#define __NR_osf_old_vadvise 72 +#define __NR_osf_old_vtrace 115 +#define __NR_osf_old_wait 84 +#define __NR_osf_oldquota 149 +#define __NR_osf_pathconf 247 +#define __NR_osf_pid_block 153 +#define __NR_osf_pid_unblock 154 +#define __NR_osf_plock 107 +#define __NR_osf_priocntlset 237 +#define __NR_osf_profil 44 +#define __NR_osf_proplist_syscall 244 +#define __NR_osf_reboot 55 +#define __NR_osf_revoke 56 +#define __NR_osf_sbrk 69 +#define __NR_osf_security 222 +#define __NR_osf_select 93 +#define __NR_osf_set_program_attributes 43 +#define __NR_osf_set_speculative 239 +#define __NR_osf_sethostid 143 +#define __NR_osf_setitimer 83 +#define __NR_osf_setlogin 50 +#define __NR_osf_setsysinfo 257 +#define __NR_osf_settimeofday 122 +#define __NR_osf_shmat 209 +#define __NR_osf_signal 218 +#define __NR_osf_sigprocmask 48 +#define __NR_osf_sigsendset 238 +#define __NR_osf_sigstack 112 +#define __NR_osf_sigwaitprim 157 +#define __NR_osf_sstk 70 +#define __NR_osf_stat 224 +#define __NR_osf_statfs 160 +#define __NR_osf_statfs64 227 +#define __NR_osf_subsys_info 255 +#define __NR_osf_swapctl 259 +#define __NR_osf_swapon 199 +#define __NR_osf_syscall 0 +#define __NR_osf_sysinfo 241 +#define __NR_osf_table 85 +#define __NR_osf_uadmin 242 +#define __NR_osf_usleep_thread 251 +#define __NR_osf_uswitch 250 +#define __NR_osf_utc_adjtime 220 +#define __NR_osf_utc_gettime 219 +#define __NR_osf_utimes 138 +#define __NR_osf_utsname 207 +#define __NR_osf_wait4 7 +#define __NR_osf_waitid 236 +#define __NR_pciconfig_iobase 376 +#define __NR_pciconfig_read 345 +#define __NR_pciconfig_write 346 +#define __NR_perf_event_open 493 +#define __NR_personality 324 +#define __NR_pidfd_open 544 +#define __NR_pidfd_send_signal 534 +#define __NR_pipe 42 +#define __NR_pipe2 488 +#define __NR_pivot_root 374 +#define __NR_pkey_alloc 525 +#define __NR_pkey_free 526 +#define __NR_pkey_mprotect 524 +#define __NR_poll 94 +#define __NR_ppoll 464 +#define __NR_prctl 348 +#define __NR_pread64 349 +#define __NR_preadv 490 +#define __NR_preadv2 520 +#define __NR_prlimit64 496 +#define __NR_process_vm_readv 504 +#define __NR_process_vm_writev 505 +#define __NR_pselect6 463 +#define __NR_ptrace 26 +#define __NR_pwrite64 350 +#define __NR_pwritev 491 +#define __NR_pwritev2 521 +#define __NR_query_module 347 +#define __NR_quotactl 148 +#define __NR_read 3 +#define __NR_readahead 379 +#define __NR_readlink 58 +#define __NR_readlinkat 460 +#define __NR_readv 120 +#define __NR_reboot 311 +#define __NR_recv 102 +#define __NR_recvfrom 125 +#define __NR_recvmmsg 479 +#define __NR_recvmsg 113 +#define __NR_remap_file_pages 410 +#define __NR_removexattr 391 +#define __NR_rename 128 +#define __NR_renameat 457 +#define __NR_renameat2 510 +#define __NR_request_key 440 +#define __NR_restart_syscall 412 +#define __NR_rmdir 137 +#define __NR_rseq 527 +#define __NR_rt_sigaction 352 +#define __NR_rt_sigpending 354 +#define __NR_rt_sigprocmask 353 +#define __NR_rt_sigqueueinfo 356 +#define __NR_rt_sigreturn 351 +#define __NR_rt_sigsuspend 357 +#define __NR_rt_sigtimedwait 355 +#define __NR_rt_tgsigqueueinfo 492 +#define __NR_sched_get_priority_max 335 +#define __NR_sched_get_priority_min 336 +#define __NR_sched_getaffinity 396 +#define __NR_sched_getattr 509 +#define __NR_sched_getparam 331 +#define __NR_sched_getscheduler 333 +#define __NR_sched_rr_get_interval 337 +#define __NR_sched_setaffinity 395 +#define __NR_sched_setattr 508 +#define __NR_sched_setparam 330 +#define __NR_sched_setscheduler 332 +#define __NR_sched_yield 334 +#define __NR_seccomp 514 +#define __NR_select 358 +#define __NR_semctl 204 +#define __NR_semget 205 +#define __NR_semop 206 +#define __NR_semtimedop 423 +#define __NR_send 101 +#define __NR_sendfile 370 +#define __NR_sendmmsg 503 +#define __NR_sendmsg 114 +#define __NR_sendto 133 +#define __NR_set_mempolicy 431 +#define __NR_set_robust_list 466 +#define __NR_set_tid_address 411 +#define __NR_setdomainname 166 +#define __NR_setfsgid 326 +#define __NR_setfsuid 325 +#define __NR_setgid 132 +#define __NR_setgroups 80 +#define __NR_sethae 301 +#define __NR_sethostname 88 +#define __NR_setitimer 362 +#define __NR_setns 501 +#define __NR_setpgid 39 +#define __NR_setpgrp 82 +#define __NR_setpriority 96 +#define __NR_setregid 127 +#define __NR_setresgid 371 +#define __NR_setresuid 343 +#define __NR_setreuid 126 +#define __NR_setrlimit 145 +#define __NR_setsid 147 +#define __NR_setsockopt 105 +#define __NR_settimeofday 360 +#define __NR_setuid 23 +#define __NR_setxattr 382 +#define __NR_shmat 209 +#define __NR_shmctl 210 +#define __NR_shmdt 211 +#define __NR_shmget 212 +#define __NR_shutdown 134 +#define __NR_sigaction 156 +#define __NR_sigaltstack 235 +#define __NR_signalfd 476 +#define __NR_signalfd4 484 +#define __NR_sigpending 52 +#define __NR_sigreturn 103 +#define __NR_sigsuspend 111 +#define __NR_socket 97 +#define __NR_socketpair 135 +#define __NR_splice 468 +#define __NR_stat 67 +#define __NR_stat64 425 +#define __NR_statfs 328 +#define __NR_statfs64 528 +#define __NR_statx 522 +#define __NR_swapoff 304 +#define __NR_swapon 322 +#define __NR_symlink 57 +#define __NR_symlinkat 459 +#define __NR_sync 36 +#define __NR_sync_file_range 469 +#define __NR_syncfs 500 +#define __NR_sysfs 254 +#define __NR_sysinfo 318 +#define __NR_syslog 310 +#define __NR_tee 470 +#define __NR_tgkill 424 +#define __NR_timer_create 414 +#define __NR_timer_delete 418 +#define __NR_timer_getoverrun 417 +#define __NR_timer_gettime 416 +#define __NR_timer_settime 415 +#define __NR_timerfd 477 +#define __NR_timerfd_create 481 +#define __NR_timerfd_gettime 483 +#define __NR_timerfd_settime 482 +#define __NR_times 323 +#define __NR_tkill 381 +#define __NR_truncate 129 +#define __NR_tuxcall 397 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 22 +#define __NR_uname 339 +#define __NR_unlink 10 +#define __NR_unlinkat 456 +#define __NR_unshare 465 +#define __NR_uselib 313 +#define __NR_userfaultfd 516 +#define __NR_ustat 327 +#define __NR_utimensat 475 +#define __NR_utimes 363 +#define __NR_vfork 66 +#define __NR_vhangup 76 +#define __NR_vmsplice 471 +#define __NR_vserver 428 +#define __NR_wait4 365 +#define __NR_waitid 438 +#define __NR_write 4 +#define __NR_writev 121 diff --git a/sysdeps/unix/sysv/linux/arm/arch-syscall.h b/sysdeps/unix/sysv/linux/arm/arch-syscall.h new file mode 100644 index 0000000000..1746111937 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/arch-syscall.h @@ -0,0 +1,392 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 285 +#define __NR_accept4 366 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 309 +#define __NR_adjtimex 124 +#define __NR_arm_fadvise64_64 270 +#define __NR_arm_sync_file_range 341 +#define __NR_bdflush 134 +#define __NR_bind 282 +#define __NR_bpf 386 +#define __NR_brk 45 +#define __NR_cacheflush 983042 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 182 +#define __NR_chown32 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 372 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 264 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 263 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 265 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 262 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 283 +#define __NR_copy_file_range 391 +#define __NR_creat 8 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 358 +#define __NR_epoll_create 250 +#define __NR_epoll_create1 357 +#define __NR_epoll_ctl 251 +#define __NR_epoll_pwait 346 +#define __NR_epoll_wait 252 +#define __NR_eventfd 351 +#define __NR_eventfd2 356 +#define __NR_execve 11 +#define __NR_execveat 387 +#define __NR_exit 1 +#define __NR_exit_group 248 +#define __NR_faccessat 334 +#define __NR_fallocate 352 +#define __NR_fanotify_init 367 +#define __NR_fanotify_mark 368 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 333 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 325 +#define __NR_fcntl 55 +#define __NR_fcntl64 221 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 231 +#define __NR_finit_module 379 +#define __NR_flistxattr 234 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 237 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 228 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 327 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 267 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 240 +#define __NR_futex_time64 422 +#define __NR_futimesat 326 +#define __NR_get_mempolicy 320 +#define __NR_get_robust_list 339 +#define __NR_getcpu 345 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 217 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpeername 287 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 384 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 286 +#define __NR_getsockopt 295 +#define __NR_gettid 224 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 229 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 317 +#define __NR_inotify_init 316 +#define __NR_inotify_init1 360 +#define __NR_inotify_rm_watch 318 +#define __NR_io_cancel 247 +#define __NR_io_destroy 244 +#define __NR_io_getevents 245 +#define __NR_io_pgetevents 399 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 243 +#define __NR_io_submit 246 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 315 +#define __NR_ioprio_set 314 +#define __NR_kcmp 378 +#define __NR_kexec_file_load 401 +#define __NR_kexec_load 347 +#define __NR_keyctl 311 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 198 +#define __NR_lgetxattr 230 +#define __NR_link 9 +#define __NR_linkat 330 +#define __NR_listen 284 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_lookup_dcookie 249 +#define __NR_lremovexattr 236 +#define __NR_lseek 19 +#define __NR_lsetxattr 227 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 220 +#define __NR_mbind 319 +#define __NR_membarrier 389 +#define __NR_memfd_create 385 +#define __NR_migrate_pages 400 +#define __NR_mincore 219 +#define __NR_mkdir 39 +#define __NR_mkdirat 323 +#define __NR_mknod 14 +#define __NR_mknodat 324 +#define __NR_mlock 150 +#define __NR_mlock2 390 +#define __NR_mlockall 152 +#define __NR_mmap2 192 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 344 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 279 +#define __NR_mq_notify 278 +#define __NR_mq_open 274 +#define __NR_mq_timedreceive 277 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 276 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 275 +#define __NR_mremap 163 +#define __NR_msgctl 304 +#define __NR_msgget 303 +#define __NR_msgrcv 302 +#define __NR_msgsnd 301 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 370 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_open 5 +#define __NR_open_by_handle_at 371 +#define __NR_open_tree 428 +#define __NR_openat 322 +#define __NR_pause 29 +#define __NR_pciconfig_iobase 271 +#define __NR_pciconfig_read 272 +#define __NR_pciconfig_write 273 +#define __NR_perf_event_open 364 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 359 +#define __NR_pivot_root 218 +#define __NR_pkey_alloc 395 +#define __NR_pkey_free 396 +#define __NR_pkey_mprotect 394 +#define __NR_poll 168 +#define __NR_ppoll 336 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 361 +#define __NR_preadv2 392 +#define __NR_prlimit64 369 +#define __NR_process_vm_readv 376 +#define __NR_process_vm_writev 377 +#define __NR_pselect6 335 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_pwrite64 181 +#define __NR_pwritev 362 +#define __NR_pwritev2 393 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 225 +#define __NR_readlink 85 +#define __NR_readlinkat 332 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 291 +#define __NR_recvfrom 292 +#define __NR_recvmmsg 365 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 297 +#define __NR_remap_file_pages 253 +#define __NR_removexattr 235 +#define __NR_rename 38 +#define __NR_renameat 329 +#define __NR_renameat2 382 +#define __NR_request_key 310 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 398 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 363 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 242 +#define __NR_sched_getattr 381 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 241 +#define __NR_sched_setattr 380 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 383 +#define __NR_semctl 300 +#define __NR_semget 299 +#define __NR_semop 298 +#define __NR_semtimedop 312 +#define __NR_semtimedop_time64 420 +#define __NR_send 289 +#define __NR_sendfile 187 +#define __NR_sendfile64 239 +#define __NR_sendmmsg 374 +#define __NR_sendmsg 296 +#define __NR_sendto 290 +#define __NR_set_mempolicy 321 +#define __NR_set_robust_list 338 +#define __NR_set_tid_address 256 +#define __NR_set_tls 983045 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 375 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 294 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 226 +#define __NR_shmat 305 +#define __NR_shmctl 308 +#define __NR_shmdt 306 +#define __NR_shmget 307 +#define __NR_shutdown 293 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signalfd 349 +#define __NR_signalfd4 355 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 281 +#define __NR_socketpair 288 +#define __NR_splice 340 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 266 +#define __NR_statx 397 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 331 +#define __NR_sync 36 +#define __NR_sync_file_range2 341 +#define __NR_syncfs 373 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 342 +#define __NR_tgkill 268 +#define __NR_timer_create 257 +#define __NR_timer_delete 261 +#define __NR_timer_getoverrun 260 +#define __NR_timer_gettime 259 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 258 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 350 +#define __NR_timerfd_gettime 354 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 353 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 238 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_umask 60 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 328 +#define __NR_unshare 337 +#define __NR_uselib 86 +#define __NR_userfaultfd 388 +#define __NR_ustat 62 +#define __NR_utimensat 348 +#define __NR_utimensat_time64 412 +#define __NR_utimes 269 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vmsplice 343 +#define __NR_vserver 313 +#define __NR_wait4 114 +#define __NR_waitid 280 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h new file mode 100644 index 0000000000..6f236462a8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/fixup-asm-unistd.h @@ -0,0 +1,24 @@ +/* Regularize definitions. Arm version. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +/* These system calls have iregular names and are used by glibc. */ +#ifndef __NR_cacheflush +# define __NR_cacheflush __ARM_NR_cacheflush +#endif +#ifndef __NR_set_tls +# define __NR_set_tls __ARM_NR_set_tls +#endif diff --git a/sysdeps/unix/sysv/linux/csky/arch-syscall.h b/sysdeps/unix/sysv/linux/csky/arch-syscall.h new file mode 100644 index 0000000000..60a626660e --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/arch-syscall.h @@ -0,0 +1,309 @@ +#define __NR_accept 202 +#define __NR_accept4 242 +#define __NR_acct 89 +#define __NR_add_key 217 +#define __NR_adjtimex 171 +#define __NR_bind 200 +#define __NR_bpf 280 +#define __NR_brk 214 +#define __NR_cacheflush 245 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_chdir 49 +#define __NR_chroot 51 +#define __NR_clock_adjtime 266 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 114 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 113 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 115 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 112 +#define __NR_clock_settime64 404 +#define __NR_clone 220 +#define __NR_close 57 +#define __NR_connect 203 +#define __NR_copy_file_range 285 +#define __NR_delete_module 106 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_eventfd2 19 +#define __NR_execve 221 +#define __NR_execveat 281 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_faccessat 48 +#define __NR_fadvise64_64 223 +#define __NR_fallocate 47 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_fchdir 50 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchown 55 +#define __NR_fchownat 54 +#define __NR_fcntl64 25 +#define __NR_fdatasync 83 +#define __NR_fgetxattr 10 +#define __NR_finit_module 273 +#define __NR_flistxattr 13 +#define __NR_flock 32 +#define __NR_fremovexattr 16 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 7 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstatfs64 44 +#define __NR_fsync 82 +#define __NR_ftruncate64 46 +#define __NR_futex 98 +#define __NR_futex_time64 422 +#define __NR_get_mempolicy 236 +#define __NR_get_robust_list 100 +#define __NR_getcpu 168 +#define __NR_getcwd 17 +#define __NR_getdents64 61 +#define __NR_getegid 177 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getgroups 158 +#define __NR_getitimer 102 +#define __NR_getpeername 205 +#define __NR_getpgid 155 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getpriority 141 +#define __NR_getrandom 278 +#define __NR_getresgid 150 +#define __NR_getresuid 148 +#define __NR_getrlimit 163 +#define __NR_getrusage 165 +#define __NR_getsid 156 +#define __NR_getsockname 204 +#define __NR_getsockopt 209 +#define __NR_gettid 178 +#define __NR_gettimeofday 169 +#define __NR_getuid 174 +#define __NR_getxattr 8 +#define __NR_init_module 105 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_init1 26 +#define __NR_inotify_rm_watch 28 +#define __NR_io_cancel 3 +#define __NR_io_destroy 1 +#define __NR_io_getevents 4 +#define __NR_io_pgetevents 292 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 0 +#define __NR_io_submit 2 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 29 +#define __NR_ioprio_get 31 +#define __NR_ioprio_set 30 +#define __NR_kcmp 272 +#define __NR_kexec_file_load 294 +#define __NR_kexec_load 104 +#define __NR_keyctl 219 +#define __NR_kill 129 +#define __NR_lgetxattr 9 +#define __NR_linkat 37 +#define __NR_listen 201 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_llseek 62 +#define __NR_lookup_dcookie 18 +#define __NR_lremovexattr 15 +#define __NR_lsetxattr 6 +#define __NR_madvise 233 +#define __NR_mbind 235 +#define __NR_membarrier 283 +#define __NR_memfd_create 279 +#define __NR_migrate_pages 238 +#define __NR_mincore 232 +#define __NR_mkdirat 34 +#define __NR_mknodat 33 +#define __NR_mlock 228 +#define __NR_mlock2 284 +#define __NR_mlockall 230 +#define __NR_mmap2 222 +#define __NR_mount 40 +#define __NR_move_mount 429 +#define __NR_move_pages 239 +#define __NR_mprotect 226 +#define __NR_mq_getsetattr 185 +#define __NR_mq_notify 184 +#define __NR_mq_open 180 +#define __NR_mq_timedreceive 183 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 181 +#define __NR_mremap 216 +#define __NR_msgctl 187 +#define __NR_msgget 186 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_msync 227 +#define __NR_munlock 229 +#define __NR_munlockall 231 +#define __NR_munmap 215 +#define __NR_name_to_handle_at 264 +#define __NR_nanosleep 101 +#define __NR_nfsservctl 42 +#define __NR_open_by_handle_at 265 +#define __NR_open_tree 428 +#define __NR_openat 56 +#define __NR_perf_event_open 241 +#define __NR_personality 92 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe2 59 +#define __NR_pivot_root 41 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_pkey_mprotect 288 +#define __NR_ppoll 73 +#define __NR_ppoll_time64 414 +#define __NR_prctl 167 +#define __NR_pread64 67 +#define __NR_preadv 69 +#define __NR_preadv2 286 +#define __NR_prlimit64 261 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_pselect6 72 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 117 +#define __NR_pwrite64 68 +#define __NR_pwritev 70 +#define __NR_pwritev2 287 +#define __NR_quotactl 60 +#define __NR_read 63 +#define __NR_readahead 213 +#define __NR_readlinkat 78 +#define __NR_readv 65 +#define __NR_reboot 142 +#define __NR_recvfrom 207 +#define __NR_recvmmsg 243 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 212 +#define __NR_remap_file_pages 234 +#define __NR_removexattr 14 +#define __NR_renameat2 276 +#define __NR_request_key 218 +#define __NR_restart_syscall 128 +#define __NR_rseq 293 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_getaffinity 123 +#define __NR_sched_getattr 275 +#define __NR_sched_getparam 121 +#define __NR_sched_getscheduler 120 +#define __NR_sched_rr_get_interval 127 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 122 +#define __NR_sched_setattr 274 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_yield 124 +#define __NR_seccomp 277 +#define __NR_semctl 191 +#define __NR_semget 190 +#define __NR_semop 193 +#define __NR_semtimedop 192 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile64 71 +#define __NR_sendmmsg 269 +#define __NR_sendmsg 211 +#define __NR_sendto 206 +#define __NR_set_mempolicy 237 +#define __NR_set_robust_list 99 +#define __NR_set_thread_area 244 +#define __NR_set_tid_address 96 +#define __NR_setdomainname 162 +#define __NR_setfsgid 152 +#define __NR_setfsuid 151 +#define __NR_setgid 144 +#define __NR_setgroups 159 +#define __NR_sethostname 161 +#define __NR_setitimer 103 +#define __NR_setns 268 +#define __NR_setpgid 154 +#define __NR_setpriority 140 +#define __NR_setregid 143 +#define __NR_setresgid 149 +#define __NR_setresuid 147 +#define __NR_setreuid 145 +#define __NR_setrlimit 164 +#define __NR_setsid 157 +#define __NR_setsockopt 208 +#define __NR_settimeofday 170 +#define __NR_setuid 146 +#define __NR_setxattr 5 +#define __NR_shmat 196 +#define __NR_shmctl 195 +#define __NR_shmdt 197 +#define __NR_shmget 194 +#define __NR_shutdown 210 +#define __NR_sigaltstack 132 +#define __NR_signalfd4 74 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_splice 76 +#define __NR_statfs64 43 +#define __NR_statx 291 +#define __NR_swapoff 225 +#define __NR_swapon 224 +#define __NR_symlinkat 36 +#define __NR_sync 81 +#define __NR_sync_file_range 84 +#define __NR_syncfs 267 +#define __NR_sysinfo 179 +#define __NR_syslog 116 +#define __NR_tee 77 +#define __NR_tgkill 131 +#define __NR_timer_create 107 +#define __NR_timer_delete 111 +#define __NR_timer_getoverrun 109 +#define __NR_timer_gettime 108 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 110 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 85 +#define __NR_timerfd_gettime 87 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_settime64 411 +#define __NR_times 153 +#define __NR_tkill 130 +#define __NR_truncate64 45 +#define __NR_umask 166 +#define __NR_umount2 39 +#define __NR_uname 160 +#define __NR_unlinkat 35 +#define __NR_unshare 97 +#define __NR_userfaultfd 282 +#define __NR_utimensat 88 +#define __NR_utimensat_time64 412 +#define __NR_vhangup 58 +#define __NR_vmsplice 75 +#define __NR_wait4 260 +#define __NR_waitid 95 +#define __NR_write 64 +#define __NR_writev 66 diff --git a/sysdeps/unix/sysv/linux/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/fixup-asm-unistd.h new file mode 100644 index 0000000000..a5bd9822b7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/fixup-asm-unistd.h @@ -0,0 +1,28 @@ +/* Regularize definitions. Default version. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +/* Some architectures have irregular system call names in + . glibc assumes that system call numbers start with + __NR_* and lists the system calls under proper names in + . + + During consistency tests, is included after + the kernel's , to introduce aliases as necessary to + match the glibc definitions in . + + Most architectures do not need these fixups, so the default header + is empty. */ diff --git a/sysdeps/unix/sysv/linux/glibcsyscalls.py b/sysdeps/unix/sysv/linux/glibcsyscalls.py new file mode 100644 index 0000000000..b968229a48 --- /dev/null +++ b/sysdeps/unix/sysv/linux/glibcsyscalls.py @@ -0,0 +1,165 @@ +#!/usr/bin/python3 +# Helpers for glibc system call list processing. +# Copyright (C) 2018-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 +# . + +import re + +import glibcextract + +def extract_system_call_name(macro): + """Convert the macro name (with __NR_) to a system call name.""" + prefix = '__NR_' + if macro.startswith(prefix): + return macro[len(prefix):] + else: + raise ValueError('invalid system call name: {!r}'.format(macro)) + +# Matches macros for systme call names. +RE_SYSCALL = re.compile('__NR_.*') + +# Some __NR_ constants are not real +RE_PSEUDO_SYSCALL = re.compile(r"""__NR_( + # Reserved system call. + (unused|reserved)[0-9]+ + + # Pseudo-system call which describes a range. + |(syscalls|arch_specific_syscall|(OABI_)?SYSCALL_BASE) + |(|64_|[NO]32_)Linux(_syscalls)? + )""", re.X) + +def kernel_constants(cc): + """Return a dictionary with the kernel-defined system call numbers. + + This come from . + + """ + return {extract_system_call_name(name) : int(value) + for name, value in glibcextract.compute_macro_consts( + '#include \n' + # Regularlize the kernel definitions if necessary. + '#include ', + cc, macro_re=RE_SYSCALL, exclude_re=RE_PSEUDO_SYSCALL) + .items()} + +class SyscallNamesList: + """The list of known system call names. + + glibc keeps a list of system call names. The + header needs to provide a SYS_ name for each __NR_ macro, + and the generated header uses an + architecture-independent list, so that there is a chance that + system calls arriving late on certain architectures will automatically + get the expected SYS_ macro. + + syscalls: list of strings with system call names + kernel_version: tuple of integers; the kernel version given in the file + + """ + def __init__(self, lines): + self.syscalls = [] + old_name = None + self.kernel_version = None + self.__lines = tuple(lines) + for line in self.__lines: + line = line.strip() + if (not line) or line[0] == '#': + continue + comps = line.split() + if len(comps) == 1: + self.syscalls.append(comps[0]) + if old_name is not None: + if comps[0] < old_name: + raise ValueError( + 'name list is not sorted: {!r} < {!r}'.format( + comps[0], old_name)) + old_name = comps[0] + continue + if len(comps) == 2 and comps[0] == "kernel": + if self.kernel_version is not None: + raise ValueError( + "multiple kernel versions: {!r} and !{r}".format( + kernel_version, comps[1])) + self.kernel_version = tuple(map(int, comps[1].split("."))) + continue + raise ValueError("invalid line: !r".format(line)) + if self.kernel_version is None: + raise ValueError("missing kernel version") + + def merge(self, names): + """Merge sequence NAMES and return the lines of the new file.""" + names = list(set(names) - set(self.syscalls)) + names.sort() + names.reverse() + result = [] + def emit_name(): + result.append(names[-1] + "\n") + del names[-1] + + for line in self.__lines: + comps = line.strip().split() + if len(comps) == 1 and not comps[0].startswith("#"): + # File has a system call at this position. Insert all + # the names that come before the name in the file + # lexicographically. + while names and names[-1] < comps[0]: + emit_name() + result.append(line) + while names: + emit_name() + + return result + +def load_arch_syscall_header(path): + """"Load the system call header form the file PATH. + + The file must consist of lines of this form: + + #define __NR_exit 1 + + The file is parsed verbatim, without running it through a C + preprocessor or parser. The intent is that the file can be + readily processed by tools. + + """ + with open(path) as inp: + result = {} + old_name = None + for line in inp: + line = line.strip() + define, name, number = line.split(' ', 2) + if define != '#define': + raise ValueError("invalid syscall header line: {!r}".format( + line)) + result[extract_system_call_name(name)] = int(number) + + # Check list order. + if old_name is not None: + if name < old_name: + raise ValueError( + 'system call list is not sorted: {!r} < {!r}'.format( + name, old_name)) + old_name = name + return result + +def linux_kernel_version(cc): + """Return the (major, minor) version of the Linux kernel headers.""" + sym_data = ['#include ', 'START', + ('LINUX_VERSION_CODE', 'LINUX_VERSION_CODE')] + val = glibcextract.compute_c_consts(sym_data, cc)['LINUX_VERSION_CODE'] + val = int(val) + return ((val & 0xff0000) >> 16, (val & 0xff00) >> 8) diff --git a/sysdeps/unix/sysv/linux/hppa/arch-syscall.h b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h new file mode 100644 index 0000000000..542c70601f --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/arch-syscall.h @@ -0,0 +1,371 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 35 +#define __NR_accept4 320 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 264 +#define __NR_adjtimex 124 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 22 +#define __NR_bpf 341 +#define __NR_brk 45 +#define __NR_capget 106 +#define __NR_capset 107 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 180 +#define __NR_chroot 61 +#define __NR_clock_adjtime 324 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 257 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 256 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 258 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 255 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 31 +#define __NR_copy_file_range 346 +#define __NR_creat 8 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 312 +#define __NR_epoll_create 224 +#define __NR_epoll_create1 311 +#define __NR_epoll_ctl 225 +#define __NR_epoll_pwait 297 +#define __NR_epoll_wait 226 +#define __NR_eventfd 304 +#define __NR_eventfd2 310 +#define __NR_execve 11 +#define __NR_execveat 342 +#define __NR_exit 1 +#define __NR_exit_group 222 +#define __NR_faccessat 287 +#define __NR_fadvise64_64 236 +#define __NR_fallocate 305 +#define __NR_fanotify_init 322 +#define __NR_fanotify_mark 323 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 286 +#define __NR_fchown 95 +#define __NR_fchownat 278 +#define __NR_fcntl 55 +#define __NR_fcntl64 202 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 243 +#define __NR_finit_module 333 +#define __NR_flistxattr 246 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 249 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 240 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 28 +#define __NR_fstat64 112 +#define __NR_fstatat64 280 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 299 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 200 +#define __NR_futex 210 +#define __NR_futex_time64 422 +#define __NR_futimesat 279 +#define __NR_get_mempolicy 261 +#define __NR_get_robust_list 290 +#define __NR_getcpu 296 +#define __NR_getcwd 110 +#define __NR_getdents 141 +#define __NR_getdents64 201 +#define __NR_getegid 50 +#define __NR_geteuid 49 +#define __NR_getgid 47 +#define __NR_getgroups 80 +#define __NR_getitimer 105 +#define __NR_getpeername 53 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 339 +#define __NR_getresgid 171 +#define __NR_getresuid 165 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 44 +#define __NR_getsockopt 182 +#define __NR_gettid 206 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getxattr 241 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 270 +#define __NR_inotify_init 269 +#define __NR_inotify_init1 314 +#define __NR_inotify_rm_watch 271 +#define __NR_io_cancel 219 +#define __NR_io_destroy 216 +#define __NR_io_getevents 217 +#define __NR_io_pgetevents 350 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 215 +#define __NR_io_submit 218 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 268 +#define __NR_ioprio_set 267 +#define __NR_kcmp 332 +#define __NR_kexec_file_load 355 +#define __NR_kexec_load 300 +#define __NR_keyctl 266 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lgetxattr 242 +#define __NR_link 9 +#define __NR_linkat 283 +#define __NR_listen 32 +#define __NR_listxattr 244 +#define __NR_llistxattr 245 +#define __NR_lookup_dcookie 223 +#define __NR_lremovexattr 248 +#define __NR_lseek 19 +#define __NR_lsetxattr 239 +#define __NR_lstat 84 +#define __NR_lstat64 198 +#define __NR_madvise 119 +#define __NR_mbind 260 +#define __NR_membarrier 343 +#define __NR_memfd_create 340 +#define __NR_migrate_pages 272 +#define __NR_mincore 72 +#define __NR_mkdir 39 +#define __NR_mkdirat 276 +#define __NR_mknod 14 +#define __NR_mknodat 277 +#define __NR_mlock 150 +#define __NR_mlock2 345 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 89 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 295 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 234 +#define __NR_mq_notify 233 +#define __NR_mq_open 229 +#define __NR_mq_timedreceive 232 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 231 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 230 +#define __NR_mremap 163 +#define __NR_msgctl 191 +#define __NR_msgget 190 +#define __NR_msgrcv 189 +#define __NR_msgsnd 188 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 325 +#define __NR_nanosleep 162 +#define __NR_nice 34 +#define __NR_open 5 +#define __NR_open_by_handle_at 326 +#define __NR_open_tree 428 +#define __NR_openat 275 +#define __NR_pause 29 +#define __NR_perf_event_open 318 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 313 +#define __NR_pivot_root 67 +#define __NR_pkey_alloc 352 +#define __NR_pkey_free 353 +#define __NR_pkey_mprotect 351 +#define __NR_poll 168 +#define __NR_ppoll 274 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 108 +#define __NR_preadv 315 +#define __NR_preadv2 347 +#define __NR_prlimit64 321 +#define __NR_process_vm_readv 330 +#define __NR_process_vm_writev 331 +#define __NR_pselect6 273 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_pwrite64 109 +#define __NR_pwritev 316 +#define __NR_pwritev2 348 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 207 +#define __NR_readlink 85 +#define __NR_readlinkat 285 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 98 +#define __NR_recvfrom 123 +#define __NR_recvmmsg 319 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 184 +#define __NR_remap_file_pages 227 +#define __NR_removexattr 247 +#define __NR_rename 38 +#define __NR_renameat 282 +#define __NR_renameat2 337 +#define __NR_request_key 265 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 354 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 317 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 212 +#define __NR_sched_getattr 335 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 211 +#define __NR_sched_setattr 334 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 338 +#define __NR_semctl 187 +#define __NR_semget 186 +#define __NR_semop 185 +#define __NR_semtimedop 228 +#define __NR_semtimedop_time64 420 +#define __NR_send 58 +#define __NR_sendfile 122 +#define __NR_sendfile64 209 +#define __NR_sendmmsg 329 +#define __NR_sendmsg 183 +#define __NR_sendto 82 +#define __NR_set_mempolicy 262 +#define __NR_set_robust_list 289 +#define __NR_set_tid_address 237 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsuid 138 +#define __NR_setgid 46 +#define __NR_setgroups 81 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 328 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setresgid 170 +#define __NR_setresuid 164 +#define __NR_setreuid 70 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 181 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setxattr 238 +#define __NR_sgetmask 68 +#define __NR_shmat 192 +#define __NR_shmctl 195 +#define __NR_shmdt 193 +#define __NR_shmget 194 +#define __NR_shutdown 117 +#define __NR_sigaltstack 166 +#define __NR_signal 48 +#define __NR_signalfd 302 +#define __NR_signalfd4 309 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_socket 17 +#define __NR_socketpair 56 +#define __NR_splice 291 +#define __NR_ssetmask 69 +#define __NR_stat 18 +#define __NR_stat64 101 +#define __NR_statfs 99 +#define __NR_statfs64 298 +#define __NR_statx 349 +#define __NR_stime 25 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 284 +#define __NR_sync 36 +#define __NR_sync_file_range 292 +#define __NR_syncfs 327 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 293 +#define __NR_tgkill 259 +#define __NR_time 13 +#define __NR_timer_create 250 +#define __NR_timer_delete 254 +#define __NR_timer_getoverrun 253 +#define __NR_timer_gettime 252 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 251 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 306 +#define __NR_timerfd_gettime 308 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 307 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 208 +#define __NR_truncate 92 +#define __NR_truncate64 199 +#define __NR_umask 60 +#define __NR_umount2 52 +#define __NR_uname 59 +#define __NR_unlink 10 +#define __NR_unlinkat 281 +#define __NR_unshare 288 +#define __NR_uselib 86 +#define __NR_userfaultfd 344 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 301 +#define __NR_utimensat_time64 412 +#define __NR_utimes 336 +#define __NR_vfork 113 +#define __NR_vhangup 111 +#define __NR_vmsplice 294 +#define __NR_wait4 114 +#define __NR_waitid 235 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/i386/arch-syscall.h b/sysdeps/unix/sysv/linux/i386/arch-syscall.h new file mode 100644 index 0000000000..2463eba1e4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/arch-syscall.h @@ -0,0 +1,425 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept4 364 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 286 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_arch_prctl 384 +#define __NR_bdflush 134 +#define __NR_bind 361 +#define __NR_bpf 357 +#define __NR_break 17 +#define __NR_brk 45 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 182 +#define __NR_chown32 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 343 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 266 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 265 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 267 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 264 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 362 +#define __NR_copy_file_range 377 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 330 +#define __NR_epoll_create 254 +#define __NR_epoll_create1 329 +#define __NR_epoll_ctl 255 +#define __NR_epoll_pwait 319 +#define __NR_epoll_wait 256 +#define __NR_eventfd 323 +#define __NR_eventfd2 328 +#define __NR_execve 11 +#define __NR_execveat 358 +#define __NR_exit 1 +#define __NR_exit_group 252 +#define __NR_faccessat 307 +#define __NR_fadvise64 250 +#define __NR_fadvise64_64 272 +#define __NR_fallocate 324 +#define __NR_fanotify_init 338 +#define __NR_fanotify_mark 339 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 306 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 298 +#define __NR_fcntl 55 +#define __NR_fcntl64 221 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 231 +#define __NR_finit_module 350 +#define __NR_flistxattr 234 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 237 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 228 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 300 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 269 +#define __NR_fsync 118 +#define __NR_ftime 35 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 240 +#define __NR_futex_time64 422 +#define __NR_futimesat 299 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 275 +#define __NR_get_robust_list 312 +#define __NR_get_thread_area 244 +#define __NR_getcpu 318 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpeername 368 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 188 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 355 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 367 +#define __NR_getsockopt 365 +#define __NR_gettid 224 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 229 +#define __NR_gtty 32 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 292 +#define __NR_inotify_init 291 +#define __NR_inotify_init1 332 +#define __NR_inotify_rm_watch 293 +#define __NR_io_cancel 249 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_pgetevents 385 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 245 +#define __NR_io_submit 248 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioperm 101 +#define __NR_iopl 110 +#define __NR_ioprio_get 290 +#define __NR_ioprio_set 289 +#define __NR_ipc 117 +#define __NR_kcmp 349 +#define __NR_kexec_load 283 +#define __NR_keyctl 288 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 198 +#define __NR_lgetxattr 230 +#define __NR_link 9 +#define __NR_linkat 303 +#define __NR_listen 363 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_lock 53 +#define __NR_lookup_dcookie 253 +#define __NR_lremovexattr 236 +#define __NR_lseek 19 +#define __NR_lsetxattr 227 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 219 +#define __NR_mbind 274 +#define __NR_membarrier 375 +#define __NR_memfd_create 356 +#define __NR_migrate_pages 294 +#define __NR_mincore 218 +#define __NR_mkdir 39 +#define __NR_mkdirat 296 +#define __NR_mknod 14 +#define __NR_mknodat 297 +#define __NR_mlock 150 +#define __NR_mlock2 376 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_modify_ldt 123 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 317 +#define __NR_mprotect 125 +#define __NR_mpx 56 +#define __NR_mq_getsetattr 282 +#define __NR_mq_notify 281 +#define __NR_mq_open 277 +#define __NR_mq_timedreceive 280 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 279 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 278 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 341 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldolduname 59 +#define __NR_oldstat 18 +#define __NR_olduname 109 +#define __NR_open 5 +#define __NR_open_by_handle_at 342 +#define __NR_open_tree 428 +#define __NR_openat 295 +#define __NR_pause 29 +#define __NR_perf_event_open 336 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 331 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 381 +#define __NR_pkey_free 382 +#define __NR_pkey_mprotect 380 +#define __NR_poll 168 +#define __NR_ppoll 309 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 333 +#define __NR_preadv2 378 +#define __NR_prlimit64 340 +#define __NR_process_vm_readv 347 +#define __NR_process_vm_writev 348 +#define __NR_prof 44 +#define __NR_profil 98 +#define __NR_pselect6 308 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_putpmsg 189 +#define __NR_pwrite64 181 +#define __NR_pwritev 334 +#define __NR_pwritev2 379 +#define __NR_query_module 167 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 225 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 305 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recvfrom 371 +#define __NR_recvmmsg 337 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 372 +#define __NR_remap_file_pages 257 +#define __NR_removexattr 235 +#define __NR_rename 38 +#define __NR_renameat 302 +#define __NR_renameat2 353 +#define __NR_request_key 287 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 386 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 335 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 242 +#define __NR_sched_getattr 352 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 241 +#define __NR_sched_setattr 351 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 354 +#define __NR_select 82 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile 187 +#define __NR_sendfile64 239 +#define __NR_sendmmsg 345 +#define __NR_sendmsg 370 +#define __NR_sendto 369 +#define __NR_set_mempolicy 276 +#define __NR_set_robust_list 311 +#define __NR_set_thread_area 243 +#define __NR_set_tid_address 258 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 346 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 366 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 226 +#define __NR_sgetmask 68 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 373 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 321 +#define __NR_signalfd4 327 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 359 +#define __NR_socketcall 102 +#define __NR_socketpair 360 +#define __NR_splice 313 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 268 +#define __NR_statx 383 +#define __NR_stime 25 +#define __NR_stty 31 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 304 +#define __NR_sync 36 +#define __NR_sync_file_range 314 +#define __NR_syncfs 344 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 315 +#define __NR_tgkill 270 +#define __NR_time 13 +#define __NR_timer_create 259 +#define __NR_timer_delete 263 +#define __NR_timer_getoverrun 262 +#define __NR_timer_gettime 261 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 260 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 322 +#define __NR_timerfd_gettime 326 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 325 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 238 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_ulimit 58 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 301 +#define __NR_unshare 310 +#define __NR_uselib 86 +#define __NR_userfaultfd 374 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 320 +#define __NR_utimensat_time64 412 +#define __NR_utimes 271 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vm86 166 +#define __NR_vm86old 113 +#define __NR_vmsplice 316 +#define __NR_vserver 273 +#define __NR_wait4 114 +#define __NR_waitid 284 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/ia64/arch-syscall.h b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h new file mode 100644 index 0000000000..d890bed9b4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/arch-syscall.h @@ -0,0 +1,340 @@ +#define __NR__sysctl 1150 +#define __NR_accept 1194 +#define __NR_accept4 1334 +#define __NR_access 1049 +#define __NR_acct 1064 +#define __NR_add_key 1271 +#define __NR_adjtimex 1131 +#define __NR_afs_syscall 1141 +#define __NR_bdflush 1138 +#define __NR_bind 1191 +#define __NR_bpf 1341 +#define __NR_brk 1060 +#define __NR_capget 1185 +#define __NR_capset 1186 +#define __NR_chdir 1034 +#define __NR_chmod 1038 +#define __NR_chown 1039 +#define __NR_chroot 1068 +#define __NR_clock_adjtime 1328 +#define __NR_clock_getres 1255 +#define __NR_clock_gettime 1254 +#define __NR_clock_nanosleep 1256 +#define __NR_clock_settime 1253 +#define __NR_clone 1128 +#define __NR_clone2 1213 +#define __NR_close 1029 +#define __NR_connect 1192 +#define __NR_copy_file_range 1347 +#define __NR_creat 1030 +#define __NR_delete_module 1134 +#define __NR_dup 1057 +#define __NR_dup2 1070 +#define __NR_dup3 1316 +#define __NR_epoll_create 1243 +#define __NR_epoll_create1 1315 +#define __NR_epoll_ctl 1244 +#define __NR_epoll_pwait 1305 +#define __NR_epoll_wait 1245 +#define __NR_eventfd 1309 +#define __NR_eventfd2 1314 +#define __NR_execve 1033 +#define __NR_execveat 1342 +#define __NR_exit 1025 +#define __NR_exit_group 1236 +#define __NR_faccessat 1293 +#define __NR_fadvise64 1234 +#define __NR_fallocate 1303 +#define __NR_fanotify_init 1323 +#define __NR_fanotify_mark 1324 +#define __NR_fchdir 1035 +#define __NR_fchmod 1099 +#define __NR_fchmodat 1292 +#define __NR_fchown 1100 +#define __NR_fchownat 1284 +#define __NR_fcntl 1066 +#define __NR_fdatasync 1052 +#define __NR_fgetxattr 1222 +#define __NR_finit_module 1335 +#define __NR_flistxattr 1225 +#define __NR_flock 1145 +#define __NR_fremovexattr 1228 +#define __NR_fsconfig 1455 +#define __NR_fsetxattr 1219 +#define __NR_fsmount 1456 +#define __NR_fsopen 1454 +#define __NR_fspick 1457 +#define __NR_fstat 1212 +#define __NR_fstatfs 1104 +#define __NR_fstatfs64 1257 +#define __NR_fsync 1051 +#define __NR_ftruncate 1098 +#define __NR_futex 1230 +#define __NR_futimesat 1285 +#define __NR_get_mempolicy 1260 +#define __NR_get_robust_list 1299 +#define __NR_getcpu 1304 +#define __NR_getcwd 1184 +#define __NR_getdents 1144 +#define __NR_getdents64 1214 +#define __NR_getegid 1063 +#define __NR_geteuid 1047 +#define __NR_getgid 1062 +#define __NR_getgroups 1077 +#define __NR_getitimer 1119 +#define __NR_getpeername 1196 +#define __NR_getpgid 1079 +#define __NR_getpid 1041 +#define __NR_getpmsg 1188 +#define __NR_getppid 1042 +#define __NR_getpriority 1101 +#define __NR_getrandom 1339 +#define __NR_getresgid 1075 +#define __NR_getresuid 1073 +#define __NR_getrlimit 1085 +#define __NR_getrusage 1086 +#define __NR_getsid 1082 +#define __NR_getsockname 1195 +#define __NR_getsockopt 1204 +#define __NR_gettid 1105 +#define __NR_gettimeofday 1087 +#define __NR_getuid 1046 +#define __NR_getunwind 1215 +#define __NR_getxattr 1220 +#define __NR_init_module 1133 +#define __NR_inotify_add_watch 1278 +#define __NR_inotify_init 1277 +#define __NR_inotify_init1 1318 +#define __NR_inotify_rm_watch 1279 +#define __NR_io_cancel 1242 +#define __NR_io_destroy 1239 +#define __NR_io_getevents 1240 +#define __NR_io_pgetevents 1351 +#define __NR_io_setup 1238 +#define __NR_io_submit 1241 +#define __NR_io_uring_enter 1450 +#define __NR_io_uring_register 1451 +#define __NR_io_uring_setup 1449 +#define __NR_ioctl 1065 +#define __NR_ioprio_get 1275 +#define __NR_ioprio_set 1274 +#define __NR_kcmp 1345 +#define __NR_kexec_load 1268 +#define __NR_keyctl 1273 +#define __NR_kill 1053 +#define __NR_lchown 1124 +#define __NR_lgetxattr 1221 +#define __NR_link 1031 +#define __NR_linkat 1289 +#define __NR_listen 1193 +#define __NR_listxattr 1223 +#define __NR_llistxattr 1224 +#define __NR_lookup_dcookie 1237 +#define __NR_lremovexattr 1227 +#define __NR_lseek 1040 +#define __NR_lsetxattr 1218 +#define __NR_lstat 1211 +#define __NR_madvise 1209 +#define __NR_mbind 1259 +#define __NR_membarrier 1344 +#define __NR_memfd_create 1340 +#define __NR_migrate_pages 1280 +#define __NR_mincore 1208 +#define __NR_mkdir 1055 +#define __NR_mkdirat 1282 +#define __NR_mknod 1037 +#define __NR_mknodat 1283 +#define __NR_mlock 1153 +#define __NR_mlock2 1346 +#define __NR_mlockall 1154 +#define __NR_mmap 1151 +#define __NR_mmap2 1172 +#define __NR_mount 1043 +#define __NR_move_mount 1453 +#define __NR_move_pages 1276 +#define __NR_mprotect 1155 +#define __NR_mq_getsetattr 1267 +#define __NR_mq_notify 1266 +#define __NR_mq_open 1262 +#define __NR_mq_timedreceive 1265 +#define __NR_mq_timedsend 1264 +#define __NR_mq_unlink 1263 +#define __NR_mremap 1156 +#define __NR_msgctl 1112 +#define __NR_msgget 1109 +#define __NR_msgrcv 1111 +#define __NR_msgsnd 1110 +#define __NR_msync 1157 +#define __NR_munlock 1158 +#define __NR_munlockall 1159 +#define __NR_munmap 1152 +#define __NR_name_to_handle_at 1326 +#define __NR_nanosleep 1168 +#define __NR_newfstatat 1286 +#define __NR_nfsservctl 1169 +#define __NR_ni_syscall 1024 +#define __NR_old_getpagesize 1171 +#define __NR_open 1028 +#define __NR_open_by_handle_at 1327 +#define __NR_open_tree 1452 +#define __NR_openat 1281 +#define __NR_pciconfig_read 1173 +#define __NR_pciconfig_write 1174 +#define __NR_perf_event_open 1352 +#define __NR_perfmonctl 1175 +#define __NR_personality 1140 +#define __NR_pidfd_open 1458 +#define __NR_pidfd_send_signal 1448 +#define __NR_pipe 1058 +#define __NR_pipe2 1317 +#define __NR_pivot_root 1207 +#define __NR_pkey_alloc 1355 +#define __NR_pkey_free 1356 +#define __NR_pkey_mprotect 1354 +#define __NR_poll 1090 +#define __NR_ppoll 1295 +#define __NR_prctl 1170 +#define __NR_pread64 1148 +#define __NR_preadv 1319 +#define __NR_preadv2 1348 +#define __NR_prlimit64 1325 +#define __NR_process_vm_readv 1332 +#define __NR_process_vm_writev 1333 +#define __NR_pselect6 1294 +#define __NR_ptrace 1048 +#define __NR_putpmsg 1189 +#define __NR_pwrite64 1149 +#define __NR_pwritev 1320 +#define __NR_pwritev2 1349 +#define __NR_quotactl 1137 +#define __NR_read 1026 +#define __NR_readahead 1216 +#define __NR_readlink 1092 +#define __NR_readlinkat 1291 +#define __NR_readv 1146 +#define __NR_reboot 1096 +#define __NR_recv 1200 +#define __NR_recvfrom 1201 +#define __NR_recvmmsg 1322 +#define __NR_recvmsg 1206 +#define __NR_remap_file_pages 1125 +#define __NR_removexattr 1226 +#define __NR_rename 1054 +#define __NR_renameat 1288 +#define __NR_renameat2 1338 +#define __NR_request_key 1272 +#define __NR_restart_syscall 1246 +#define __NR_rmdir 1056 +#define __NR_rseq 1357 +#define __NR_rt_sigaction 1177 +#define __NR_rt_sigpending 1178 +#define __NR_rt_sigprocmask 1179 +#define __NR_rt_sigqueueinfo 1180 +#define __NR_rt_sigreturn 1181 +#define __NR_rt_sigsuspend 1182 +#define __NR_rt_sigtimedwait 1183 +#define __NR_rt_tgsigqueueinfo 1321 +#define __NR_sched_get_priority_max 1165 +#define __NR_sched_get_priority_min 1166 +#define __NR_sched_getaffinity 1232 +#define __NR_sched_getattr 1337 +#define __NR_sched_getparam 1160 +#define __NR_sched_getscheduler 1162 +#define __NR_sched_rr_get_interval 1167 +#define __NR_sched_setaffinity 1231 +#define __NR_sched_setattr 1336 +#define __NR_sched_setparam 1161 +#define __NR_sched_setscheduler 1163 +#define __NR_sched_yield 1164 +#define __NR_seccomp 1353 +#define __NR_select 1089 +#define __NR_semctl 1108 +#define __NR_semget 1106 +#define __NR_semop 1107 +#define __NR_semtimedop 1247 +#define __NR_send 1198 +#define __NR_sendfile 1187 +#define __NR_sendmmsg 1331 +#define __NR_sendmsg 1205 +#define __NR_sendto 1199 +#define __NR_set_mempolicy 1261 +#define __NR_set_robust_list 1298 +#define __NR_set_tid_address 1233 +#define __NR_setdomainname 1129 +#define __NR_setfsgid 1143 +#define __NR_setfsuid 1142 +#define __NR_setgid 1061 +#define __NR_setgroups 1078 +#define __NR_sethostname 1083 +#define __NR_setitimer 1118 +#define __NR_setns 1330 +#define __NR_setpgid 1080 +#define __NR_setpriority 1102 +#define __NR_setregid 1072 +#define __NR_setresgid 1076 +#define __NR_setresuid 1074 +#define __NR_setreuid 1071 +#define __NR_setrlimit 1084 +#define __NR_setsid 1081 +#define __NR_setsockopt 1203 +#define __NR_settimeofday 1088 +#define __NR_setuid 1045 +#define __NR_setxattr 1217 +#define __NR_shmat 1114 +#define __NR_shmctl 1116 +#define __NR_shmdt 1115 +#define __NR_shmget 1113 +#define __NR_shutdown 1202 +#define __NR_sigaltstack 1176 +#define __NR_signalfd 1307 +#define __NR_signalfd4 1313 +#define __NR_socket 1190 +#define __NR_socketpair 1197 +#define __NR_splice 1297 +#define __NR_stat 1210 +#define __NR_statfs 1103 +#define __NR_statfs64 1258 +#define __NR_statx 1350 +#define __NR_swapoff 1095 +#define __NR_swapon 1094 +#define __NR_symlink 1091 +#define __NR_symlinkat 1290 +#define __NR_sync 1050 +#define __NR_sync_file_range 1300 +#define __NR_syncfs 1329 +#define __NR_sysfs 1139 +#define __NR_sysinfo 1127 +#define __NR_syslog 1117 +#define __NR_tee 1301 +#define __NR_tgkill 1235 +#define __NR_timer_create 1248 +#define __NR_timer_delete 1252 +#define __NR_timer_getoverrun 1251 +#define __NR_timer_gettime 1250 +#define __NR_timer_settime 1249 +#define __NR_timerfd 1308 +#define __NR_timerfd_create 1310 +#define __NR_timerfd_gettime 1312 +#define __NR_timerfd_settime 1311 +#define __NR_times 1059 +#define __NR_tkill 1229 +#define __NR_truncate 1097 +#define __NR_umask 1067 +#define __NR_umount 1044 +#define __NR_umount2 1044 +#define __NR_uname 1130 +#define __NR_unlink 1032 +#define __NR_unlinkat 1287 +#define __NR_unshare 1296 +#define __NR_uselib 1093 +#define __NR_userfaultfd 1343 +#define __NR_ustat 1069 +#define __NR_utimensat 1306 +#define __NR_utimes 1036 +#define __NR_vhangup 1123 +#define __NR_vmsplice 1302 +#define __NR_vserver 1269 +#define __NR_wait4 1126 +#define __NR_waitid 1270 +#define __NR_write 1027 +#define __NR_writev 1147 diff --git a/sysdeps/unix/sysv/linux/m68k/arch-syscall.h b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h new file mode 100644 index 0000000000..9f914c053f --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/arch-syscall.h @@ -0,0 +1,407 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept4 361 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 279 +#define __NR_adjtimex 124 +#define __NR_alarm 27 +#define __NR_atomic_barrier 336 +#define __NR_atomic_cmpxchg_32 335 +#define __NR_bdflush 134 +#define __NR_bind 358 +#define __NR_bpf 354 +#define __NR_brk 45 +#define __NR_cacheflush 123 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 16 +#define __NR_chown32 198 +#define __NR_chroot 61 +#define __NR_clock_adjtime 342 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 261 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 260 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 262 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 259 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_close 6 +#define __NR_connect 359 +#define __NR_copy_file_range 376 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 326 +#define __NR_epoll_create 249 +#define __NR_epoll_create1 325 +#define __NR_epoll_ctl 250 +#define __NR_epoll_pwait 315 +#define __NR_epoll_wait 251 +#define __NR_eventfd 319 +#define __NR_eventfd2 324 +#define __NR_execve 11 +#define __NR_execveat 355 +#define __NR_exit 1 +#define __NR_exit_group 247 +#define __NR_faccessat 300 +#define __NR_fadvise64 246 +#define __NR_fadvise64_64 267 +#define __NR_fallocate 320 +#define __NR_fanotify_init 337 +#define __NR_fanotify_mark 338 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 299 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 291 +#define __NR_fcntl 55 +#define __NR_fcntl64 239 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 228 +#define __NR_finit_module 348 +#define __NR_flistxattr 231 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 234 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 225 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 293 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 264 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 235 +#define __NR_futex_time64 422 +#define __NR_futimesat 292 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 269 +#define __NR_get_robust_list 305 +#define __NR_get_thread_area 333 +#define __NR_getcpu 314 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpagesize 166 +#define __NR_getpeername 365 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 188 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 352 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 364 +#define __NR_getsockopt 362 +#define __NR_gettid 221 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 226 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_init 284 +#define __NR_inotify_init1 328 +#define __NR_inotify_rm_watch 286 +#define __NR_io_cancel 245 +#define __NR_io_destroy 242 +#define __NR_io_getevents 243 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 241 +#define __NR_io_submit 244 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 283 +#define __NR_ioprio_set 282 +#define __NR_ipc 117 +#define __NR_kcmp 347 +#define __NR_kexec_load 313 +#define __NR_keyctl 281 +#define __NR_kill 37 +#define __NR_lchown 182 +#define __NR_lchown32 212 +#define __NR_lgetxattr 227 +#define __NR_link 9 +#define __NR_linkat 296 +#define __NR_listen 360 +#define __NR_listxattr 229 +#define __NR_llistxattr 230 +#define __NR_lookup_dcookie 248 +#define __NR_lremovexattr 233 +#define __NR_lseek 19 +#define __NR_lsetxattr 224 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 238 +#define __NR_mbind 268 +#define __NR_membarrier 374 +#define __NR_memfd_create 353 +#define __NR_migrate_pages 287 +#define __NR_mincore 237 +#define __NR_mkdir 39 +#define __NR_mkdirat 289 +#define __NR_mknod 14 +#define __NR_mknodat 290 +#define __NR_mlock 150 +#define __NR_mlock2 375 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 310 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 276 +#define __NR_mq_notify 275 +#define __NR_mq_open 271 +#define __NR_mq_timedreceive 274 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 273 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 272 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 340 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldstat 18 +#define __NR_open 5 +#define __NR_open_by_handle_at 341 +#define __NR_open_tree 428 +#define __NR_openat 288 +#define __NR_pause 29 +#define __NR_perf_event_open 332 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 327 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 382 +#define __NR_pkey_free 383 +#define __NR_pkey_mprotect 381 +#define __NR_poll 168 +#define __NR_ppoll 302 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 329 +#define __NR_preadv2 377 +#define __NR_prlimit64 339 +#define __NR_process_vm_readv 345 +#define __NR_process_vm_writev 346 +#define __NR_pselect6 301 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_putpmsg 189 +#define __NR_pwrite64 181 +#define __NR_pwritev 330 +#define __NR_pwritev2 378 +#define __NR_query_module 167 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 240 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 298 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recvfrom 368 +#define __NR_recvmmsg 371 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 369 +#define __NR_remap_file_pages 252 +#define __NR_removexattr 232 +#define __NR_rename 38 +#define __NR_renameat 295 +#define __NR_renameat2 351 +#define __NR_request_key 280 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 384 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 331 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 312 +#define __NR_sched_getattr 350 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 311 +#define __NR_sched_setattr 349 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 380 +#define __NR_select 82 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile 187 +#define __NR_sendfile64 236 +#define __NR_sendmmsg 372 +#define __NR_sendmsg 367 +#define __NR_sendto 366 +#define __NR_set_mempolicy 270 +#define __NR_set_robust_list 304 +#define __NR_set_thread_area 334 +#define __NR_set_tid_address 253 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 344 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 363 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 223 +#define __NR_sgetmask 68 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 370 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 317 +#define __NR_signalfd4 323 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 356 +#define __NR_socketcall 102 +#define __NR_socketpair 357 +#define __NR_splice 306 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 263 +#define __NR_statx 379 +#define __NR_stime 25 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 297 +#define __NR_sync 36 +#define __NR_sync_file_range 307 +#define __NR_syncfs 343 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 308 +#define __NR_tgkill 265 +#define __NR_time 13 +#define __NR_timer_create 254 +#define __NR_timer_delete 258 +#define __NR_timer_getoverrun 257 +#define __NR_timer_gettime 256 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 255 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 318 +#define __NR_timerfd_gettime 322 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 321 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 222 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 294 +#define __NR_unshare 303 +#define __NR_uselib 86 +#define __NR_userfaultfd 373 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 316 +#define __NR_utimensat_time64 412 +#define __NR_utimes 266 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vmsplice 309 +#define __NR_wait4 114 +#define __NR_waitid 277 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h new file mode 100644 index 0000000000..e3c16d6299 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h @@ -0,0 +1,429 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 349 +#define __NR_accept4 362 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 286 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 347 +#define __NR_bpf 387 +#define __NR_break 17 +#define __NR_brk 45 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 182 +#define __NR_chown32 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 373 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 266 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 265 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 267 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 264 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 350 +#define __NR_copy_file_range 392 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 342 +#define __NR_epoll_create 254 +#define __NR_epoll_create1 341 +#define __NR_epoll_ctl 255 +#define __NR_epoll_pwait 319 +#define __NR_epoll_wait 256 +#define __NR_eventfd 323 +#define __NR_eventfd2 340 +#define __NR_execve 11 +#define __NR_execveat 388 +#define __NR_exit 1 +#define __NR_exit_group 252 +#define __NR_faccessat 307 +#define __NR_fadvise64 250 +#define __NR_fadvise64_64 272 +#define __NR_fallocate 324 +#define __NR_fanotify_init 368 +#define __NR_fanotify_mark 369 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 306 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 298 +#define __NR_fcntl 55 +#define __NR_fcntl64 221 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 231 +#define __NR_finit_module 380 +#define __NR_flistxattr 234 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 237 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 228 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 300 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 269 +#define __NR_fsync 118 +#define __NR_ftime 35 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 240 +#define __NR_futex_time64 422 +#define __NR_futimesat 299 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 275 +#define __NR_get_robust_list 312 +#define __NR_get_thread_area 244 +#define __NR_getcpu 318 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpeername 352 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 188 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 385 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 351 +#define __NR_getsockopt 358 +#define __NR_gettid 224 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 229 +#define __NR_gtty 32 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 292 +#define __NR_inotify_init 291 +#define __NR_inotify_init1 344 +#define __NR_inotify_rm_watch 293 +#define __NR_io_cancel 249 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_pgetevents 399 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 245 +#define __NR_io_submit 248 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioperm 101 +#define __NR_iopl 110 +#define __NR_ioprio_get 290 +#define __NR_ioprio_set 289 +#define __NR_ipc 117 +#define __NR_kcmp 379 +#define __NR_kexec_load 283 +#define __NR_keyctl 288 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 198 +#define __NR_lgetxattr 230 +#define __NR_link 9 +#define __NR_linkat 303 +#define __NR_listen 348 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_lock 53 +#define __NR_lookup_dcookie 253 +#define __NR_lremovexattr 236 +#define __NR_lseek 19 +#define __NR_lsetxattr 227 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 219 +#define __NR_mbind 274 +#define __NR_membarrier 390 +#define __NR_memfd_create 386 +#define __NR_migrate_pages 294 +#define __NR_mincore 218 +#define __NR_mkdir 39 +#define __NR_mkdirat 296 +#define __NR_mknod 14 +#define __NR_mknodat 297 +#define __NR_mlock 150 +#define __NR_mlock2 391 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_modify_ldt 123 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 317 +#define __NR_mprotect 125 +#define __NR_mpx 56 +#define __NR_mq_getsetattr 282 +#define __NR_mq_notify 281 +#define __NR_mq_open 277 +#define __NR_mq_timedreceive 280 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 279 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 278 +#define __NR_mremap 163 +#define __NR_msgctl 331 +#define __NR_msgget 332 +#define __NR_msgrcv 333 +#define __NR_msgsnd 334 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 371 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldolduname 59 +#define __NR_oldstat 18 +#define __NR_olduname 109 +#define __NR_open 5 +#define __NR_open_by_handle_at 372 +#define __NR_open_tree 428 +#define __NR_openat 295 +#define __NR_pause 29 +#define __NR_perf_event_open 366 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 343 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 396 +#define __NR_pkey_free 397 +#define __NR_pkey_mprotect 395 +#define __NR_poll 168 +#define __NR_ppoll 309 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 363 +#define __NR_preadv2 393 +#define __NR_prlimit64 370 +#define __NR_process_vm_readv 377 +#define __NR_process_vm_writev 378 +#define __NR_prof 44 +#define __NR_profil 98 +#define __NR_pselect6 308 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_putpmsg 189 +#define __NR_pwrite64 181 +#define __NR_pwritev 364 +#define __NR_pwritev2 394 +#define __NR_query_module 167 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 225 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 305 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 356 +#define __NR_recvfrom 355 +#define __NR_recvmmsg 367 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 361 +#define __NR_remap_file_pages 257 +#define __NR_removexattr 235 +#define __NR_rename 38 +#define __NR_renameat 302 +#define __NR_renameat2 383 +#define __NR_request_key 287 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 400 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 365 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 242 +#define __NR_sched_getattr 382 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 241 +#define __NR_sched_setattr 381 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 384 +#define __NR_select 82 +#define __NR_semctl 328 +#define __NR_semget 329 +#define __NR_semop 330 +#define __NR_semtimedop 325 +#define __NR_semtimedop_time64 420 +#define __NR_send 354 +#define __NR_sendfile 187 +#define __NR_sendfile64 239 +#define __NR_sendmmsg 376 +#define __NR_sendmsg 360 +#define __NR_sendto 353 +#define __NR_set_mempolicy 276 +#define __NR_set_robust_list 311 +#define __NR_set_thread_area 243 +#define __NR_set_tid_address 258 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 375 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 357 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 226 +#define __NR_sgetmask 68 +#define __NR_shmat 335 +#define __NR_shmctl 336 +#define __NR_shmdt 337 +#define __NR_shmget 338 +#define __NR_shutdown 359 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 321 +#define __NR_signalfd4 339 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 345 +#define __NR_socketcall 102 +#define __NR_socketpair 346 +#define __NR_splice 313 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 268 +#define __NR_statx 398 +#define __NR_stime 25 +#define __NR_stty 31 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 304 +#define __NR_sync 36 +#define __NR_sync_file_range 314 +#define __NR_syncfs 374 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 315 +#define __NR_tgkill 270 +#define __NR_time 13 +#define __NR_timer_create 259 +#define __NR_timer_delete 263 +#define __NR_timer_getoverrun 262 +#define __NR_timer_gettime 261 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 260 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 322 +#define __NR_timerfd_gettime 327 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 326 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 238 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_ulimit 58 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 301 +#define __NR_unshare 310 +#define __NR_uselib 86 +#define __NR_userfaultfd 389 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 320 +#define __NR_utimensat_time64 412 +#define __NR_utimes 271 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vm86 166 +#define __NR_vm86old 113 +#define __NR_vmsplice 316 +#define __NR_vserver 273 +#define __NR_wait4 114 +#define __NR_waitid 284 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h new file mode 100644 index 0000000000..13467b2bd6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/arch-syscall.h @@ -0,0 +1,402 @@ +#define __NR__llseek 4140 +#define __NR__newselect 4142 +#define __NR__sysctl 4153 +#define __NR_accept 4168 +#define __NR_accept4 4334 +#define __NR_access 4033 +#define __NR_acct 4051 +#define __NR_add_key 4280 +#define __NR_adjtimex 4124 +#define __NR_afs_syscall 4137 +#define __NR_alarm 4027 +#define __NR_bdflush 4134 +#define __NR_bind 4169 +#define __NR_bpf 4355 +#define __NR_break 4017 +#define __NR_brk 4045 +#define __NR_cachectl 4148 +#define __NR_cacheflush 4147 +#define __NR_capget 4204 +#define __NR_capset 4205 +#define __NR_chdir 4012 +#define __NR_chmod 4015 +#define __NR_chown 4202 +#define __NR_chroot 4061 +#define __NR_clock_adjtime 4341 +#define __NR_clock_adjtime64 4405 +#define __NR_clock_getres 4264 +#define __NR_clock_getres_time64 4406 +#define __NR_clock_gettime 4263 +#define __NR_clock_gettime64 4403 +#define __NR_clock_nanosleep 4265 +#define __NR_clock_nanosleep_time64 4407 +#define __NR_clock_settime 4262 +#define __NR_clock_settime64 4404 +#define __NR_clone 4120 +#define __NR_clone3 4435 +#define __NR_close 4006 +#define __NR_connect 4170 +#define __NR_copy_file_range 4360 +#define __NR_creat 4008 +#define __NR_create_module 4127 +#define __NR_delete_module 4129 +#define __NR_dup 4041 +#define __NR_dup2 4063 +#define __NR_dup3 4327 +#define __NR_epoll_create 4248 +#define __NR_epoll_create1 4326 +#define __NR_epoll_ctl 4249 +#define __NR_epoll_pwait 4313 +#define __NR_epoll_wait 4250 +#define __NR_eventfd 4319 +#define __NR_eventfd2 4325 +#define __NR_execve 4011 +#define __NR_execveat 4356 +#define __NR_exit 4001 +#define __NR_exit_group 4246 +#define __NR_faccessat 4300 +#define __NR_fadvise64 4254 +#define __NR_fallocate 4320 +#define __NR_fanotify_init 4336 +#define __NR_fanotify_mark 4337 +#define __NR_fchdir 4133 +#define __NR_fchmod 4094 +#define __NR_fchmodat 4299 +#define __NR_fchown 4095 +#define __NR_fchownat 4291 +#define __NR_fcntl 4055 +#define __NR_fcntl64 4220 +#define __NR_fdatasync 4152 +#define __NR_fgetxattr 4229 +#define __NR_finit_module 4348 +#define __NR_flistxattr 4232 +#define __NR_flock 4143 +#define __NR_fork 4002 +#define __NR_fremovexattr 4235 +#define __NR_fsconfig 4431 +#define __NR_fsetxattr 4226 +#define __NR_fsmount 4432 +#define __NR_fsopen 4430 +#define __NR_fspick 4433 +#define __NR_fstat 4108 +#define __NR_fstat64 4215 +#define __NR_fstatat64 4293 +#define __NR_fstatfs 4100 +#define __NR_fstatfs64 4256 +#define __NR_fsync 4118 +#define __NR_ftime 4035 +#define __NR_ftruncate 4093 +#define __NR_ftruncate64 4212 +#define __NR_futex 4238 +#define __NR_futex_time64 4422 +#define __NR_futimesat 4292 +#define __NR_get_kernel_syms 4130 +#define __NR_get_mempolicy 4269 +#define __NR_get_robust_list 4310 +#define __NR_getcpu 4312 +#define __NR_getcwd 4203 +#define __NR_getdents 4141 +#define __NR_getdents64 4219 +#define __NR_getegid 4050 +#define __NR_geteuid 4049 +#define __NR_getgid 4047 +#define __NR_getgroups 4080 +#define __NR_getitimer 4105 +#define __NR_getpeername 4171 +#define __NR_getpgid 4132 +#define __NR_getpgrp 4065 +#define __NR_getpid 4020 +#define __NR_getpmsg 4208 +#define __NR_getppid 4064 +#define __NR_getpriority 4096 +#define __NR_getrandom 4353 +#define __NR_getresgid 4191 +#define __NR_getresuid 4186 +#define __NR_getrlimit 4076 +#define __NR_getrusage 4077 +#define __NR_getsid 4151 +#define __NR_getsockname 4172 +#define __NR_getsockopt 4173 +#define __NR_gettid 4222 +#define __NR_gettimeofday 4078 +#define __NR_getuid 4024 +#define __NR_getxattr 4227 +#define __NR_gtty 4032 +#define __NR_idle 4112 +#define __NR_init_module 4128 +#define __NR_inotify_add_watch 4285 +#define __NR_inotify_init 4284 +#define __NR_inotify_init1 4329 +#define __NR_inotify_rm_watch 4286 +#define __NR_io_cancel 4245 +#define __NR_io_destroy 4242 +#define __NR_io_getevents 4243 +#define __NR_io_pgetevents 4368 +#define __NR_io_pgetevents_time64 4416 +#define __NR_io_setup 4241 +#define __NR_io_submit 4244 +#define __NR_io_uring_enter 4426 +#define __NR_io_uring_register 4427 +#define __NR_io_uring_setup 4425 +#define __NR_ioctl 4054 +#define __NR_ioperm 4101 +#define __NR_iopl 4110 +#define __NR_ioprio_get 4315 +#define __NR_ioprio_set 4314 +#define __NR_ipc 4117 +#define __NR_kcmp 4347 +#define __NR_kexec_load 4311 +#define __NR_keyctl 4282 +#define __NR_kill 4037 +#define __NR_lchown 4016 +#define __NR_lgetxattr 4228 +#define __NR_link 4009 +#define __NR_linkat 4296 +#define __NR_listen 4174 +#define __NR_listxattr 4230 +#define __NR_llistxattr 4231 +#define __NR_lock 4053 +#define __NR_lookup_dcookie 4247 +#define __NR_lremovexattr 4234 +#define __NR_lseek 4019 +#define __NR_lsetxattr 4225 +#define __NR_lstat 4107 +#define __NR_lstat64 4214 +#define __NR_madvise 4218 +#define __NR_mbind 4268 +#define __NR_membarrier 4358 +#define __NR_memfd_create 4354 +#define __NR_migrate_pages 4287 +#define __NR_mincore 4217 +#define __NR_mkdir 4039 +#define __NR_mkdirat 4289 +#define __NR_mknod 4014 +#define __NR_mknodat 4290 +#define __NR_mlock 4154 +#define __NR_mlock2 4359 +#define __NR_mlockall 4156 +#define __NR_mmap 4090 +#define __NR_mmap2 4210 +#define __NR_modify_ldt 4123 +#define __NR_mount 4021 +#define __NR_move_mount 4429 +#define __NR_move_pages 4308 +#define __NR_mprotect 4125 +#define __NR_mpx 4056 +#define __NR_mq_getsetattr 4276 +#define __NR_mq_notify 4275 +#define __NR_mq_open 4271 +#define __NR_mq_timedreceive 4274 +#define __NR_mq_timedreceive_time64 4419 +#define __NR_mq_timedsend 4273 +#define __NR_mq_timedsend_time64 4418 +#define __NR_mq_unlink 4272 +#define __NR_mremap 4167 +#define __NR_msgctl 4402 +#define __NR_msgget 4399 +#define __NR_msgrcv 4401 +#define __NR_msgsnd 4400 +#define __NR_msync 4144 +#define __NR_munlock 4155 +#define __NR_munlockall 4157 +#define __NR_munmap 4091 +#define __NR_name_to_handle_at 4339 +#define __NR_nanosleep 4166 +#define __NR_nfsservctl 4189 +#define __NR_nice 4034 +#define __NR_open 4005 +#define __NR_open_by_handle_at 4340 +#define __NR_open_tree 4428 +#define __NR_openat 4288 +#define __NR_pause 4029 +#define __NR_perf_event_open 4333 +#define __NR_personality 4136 +#define __NR_pidfd_open 4434 +#define __NR_pidfd_send_signal 4424 +#define __NR_pipe 4042 +#define __NR_pipe2 4328 +#define __NR_pivot_root 4216 +#define __NR_pkey_alloc 4364 +#define __NR_pkey_free 4365 +#define __NR_pkey_mprotect 4363 +#define __NR_poll 4188 +#define __NR_ppoll 4302 +#define __NR_ppoll_time64 4414 +#define __NR_prctl 4192 +#define __NR_pread64 4200 +#define __NR_preadv 4330 +#define __NR_preadv2 4361 +#define __NR_prlimit64 4338 +#define __NR_process_vm_readv 4345 +#define __NR_process_vm_writev 4346 +#define __NR_prof 4044 +#define __NR_profil 4098 +#define __NR_pselect6 4301 +#define __NR_pselect6_time64 4413 +#define __NR_ptrace 4026 +#define __NR_putpmsg 4209 +#define __NR_pwrite64 4201 +#define __NR_pwritev 4331 +#define __NR_pwritev2 4362 +#define __NR_query_module 4187 +#define __NR_quotactl 4131 +#define __NR_read 4003 +#define __NR_readahead 4223 +#define __NR_readdir 4089 +#define __NR_readlink 4085 +#define __NR_readlinkat 4298 +#define __NR_readv 4145 +#define __NR_reboot 4088 +#define __NR_recv 4175 +#define __NR_recvfrom 4176 +#define __NR_recvmmsg 4335 +#define __NR_recvmmsg_time64 4417 +#define __NR_recvmsg 4177 +#define __NR_remap_file_pages 4251 +#define __NR_removexattr 4233 +#define __NR_rename 4038 +#define __NR_renameat 4295 +#define __NR_renameat2 4351 +#define __NR_request_key 4281 +#define __NR_restart_syscall 4253 +#define __NR_rmdir 4040 +#define __NR_rseq 4367 +#define __NR_rt_sigaction 4194 +#define __NR_rt_sigpending 4196 +#define __NR_rt_sigprocmask 4195 +#define __NR_rt_sigqueueinfo 4198 +#define __NR_rt_sigreturn 4193 +#define __NR_rt_sigsuspend 4199 +#define __NR_rt_sigtimedwait 4197 +#define __NR_rt_sigtimedwait_time64 4421 +#define __NR_rt_tgsigqueueinfo 4332 +#define __NR_sched_get_priority_max 4163 +#define __NR_sched_get_priority_min 4164 +#define __NR_sched_getaffinity 4240 +#define __NR_sched_getattr 4350 +#define __NR_sched_getparam 4159 +#define __NR_sched_getscheduler 4161 +#define __NR_sched_rr_get_interval 4165 +#define __NR_sched_rr_get_interval_time64 4423 +#define __NR_sched_setaffinity 4239 +#define __NR_sched_setattr 4349 +#define __NR_sched_setparam 4158 +#define __NR_sched_setscheduler 4160 +#define __NR_sched_yield 4162 +#define __NR_seccomp 4352 +#define __NR_semctl 4394 +#define __NR_semget 4393 +#define __NR_semtimedop_time64 4420 +#define __NR_send 4178 +#define __NR_sendfile 4207 +#define __NR_sendfile64 4237 +#define __NR_sendmmsg 4343 +#define __NR_sendmsg 4179 +#define __NR_sendto 4180 +#define __NR_set_mempolicy 4270 +#define __NR_set_robust_list 4309 +#define __NR_set_thread_area 4283 +#define __NR_set_tid_address 4252 +#define __NR_setdomainname 4121 +#define __NR_setfsgid 4139 +#define __NR_setfsuid 4138 +#define __NR_setgid 4046 +#define __NR_setgroups 4081 +#define __NR_sethostname 4074 +#define __NR_setitimer 4104 +#define __NR_setns 4344 +#define __NR_setpgid 4057 +#define __NR_setpriority 4097 +#define __NR_setregid 4071 +#define __NR_setresgid 4190 +#define __NR_setresuid 4185 +#define __NR_setreuid 4070 +#define __NR_setrlimit 4075 +#define __NR_setsid 4066 +#define __NR_setsockopt 4181 +#define __NR_settimeofday 4079 +#define __NR_setuid 4023 +#define __NR_setxattr 4224 +#define __NR_sgetmask 4068 +#define __NR_shmat 4397 +#define __NR_shmctl 4396 +#define __NR_shmdt 4398 +#define __NR_shmget 4395 +#define __NR_shutdown 4182 +#define __NR_sigaction 4067 +#define __NR_sigaltstack 4206 +#define __NR_signal 4048 +#define __NR_signalfd 4317 +#define __NR_signalfd4 4324 +#define __NR_sigpending 4073 +#define __NR_sigprocmask 4126 +#define __NR_sigreturn 4119 +#define __NR_sigsuspend 4072 +#define __NR_socket 4183 +#define __NR_socketcall 4102 +#define __NR_socketpair 4184 +#define __NR_splice 4304 +#define __NR_ssetmask 4069 +#define __NR_stat 4106 +#define __NR_stat64 4213 +#define __NR_statfs 4099 +#define __NR_statfs64 4255 +#define __NR_statx 4366 +#define __NR_stime 4025 +#define __NR_stty 4031 +#define __NR_swapoff 4115 +#define __NR_swapon 4087 +#define __NR_symlink 4083 +#define __NR_symlinkat 4297 +#define __NR_sync 4036 +#define __NR_sync_file_range 4305 +#define __NR_syncfs 4342 +#define __NR_syscall 4000 +#define __NR_sysfs 4135 +#define __NR_sysinfo 4116 +#define __NR_syslog 4103 +#define __NR_sysmips 4149 +#define __NR_tee 4306 +#define __NR_tgkill 4266 +#define __NR_time 4013 +#define __NR_timer_create 4257 +#define __NR_timer_delete 4261 +#define __NR_timer_getoverrun 4260 +#define __NR_timer_gettime 4259 +#define __NR_timer_gettime64 4408 +#define __NR_timer_settime 4258 +#define __NR_timer_settime64 4409 +#define __NR_timerfd 4318 +#define __NR_timerfd_create 4321 +#define __NR_timerfd_gettime 4322 +#define __NR_timerfd_gettime64 4410 +#define __NR_timerfd_settime 4323 +#define __NR_timerfd_settime64 4411 +#define __NR_times 4043 +#define __NR_tkill 4236 +#define __NR_truncate 4092 +#define __NR_truncate64 4211 +#define __NR_ulimit 4058 +#define __NR_umask 4060 +#define __NR_umount 4022 +#define __NR_umount2 4052 +#define __NR_uname 4122 +#define __NR_unlink 4010 +#define __NR_unlinkat 4294 +#define __NR_unshare 4303 +#define __NR_uselib 4086 +#define __NR_userfaultfd 4357 +#define __NR_ustat 4062 +#define __NR_utime 4030 +#define __NR_utimensat 4316 +#define __NR_utimensat_time64 4412 +#define __NR_utimes 4267 +#define __NR_vhangup 4111 +#define __NR_vm86 4113 +#define __NR_vmsplice 4307 +#define __NR_vserver 4277 +#define __NR_wait4 4114 +#define __NR_waitid 4278 +#define __NR_waitpid 4007 +#define __NR_write 4004 +#define __NR_writev 4146 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h new file mode 100644 index 0000000000..b4e72caa5c --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/arch-syscall.h @@ -0,0 +1,362 @@ +#define __NR__newselect 6022 +#define __NR__sysctl 6152 +#define __NR_accept 6042 +#define __NR_accept4 6297 +#define __NR_access 6020 +#define __NR_acct 6158 +#define __NR_add_key 6243 +#define __NR_adjtimex 6154 +#define __NR_afs_syscall 6176 +#define __NR_alarm 6037 +#define __NR_bind 6048 +#define __NR_bpf 6319 +#define __NR_brk 6012 +#define __NR_cachectl 6198 +#define __NR_cacheflush 6197 +#define __NR_capget 6123 +#define __NR_capset 6124 +#define __NR_chdir 6078 +#define __NR_chmod 6088 +#define __NR_chown 6090 +#define __NR_chroot 6156 +#define __NR_clock_adjtime 6305 +#define __NR_clock_adjtime64 6405 +#define __NR_clock_getres 6227 +#define __NR_clock_getres_time64 6406 +#define __NR_clock_gettime 6226 +#define __NR_clock_gettime64 6403 +#define __NR_clock_nanosleep 6228 +#define __NR_clock_nanosleep_time64 6407 +#define __NR_clock_settime 6225 +#define __NR_clock_settime64 6404 +#define __NR_clone 6055 +#define __NR_clone3 6435 +#define __NR_close 6003 +#define __NR_connect 6041 +#define __NR_copy_file_range 6324 +#define __NR_creat 6083 +#define __NR_create_module 6167 +#define __NR_delete_module 6169 +#define __NR_dup 6031 +#define __NR_dup2 6032 +#define __NR_dup3 6290 +#define __NR_epoll_create 6207 +#define __NR_epoll_create1 6289 +#define __NR_epoll_ctl 6208 +#define __NR_epoll_pwait 6276 +#define __NR_epoll_wait 6209 +#define __NR_eventfd 6282 +#define __NR_eventfd2 6288 +#define __NR_execve 6057 +#define __NR_execveat 6320 +#define __NR_exit 6058 +#define __NR_exit_group 6205 +#define __NR_faccessat 6263 +#define __NR_fadvise64 6216 +#define __NR_fallocate 6283 +#define __NR_fanotify_init 6300 +#define __NR_fanotify_mark 6301 +#define __NR_fchdir 6079 +#define __NR_fchmod 6089 +#define __NR_fchmodat 6262 +#define __NR_fchown 6091 +#define __NR_fchownat 6254 +#define __NR_fcntl 6070 +#define __NR_fcntl64 6212 +#define __NR_fdatasync 6073 +#define __NR_fgetxattr 6185 +#define __NR_finit_module 6312 +#define __NR_flistxattr 6188 +#define __NR_flock 6071 +#define __NR_fork 6056 +#define __NR_fremovexattr 6191 +#define __NR_fsconfig 6431 +#define __NR_fsetxattr 6182 +#define __NR_fsmount 6432 +#define __NR_fsopen 6430 +#define __NR_fspick 6433 +#define __NR_fstat 6005 +#define __NR_fstatfs 6135 +#define __NR_fstatfs64 6218 +#define __NR_fsync 6072 +#define __NR_ftruncate 6075 +#define __NR_futex 6194 +#define __NR_futex_time64 6422 +#define __NR_futimesat 6255 +#define __NR_get_kernel_syms 6170 +#define __NR_get_mempolicy 6232 +#define __NR_get_robust_list 6273 +#define __NR_getcpu 6275 +#define __NR_getcwd 6077 +#define __NR_getdents 6076 +#define __NR_getdents64 6299 +#define __NR_getegid 6106 +#define __NR_geteuid 6105 +#define __NR_getgid 6102 +#define __NR_getgroups 6113 +#define __NR_getitimer 6035 +#define __NR_getpeername 6051 +#define __NR_getpgid 6119 +#define __NR_getpgrp 6109 +#define __NR_getpid 6038 +#define __NR_getpmsg 6174 +#define __NR_getppid 6108 +#define __NR_getpriority 6137 +#define __NR_getrandom 6317 +#define __NR_getresgid 6118 +#define __NR_getresuid 6116 +#define __NR_getrlimit 6095 +#define __NR_getrusage 6096 +#define __NR_getsid 6122 +#define __NR_getsockname 6050 +#define __NR_getsockopt 6054 +#define __NR_gettid 6178 +#define __NR_gettimeofday 6094 +#define __NR_getuid 6100 +#define __NR_getxattr 6183 +#define __NR_init_module 6168 +#define __NR_inotify_add_watch 6248 +#define __NR_inotify_init 6247 +#define __NR_inotify_init1 6292 +#define __NR_inotify_rm_watch 6249 +#define __NR_io_cancel 6204 +#define __NR_io_destroy 6201 +#define __NR_io_getevents 6202 +#define __NR_io_pgetevents 6332 +#define __NR_io_pgetevents_time64 6416 +#define __NR_io_setup 6200 +#define __NR_io_submit 6203 +#define __NR_io_uring_enter 6426 +#define __NR_io_uring_register 6427 +#define __NR_io_uring_setup 6425 +#define __NR_ioctl 6015 +#define __NR_ioprio_get 6278 +#define __NR_ioprio_set 6277 +#define __NR_kcmp 6311 +#define __NR_kexec_load 6274 +#define __NR_keyctl 6245 +#define __NR_kill 6060 +#define __NR_lchown 6092 +#define __NR_lgetxattr 6184 +#define __NR_link 6084 +#define __NR_linkat 6259 +#define __NR_listen 6049 +#define __NR_listxattr 6186 +#define __NR_llistxattr 6187 +#define __NR_lookup_dcookie 6206 +#define __NR_lremovexattr 6190 +#define __NR_lseek 6008 +#define __NR_lsetxattr 6181 +#define __NR_lstat 6006 +#define __NR_madvise 6027 +#define __NR_mbind 6231 +#define __NR_membarrier 6322 +#define __NR_memfd_create 6318 +#define __NR_migrate_pages 6250 +#define __NR_mincore 6026 +#define __NR_mkdir 6081 +#define __NR_mkdirat 6252 +#define __NR_mknod 6131 +#define __NR_mknodat 6253 +#define __NR_mlock 6146 +#define __NR_mlock2 6323 +#define __NR_mlockall 6148 +#define __NR_mmap 6009 +#define __NR_mount 6160 +#define __NR_move_mount 6429 +#define __NR_move_pages 6271 +#define __NR_mprotect 6010 +#define __NR_mq_getsetattr 6239 +#define __NR_mq_notify 6238 +#define __NR_mq_open 6234 +#define __NR_mq_timedreceive 6237 +#define __NR_mq_timedreceive_time64 6419 +#define __NR_mq_timedsend 6236 +#define __NR_mq_timedsend_time64 6418 +#define __NR_mq_unlink 6235 +#define __NR_mremap 6024 +#define __NR_msgctl 6069 +#define __NR_msgget 6066 +#define __NR_msgrcv 6068 +#define __NR_msgsnd 6067 +#define __NR_msync 6025 +#define __NR_munlock 6147 +#define __NR_munlockall 6149 +#define __NR_munmap 6011 +#define __NR_name_to_handle_at 6303 +#define __NR_nanosleep 6034 +#define __NR_newfstatat 6256 +#define __NR_nfsservctl 6173 +#define __NR_open 6002 +#define __NR_open_by_handle_at 6304 +#define __NR_open_tree 6428 +#define __NR_openat 6251 +#define __NR_pause 6033 +#define __NR_perf_event_open 6296 +#define __NR_personality 6132 +#define __NR_pidfd_open 6434 +#define __NR_pidfd_send_signal 6424 +#define __NR_pipe 6021 +#define __NR_pipe2 6291 +#define __NR_pivot_root 6151 +#define __NR_pkey_alloc 6328 +#define __NR_pkey_free 6329 +#define __NR_pkey_mprotect 6327 +#define __NR_poll 6007 +#define __NR_ppoll 6265 +#define __NR_ppoll_time64 6414 +#define __NR_prctl 6153 +#define __NR_pread64 6016 +#define __NR_preadv 6293 +#define __NR_preadv2 6325 +#define __NR_prlimit64 6302 +#define __NR_process_vm_readv 6309 +#define __NR_process_vm_writev 6310 +#define __NR_pselect6 6264 +#define __NR_pselect6_time64 6413 +#define __NR_ptrace 6099 +#define __NR_putpmsg 6175 +#define __NR_pwrite64 6017 +#define __NR_pwritev 6294 +#define __NR_pwritev2 6326 +#define __NR_query_module 6171 +#define __NR_quotactl 6172 +#define __NR_read 6000 +#define __NR_readahead 6179 +#define __NR_readlink 6087 +#define __NR_readlinkat 6261 +#define __NR_readv 6018 +#define __NR_reboot 6164 +#define __NR_recvfrom 6044 +#define __NR_recvmmsg 6298 +#define __NR_recvmmsg_time64 6417 +#define __NR_recvmsg 6046 +#define __NR_remap_file_pages 6210 +#define __NR_removexattr 6189 +#define __NR_rename 6080 +#define __NR_renameat 6258 +#define __NR_renameat2 6315 +#define __NR_request_key 6244 +#define __NR_restart_syscall 6214 +#define __NR_rmdir 6082 +#define __NR_rseq 6331 +#define __NR_rt_sigaction 6013 +#define __NR_rt_sigpending 6125 +#define __NR_rt_sigprocmask 6014 +#define __NR_rt_sigqueueinfo 6127 +#define __NR_rt_sigreturn 6211 +#define __NR_rt_sigsuspend 6128 +#define __NR_rt_sigtimedwait 6126 +#define __NR_rt_sigtimedwait_time64 6421 +#define __NR_rt_tgsigqueueinfo 6295 +#define __NR_sched_get_priority_max 6143 +#define __NR_sched_get_priority_min 6144 +#define __NR_sched_getaffinity 6196 +#define __NR_sched_getattr 6314 +#define __NR_sched_getparam 6140 +#define __NR_sched_getscheduler 6142 +#define __NR_sched_rr_get_interval 6145 +#define __NR_sched_rr_get_interval_time64 6423 +#define __NR_sched_setaffinity 6195 +#define __NR_sched_setattr 6313 +#define __NR_sched_setparam 6139 +#define __NR_sched_setscheduler 6141 +#define __NR_sched_yield 6023 +#define __NR_seccomp 6316 +#define __NR_semctl 6064 +#define __NR_semget 6062 +#define __NR_semop 6063 +#define __NR_semtimedop 6215 +#define __NR_semtimedop_time64 6420 +#define __NR_sendfile 6039 +#define __NR_sendfile64 6219 +#define __NR_sendmmsg 6307 +#define __NR_sendmsg 6045 +#define __NR_sendto 6043 +#define __NR_set_mempolicy 6233 +#define __NR_set_robust_list 6272 +#define __NR_set_thread_area 6246 +#define __NR_set_tid_address 6213 +#define __NR_setdomainname 6166 +#define __NR_setfsgid 6121 +#define __NR_setfsuid 6120 +#define __NR_setgid 6104 +#define __NR_setgroups 6114 +#define __NR_sethostname 6165 +#define __NR_setitimer 6036 +#define __NR_setns 6308 +#define __NR_setpgid 6107 +#define __NR_setpriority 6138 +#define __NR_setregid 6112 +#define __NR_setresgid 6117 +#define __NR_setresuid 6115 +#define __NR_setreuid 6111 +#define __NR_setrlimit 6155 +#define __NR_setsid 6110 +#define __NR_setsockopt 6053 +#define __NR_settimeofday 6159 +#define __NR_setuid 6103 +#define __NR_setxattr 6180 +#define __NR_shmat 6029 +#define __NR_shmctl 6030 +#define __NR_shmdt 6065 +#define __NR_shmget 6028 +#define __NR_shutdown 6047 +#define __NR_sigaltstack 6129 +#define __NR_signalfd 6280 +#define __NR_signalfd4 6287 +#define __NR_socket 6040 +#define __NR_socketpair 6052 +#define __NR_splice 6267 +#define __NR_stat 6004 +#define __NR_statfs 6134 +#define __NR_statfs64 6217 +#define __NR_statx 6330 +#define __NR_swapoff 6163 +#define __NR_swapon 6162 +#define __NR_symlink 6086 +#define __NR_symlinkat 6260 +#define __NR_sync 6157 +#define __NR_sync_file_range 6268 +#define __NR_syncfs 6306 +#define __NR_sysfs 6136 +#define __NR_sysinfo 6097 +#define __NR_syslog 6101 +#define __NR_sysmips 6199 +#define __NR_tee 6269 +#define __NR_tgkill 6229 +#define __NR_timer_create 6220 +#define __NR_timer_delete 6224 +#define __NR_timer_getoverrun 6223 +#define __NR_timer_gettime 6222 +#define __NR_timer_gettime64 6408 +#define __NR_timer_settime 6221 +#define __NR_timer_settime64 6409 +#define __NR_timerfd 6281 +#define __NR_timerfd_create 6284 +#define __NR_timerfd_gettime 6285 +#define __NR_timerfd_gettime64 6410 +#define __NR_timerfd_settime 6286 +#define __NR_timerfd_settime64 6411 +#define __NR_times 6098 +#define __NR_tkill 6192 +#define __NR_truncate 6074 +#define __NR_umask 6093 +#define __NR_umount2 6161 +#define __NR_uname 6061 +#define __NR_unlink 6085 +#define __NR_unlinkat 6257 +#define __NR_unshare 6266 +#define __NR_userfaultfd 6321 +#define __NR_ustat 6133 +#define __NR_utime 6130 +#define __NR_utimensat 6279 +#define __NR_utimensat_time64 6412 +#define __NR_utimes 6230 +#define __NR_vhangup 6150 +#define __NR_vmsplice 6270 +#define __NR_vserver 6240 +#define __NR_wait4 6059 +#define __NR_waitid 6241 +#define __NR_write 6001 +#define __NR_writev 6019 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h new file mode 100644 index 0000000000..f330540608 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/arch-syscall.h @@ -0,0 +1,338 @@ +#define __NR__newselect 5022 +#define __NR__sysctl 5152 +#define __NR_accept 5042 +#define __NR_accept4 5293 +#define __NR_access 5020 +#define __NR_acct 5158 +#define __NR_add_key 5239 +#define __NR_adjtimex 5154 +#define __NR_afs_syscall 5176 +#define __NR_alarm 5037 +#define __NR_bind 5048 +#define __NR_bpf 5315 +#define __NR_brk 5012 +#define __NR_cachectl 5198 +#define __NR_cacheflush 5197 +#define __NR_capget 5123 +#define __NR_capset 5124 +#define __NR_chdir 5078 +#define __NR_chmod 5088 +#define __NR_chown 5090 +#define __NR_chroot 5156 +#define __NR_clock_adjtime 5300 +#define __NR_clock_getres 5223 +#define __NR_clock_gettime 5222 +#define __NR_clock_nanosleep 5224 +#define __NR_clock_settime 5221 +#define __NR_clone 5055 +#define __NR_clone3 5435 +#define __NR_close 5003 +#define __NR_connect 5041 +#define __NR_copy_file_range 5320 +#define __NR_creat 5083 +#define __NR_create_module 5167 +#define __NR_delete_module 5169 +#define __NR_dup 5031 +#define __NR_dup2 5032 +#define __NR_dup3 5286 +#define __NR_epoll_create 5207 +#define __NR_epoll_create1 5285 +#define __NR_epoll_ctl 5208 +#define __NR_epoll_pwait 5272 +#define __NR_epoll_wait 5209 +#define __NR_eventfd 5278 +#define __NR_eventfd2 5284 +#define __NR_execve 5057 +#define __NR_execveat 5316 +#define __NR_exit 5058 +#define __NR_exit_group 5205 +#define __NR_faccessat 5259 +#define __NR_fadvise64 5215 +#define __NR_fallocate 5279 +#define __NR_fanotify_init 5295 +#define __NR_fanotify_mark 5296 +#define __NR_fchdir 5079 +#define __NR_fchmod 5089 +#define __NR_fchmodat 5258 +#define __NR_fchown 5091 +#define __NR_fchownat 5250 +#define __NR_fcntl 5070 +#define __NR_fdatasync 5073 +#define __NR_fgetxattr 5185 +#define __NR_finit_module 5307 +#define __NR_flistxattr 5188 +#define __NR_flock 5071 +#define __NR_fork 5056 +#define __NR_fremovexattr 5191 +#define __NR_fsconfig 5431 +#define __NR_fsetxattr 5182 +#define __NR_fsmount 5432 +#define __NR_fsopen 5430 +#define __NR_fspick 5433 +#define __NR_fstat 5005 +#define __NR_fstatfs 5135 +#define __NR_fsync 5072 +#define __NR_ftruncate 5075 +#define __NR_futex 5194 +#define __NR_futimesat 5251 +#define __NR_get_kernel_syms 5170 +#define __NR_get_mempolicy 5228 +#define __NR_get_robust_list 5269 +#define __NR_getcpu 5271 +#define __NR_getcwd 5077 +#define __NR_getdents 5076 +#define __NR_getdents64 5308 +#define __NR_getegid 5106 +#define __NR_geteuid 5105 +#define __NR_getgid 5102 +#define __NR_getgroups 5113 +#define __NR_getitimer 5035 +#define __NR_getpeername 5051 +#define __NR_getpgid 5119 +#define __NR_getpgrp 5109 +#define __NR_getpid 5038 +#define __NR_getpmsg 5174 +#define __NR_getppid 5108 +#define __NR_getpriority 5137 +#define __NR_getrandom 5313 +#define __NR_getresgid 5118 +#define __NR_getresuid 5116 +#define __NR_getrlimit 5095 +#define __NR_getrusage 5096 +#define __NR_getsid 5122 +#define __NR_getsockname 5050 +#define __NR_getsockopt 5054 +#define __NR_gettid 5178 +#define __NR_gettimeofday 5094 +#define __NR_getuid 5100 +#define __NR_getxattr 5183 +#define __NR_init_module 5168 +#define __NR_inotify_add_watch 5244 +#define __NR_inotify_init 5243 +#define __NR_inotify_init1 5288 +#define __NR_inotify_rm_watch 5245 +#define __NR_io_cancel 5204 +#define __NR_io_destroy 5201 +#define __NR_io_getevents 5202 +#define __NR_io_pgetevents 5328 +#define __NR_io_setup 5200 +#define __NR_io_submit 5203 +#define __NR_io_uring_enter 5426 +#define __NR_io_uring_register 5427 +#define __NR_io_uring_setup 5425 +#define __NR_ioctl 5015 +#define __NR_ioprio_get 5274 +#define __NR_ioprio_set 5273 +#define __NR_kcmp 5306 +#define __NR_kexec_load 5270 +#define __NR_keyctl 5241 +#define __NR_kill 5060 +#define __NR_lchown 5092 +#define __NR_lgetxattr 5184 +#define __NR_link 5084 +#define __NR_linkat 5255 +#define __NR_listen 5049 +#define __NR_listxattr 5186 +#define __NR_llistxattr 5187 +#define __NR_lookup_dcookie 5206 +#define __NR_lremovexattr 5190 +#define __NR_lseek 5008 +#define __NR_lsetxattr 5181 +#define __NR_lstat 5006 +#define __NR_madvise 5027 +#define __NR_mbind 5227 +#define __NR_membarrier 5318 +#define __NR_memfd_create 5314 +#define __NR_migrate_pages 5246 +#define __NR_mincore 5026 +#define __NR_mkdir 5081 +#define __NR_mkdirat 5248 +#define __NR_mknod 5131 +#define __NR_mknodat 5249 +#define __NR_mlock 5146 +#define __NR_mlock2 5319 +#define __NR_mlockall 5148 +#define __NR_mmap 5009 +#define __NR_mount 5160 +#define __NR_move_mount 5429 +#define __NR_move_pages 5267 +#define __NR_mprotect 5010 +#define __NR_mq_getsetattr 5235 +#define __NR_mq_notify 5234 +#define __NR_mq_open 5230 +#define __NR_mq_timedreceive 5233 +#define __NR_mq_timedsend 5232 +#define __NR_mq_unlink 5231 +#define __NR_mremap 5024 +#define __NR_msgctl 5069 +#define __NR_msgget 5066 +#define __NR_msgrcv 5068 +#define __NR_msgsnd 5067 +#define __NR_msync 5025 +#define __NR_munlock 5147 +#define __NR_munlockall 5149 +#define __NR_munmap 5011 +#define __NR_name_to_handle_at 5298 +#define __NR_nanosleep 5034 +#define __NR_newfstatat 5252 +#define __NR_nfsservctl 5173 +#define __NR_open 5002 +#define __NR_open_by_handle_at 5299 +#define __NR_open_tree 5428 +#define __NR_openat 5247 +#define __NR_pause 5033 +#define __NR_perf_event_open 5292 +#define __NR_personality 5132 +#define __NR_pidfd_open 5434 +#define __NR_pidfd_send_signal 5424 +#define __NR_pipe 5021 +#define __NR_pipe2 5287 +#define __NR_pivot_root 5151 +#define __NR_pkey_alloc 5324 +#define __NR_pkey_free 5325 +#define __NR_pkey_mprotect 5323 +#define __NR_poll 5007 +#define __NR_ppoll 5261 +#define __NR_prctl 5153 +#define __NR_pread64 5016 +#define __NR_preadv 5289 +#define __NR_preadv2 5321 +#define __NR_prlimit64 5297 +#define __NR_process_vm_readv 5304 +#define __NR_process_vm_writev 5305 +#define __NR_pselect6 5260 +#define __NR_ptrace 5099 +#define __NR_putpmsg 5175 +#define __NR_pwrite64 5017 +#define __NR_pwritev 5290 +#define __NR_pwritev2 5322 +#define __NR_query_module 5171 +#define __NR_quotactl 5172 +#define __NR_read 5000 +#define __NR_readahead 5179 +#define __NR_readlink 5087 +#define __NR_readlinkat 5257 +#define __NR_readv 5018 +#define __NR_reboot 5164 +#define __NR_recvfrom 5044 +#define __NR_recvmmsg 5294 +#define __NR_recvmsg 5046 +#define __NR_remap_file_pages 5210 +#define __NR_removexattr 5189 +#define __NR_rename 5080 +#define __NR_renameat 5254 +#define __NR_renameat2 5311 +#define __NR_request_key 5240 +#define __NR_restart_syscall 5213 +#define __NR_rmdir 5082 +#define __NR_rseq 5327 +#define __NR_rt_sigaction 5013 +#define __NR_rt_sigpending 5125 +#define __NR_rt_sigprocmask 5014 +#define __NR_rt_sigqueueinfo 5127 +#define __NR_rt_sigreturn 5211 +#define __NR_rt_sigsuspend 5128 +#define __NR_rt_sigtimedwait 5126 +#define __NR_rt_tgsigqueueinfo 5291 +#define __NR_sched_get_priority_max 5143 +#define __NR_sched_get_priority_min 5144 +#define __NR_sched_getaffinity 5196 +#define __NR_sched_getattr 5310 +#define __NR_sched_getparam 5140 +#define __NR_sched_getscheduler 5142 +#define __NR_sched_rr_get_interval 5145 +#define __NR_sched_setaffinity 5195 +#define __NR_sched_setattr 5309 +#define __NR_sched_setparam 5139 +#define __NR_sched_setscheduler 5141 +#define __NR_sched_yield 5023 +#define __NR_seccomp 5312 +#define __NR_semctl 5064 +#define __NR_semget 5062 +#define __NR_semop 5063 +#define __NR_semtimedop 5214 +#define __NR_sendfile 5039 +#define __NR_sendmmsg 5302 +#define __NR_sendmsg 5045 +#define __NR_sendto 5043 +#define __NR_set_mempolicy 5229 +#define __NR_set_robust_list 5268 +#define __NR_set_thread_area 5242 +#define __NR_set_tid_address 5212 +#define __NR_setdomainname 5166 +#define __NR_setfsgid 5121 +#define __NR_setfsuid 5120 +#define __NR_setgid 5104 +#define __NR_setgroups 5114 +#define __NR_sethostname 5165 +#define __NR_setitimer 5036 +#define __NR_setns 5303 +#define __NR_setpgid 5107 +#define __NR_setpriority 5138 +#define __NR_setregid 5112 +#define __NR_setresgid 5117 +#define __NR_setresuid 5115 +#define __NR_setreuid 5111 +#define __NR_setrlimit 5155 +#define __NR_setsid 5110 +#define __NR_setsockopt 5053 +#define __NR_settimeofday 5159 +#define __NR_setuid 5103 +#define __NR_setxattr 5180 +#define __NR_shmat 5029 +#define __NR_shmctl 5030 +#define __NR_shmdt 5065 +#define __NR_shmget 5028 +#define __NR_shutdown 5047 +#define __NR_sigaltstack 5129 +#define __NR_signalfd 5276 +#define __NR_signalfd4 5283 +#define __NR_socket 5040 +#define __NR_socketpair 5052 +#define __NR_splice 5263 +#define __NR_stat 5004 +#define __NR_statfs 5134 +#define __NR_statx 5326 +#define __NR_swapoff 5163 +#define __NR_swapon 5162 +#define __NR_symlink 5086 +#define __NR_symlinkat 5256 +#define __NR_sync 5157 +#define __NR_sync_file_range 5264 +#define __NR_syncfs 5301 +#define __NR_sysfs 5136 +#define __NR_sysinfo 5097 +#define __NR_syslog 5101 +#define __NR_sysmips 5199 +#define __NR_tee 5265 +#define __NR_tgkill 5225 +#define __NR_timer_create 5216 +#define __NR_timer_delete 5220 +#define __NR_timer_getoverrun 5219 +#define __NR_timer_gettime 5218 +#define __NR_timer_settime 5217 +#define __NR_timerfd 5277 +#define __NR_timerfd_create 5280 +#define __NR_timerfd_gettime 5281 +#define __NR_timerfd_settime 5282 +#define __NR_times 5098 +#define __NR_tkill 5192 +#define __NR_truncate 5074 +#define __NR_umask 5093 +#define __NR_umount2 5161 +#define __NR_uname 5061 +#define __NR_unlink 5085 +#define __NR_unlinkat 5253 +#define __NR_unshare 5262 +#define __NR_userfaultfd 5317 +#define __NR_ustat 5133 +#define __NR_utime 5130 +#define __NR_utimensat 5275 +#define __NR_utimes 5226 +#define __NR_vhangup 5150 +#define __NR_vmsplice 5266 +#define __NR_vserver 5236 +#define __NR_wait4 5059 +#define __NR_waitid 5237 +#define __NR_write 5001 +#define __NR_writev 5019 diff --git a/sysdeps/unix/sysv/linux/nios2/arch-syscall.h b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h new file mode 100644 index 0000000000..7622377db3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/nios2/arch-syscall.h @@ -0,0 +1,311 @@ +#define __NR_accept 202 +#define __NR_accept4 242 +#define __NR_acct 89 +#define __NR_add_key 217 +#define __NR_adjtimex 171 +#define __NR_bind 200 +#define __NR_bpf 280 +#define __NR_brk 214 +#define __NR_cacheflush 244 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_chdir 49 +#define __NR_chroot 51 +#define __NR_clock_adjtime 266 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 114 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 113 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 115 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 112 +#define __NR_clock_settime64 404 +#define __NR_clone 220 +#define __NR_close 57 +#define __NR_connect 203 +#define __NR_copy_file_range 285 +#define __NR_delete_module 106 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_eventfd2 19 +#define __NR_execve 221 +#define __NR_execveat 281 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_faccessat 48 +#define __NR_fadvise64_64 223 +#define __NR_fallocate 47 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_fchdir 50 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchown 55 +#define __NR_fchownat 54 +#define __NR_fcntl64 25 +#define __NR_fdatasync 83 +#define __NR_fgetxattr 10 +#define __NR_finit_module 273 +#define __NR_flistxattr 13 +#define __NR_flock 32 +#define __NR_fremovexattr 16 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 7 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat64 80 +#define __NR_fstatat64 79 +#define __NR_fstatfs64 44 +#define __NR_fsync 82 +#define __NR_ftruncate64 46 +#define __NR_futex 98 +#define __NR_futex_time64 422 +#define __NR_get_mempolicy 236 +#define __NR_get_robust_list 100 +#define __NR_getcpu 168 +#define __NR_getcwd 17 +#define __NR_getdents64 61 +#define __NR_getegid 177 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getgroups 158 +#define __NR_getitimer 102 +#define __NR_getpeername 205 +#define __NR_getpgid 155 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getpriority 141 +#define __NR_getrandom 278 +#define __NR_getresgid 150 +#define __NR_getresuid 148 +#define __NR_getrlimit 163 +#define __NR_getrusage 165 +#define __NR_getsid 156 +#define __NR_getsockname 204 +#define __NR_getsockopt 209 +#define __NR_gettid 178 +#define __NR_gettimeofday 169 +#define __NR_getuid 174 +#define __NR_getxattr 8 +#define __NR_init_module 105 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_init1 26 +#define __NR_inotify_rm_watch 28 +#define __NR_io_cancel 3 +#define __NR_io_destroy 1 +#define __NR_io_getevents 4 +#define __NR_io_pgetevents 292 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 0 +#define __NR_io_submit 2 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 29 +#define __NR_ioprio_get 31 +#define __NR_ioprio_set 30 +#define __NR_kcmp 272 +#define __NR_kexec_file_load 294 +#define __NR_kexec_load 104 +#define __NR_keyctl 219 +#define __NR_kill 129 +#define __NR_lgetxattr 9 +#define __NR_linkat 37 +#define __NR_listen 201 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_llseek 62 +#define __NR_lookup_dcookie 18 +#define __NR_lremovexattr 15 +#define __NR_lsetxattr 6 +#define __NR_madvise 233 +#define __NR_mbind 235 +#define __NR_membarrier 283 +#define __NR_memfd_create 279 +#define __NR_migrate_pages 238 +#define __NR_mincore 232 +#define __NR_mkdirat 34 +#define __NR_mknodat 33 +#define __NR_mlock 228 +#define __NR_mlock2 284 +#define __NR_mlockall 230 +#define __NR_mmap2 222 +#define __NR_mount 40 +#define __NR_move_mount 429 +#define __NR_move_pages 239 +#define __NR_mprotect 226 +#define __NR_mq_getsetattr 185 +#define __NR_mq_notify 184 +#define __NR_mq_open 180 +#define __NR_mq_timedreceive 183 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 181 +#define __NR_mremap 216 +#define __NR_msgctl 187 +#define __NR_msgget 186 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_msync 227 +#define __NR_munlock 229 +#define __NR_munlockall 231 +#define __NR_munmap 215 +#define __NR_name_to_handle_at 264 +#define __NR_nanosleep 101 +#define __NR_nfsservctl 42 +#define __NR_open_by_handle_at 265 +#define __NR_open_tree 428 +#define __NR_openat 56 +#define __NR_perf_event_open 241 +#define __NR_personality 92 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe2 59 +#define __NR_pivot_root 41 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_pkey_mprotect 288 +#define __NR_ppoll 73 +#define __NR_ppoll_time64 414 +#define __NR_prctl 167 +#define __NR_pread64 67 +#define __NR_preadv 69 +#define __NR_preadv2 286 +#define __NR_prlimit64 261 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_pselect6 72 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 117 +#define __NR_pwrite64 68 +#define __NR_pwritev 70 +#define __NR_pwritev2 287 +#define __NR_quotactl 60 +#define __NR_read 63 +#define __NR_readahead 213 +#define __NR_readlinkat 78 +#define __NR_readv 65 +#define __NR_reboot 142 +#define __NR_recvfrom 207 +#define __NR_recvmmsg 243 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 212 +#define __NR_remap_file_pages 234 +#define __NR_removexattr 14 +#define __NR_renameat 38 +#define __NR_renameat2 276 +#define __NR_request_key 218 +#define __NR_restart_syscall 128 +#define __NR_rseq 293 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_getaffinity 123 +#define __NR_sched_getattr 275 +#define __NR_sched_getparam 121 +#define __NR_sched_getscheduler 120 +#define __NR_sched_rr_get_interval 127 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 122 +#define __NR_sched_setattr 274 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_yield 124 +#define __NR_seccomp 277 +#define __NR_semctl 191 +#define __NR_semget 190 +#define __NR_semop 193 +#define __NR_semtimedop 192 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile64 71 +#define __NR_sendmmsg 269 +#define __NR_sendmsg 211 +#define __NR_sendto 206 +#define __NR_set_mempolicy 237 +#define __NR_set_robust_list 99 +#define __NR_set_tid_address 96 +#define __NR_setdomainname 162 +#define __NR_setfsgid 152 +#define __NR_setfsuid 151 +#define __NR_setgid 144 +#define __NR_setgroups 159 +#define __NR_sethostname 161 +#define __NR_setitimer 103 +#define __NR_setns 268 +#define __NR_setpgid 154 +#define __NR_setpriority 140 +#define __NR_setregid 143 +#define __NR_setresgid 149 +#define __NR_setresuid 147 +#define __NR_setreuid 145 +#define __NR_setrlimit 164 +#define __NR_setsid 157 +#define __NR_setsockopt 208 +#define __NR_settimeofday 170 +#define __NR_setuid 146 +#define __NR_setxattr 5 +#define __NR_shmat 196 +#define __NR_shmctl 195 +#define __NR_shmdt 197 +#define __NR_shmget 194 +#define __NR_shutdown 210 +#define __NR_sigaltstack 132 +#define __NR_signalfd4 74 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_splice 76 +#define __NR_statfs64 43 +#define __NR_statx 291 +#define __NR_swapoff 225 +#define __NR_swapon 224 +#define __NR_symlinkat 36 +#define __NR_sync 81 +#define __NR_sync_file_range 84 +#define __NR_syncfs 267 +#define __NR_sysinfo 179 +#define __NR_syslog 116 +#define __NR_tee 77 +#define __NR_tgkill 131 +#define __NR_timer_create 107 +#define __NR_timer_delete 111 +#define __NR_timer_getoverrun 109 +#define __NR_timer_gettime 108 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 110 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 85 +#define __NR_timerfd_gettime 87 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_settime64 411 +#define __NR_times 153 +#define __NR_tkill 130 +#define __NR_truncate64 45 +#define __NR_umask 166 +#define __NR_umount2 39 +#define __NR_uname 160 +#define __NR_unlinkat 35 +#define __NR_unshare 97 +#define __NR_userfaultfd 282 +#define __NR_utimensat 88 +#define __NR_utimensat_time64 412 +#define __NR_vhangup 58 +#define __NR_vmsplice 75 +#define __NR_wait4 260 +#define __NR_waitid 95 +#define __NR_write 64 +#define __NR_writev 66 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h new file mode 100644 index 0000000000..684748e84a --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/arch-syscall.h @@ -0,0 +1,417 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 330 +#define __NR_accept4 344 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 269 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 327 +#define __NR_bpf 361 +#define __NR_break 17 +#define __NR_brk 45 +#define __NR_capget 183 +#define __NR_capset 184 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 181 +#define __NR_chroot 61 +#define __NR_clock_adjtime 347 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 247 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 246 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 248 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 245 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 328 +#define __NR_copy_file_range 379 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 316 +#define __NR_epoll_create 236 +#define __NR_epoll_create1 315 +#define __NR_epoll_ctl 237 +#define __NR_epoll_pwait 303 +#define __NR_epoll_wait 238 +#define __NR_eventfd 307 +#define __NR_eventfd2 314 +#define __NR_execve 11 +#define __NR_execveat 362 +#define __NR_exit 1 +#define __NR_exit_group 234 +#define __NR_faccessat 298 +#define __NR_fadvise64 233 +#define __NR_fadvise64_64 254 +#define __NR_fallocate 309 +#define __NR_fanotify_init 323 +#define __NR_fanotify_mark 324 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 297 +#define __NR_fchown 95 +#define __NR_fchownat 289 +#define __NR_fcntl 55 +#define __NR_fcntl64 204 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 214 +#define __NR_finit_module 353 +#define __NR_flistxattr 217 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 220 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 211 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 291 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 253 +#define __NR_fsync 118 +#define __NR_ftime 35 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 221 +#define __NR_futex_time64 422 +#define __NR_futimesat 290 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 260 +#define __NR_get_robust_list 299 +#define __NR_getcpu 302 +#define __NR_getcwd 182 +#define __NR_getdents 141 +#define __NR_getdents64 202 +#define __NR_getegid 50 +#define __NR_geteuid 49 +#define __NR_getgid 47 +#define __NR_getgroups 80 +#define __NR_getitimer 105 +#define __NR_getpeername 332 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 187 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 359 +#define __NR_getresgid 170 +#define __NR_getresuid 165 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 331 +#define __NR_getsockopt 340 +#define __NR_gettid 207 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getxattr 212 +#define __NR_gtty 32 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 276 +#define __NR_inotify_init 275 +#define __NR_inotify_init1 318 +#define __NR_inotify_rm_watch 277 +#define __NR_io_cancel 231 +#define __NR_io_destroy 228 +#define __NR_io_getevents 229 +#define __NR_io_pgetevents 388 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 227 +#define __NR_io_submit 230 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioperm 101 +#define __NR_iopl 110 +#define __NR_ioprio_get 274 +#define __NR_ioprio_set 273 +#define __NR_ipc 117 +#define __NR_kcmp 354 +#define __NR_kexec_file_load 382 +#define __NR_kexec_load 268 +#define __NR_keyctl 271 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lgetxattr 213 +#define __NR_link 9 +#define __NR_linkat 294 +#define __NR_listen 329 +#define __NR_listxattr 215 +#define __NR_llistxattr 216 +#define __NR_lock 53 +#define __NR_lookup_dcookie 235 +#define __NR_lremovexattr 219 +#define __NR_lseek 19 +#define __NR_lsetxattr 210 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 205 +#define __NR_mbind 259 +#define __NR_membarrier 365 +#define __NR_memfd_create 360 +#define __NR_migrate_pages 258 +#define __NR_mincore 206 +#define __NR_mkdir 39 +#define __NR_mkdirat 287 +#define __NR_mknod 14 +#define __NR_mknodat 288 +#define __NR_mlock 150 +#define __NR_mlock2 378 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_modify_ldt 123 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 301 +#define __NR_mprotect 125 +#define __NR_mpx 56 +#define __NR_mq_getsetattr 267 +#define __NR_mq_notify 266 +#define __NR_mq_open 262 +#define __NR_mq_timedreceive 265 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 264 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 263 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_multiplexer 201 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 345 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 168 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldolduname 59 +#define __NR_oldstat 18 +#define __NR_olduname 109 +#define __NR_open 5 +#define __NR_open_by_handle_at 346 +#define __NR_open_tree 428 +#define __NR_openat 286 +#define __NR_pause 29 +#define __NR_pciconfig_iobase 200 +#define __NR_pciconfig_read 198 +#define __NR_pciconfig_write 199 +#define __NR_perf_event_open 319 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 317 +#define __NR_pivot_root 203 +#define __NR_pkey_alloc 384 +#define __NR_pkey_free 385 +#define __NR_pkey_mprotect 386 +#define __NR_poll 167 +#define __NR_ppoll 281 +#define __NR_ppoll_time64 414 +#define __NR_prctl 171 +#define __NR_pread64 179 +#define __NR_preadv 320 +#define __NR_preadv2 380 +#define __NR_prlimit64 325 +#define __NR_process_vm_readv 351 +#define __NR_process_vm_writev 352 +#define __NR_prof 44 +#define __NR_profil 98 +#define __NR_pselect6 280 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_putpmsg 188 +#define __NR_pwrite64 180 +#define __NR_pwritev 321 +#define __NR_pwritev2 381 +#define __NR_query_module 166 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 191 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 296 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 336 +#define __NR_recvfrom 337 +#define __NR_recvmmsg 343 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 342 +#define __NR_remap_file_pages 239 +#define __NR_removexattr 218 +#define __NR_rename 38 +#define __NR_renameat 293 +#define __NR_renameat2 357 +#define __NR_request_key 270 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 387 +#define __NR_rt_sigaction 173 +#define __NR_rt_sigpending 175 +#define __NR_rt_sigprocmask 174 +#define __NR_rt_sigqueueinfo 177 +#define __NR_rt_sigreturn 172 +#define __NR_rt_sigsuspend 178 +#define __NR_rt_sigtimedwait 176 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 322 +#define __NR_rtas 255 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 223 +#define __NR_sched_getattr 356 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 222 +#define __NR_sched_setattr 355 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 358 +#define __NR_select 82 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_send 334 +#define __NR_sendfile 186 +#define __NR_sendfile64 226 +#define __NR_sendmmsg 349 +#define __NR_sendmsg 341 +#define __NR_sendto 335 +#define __NR_set_mempolicy 261 +#define __NR_set_robust_list 300 +#define __NR_set_tid_address 232 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsuid 138 +#define __NR_setgid 46 +#define __NR_setgroups 81 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 350 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setresgid 169 +#define __NR_setresuid 164 +#define __NR_setreuid 70 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 339 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setxattr 209 +#define __NR_sgetmask 68 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 338 +#define __NR_sigaction 67 +#define __NR_sigaltstack 185 +#define __NR_signal 48 +#define __NR_signalfd 305 +#define __NR_signalfd4 313 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 326 +#define __NR_socketcall 102 +#define __NR_socketpair 333 +#define __NR_splice 283 +#define __NR_spu_create 279 +#define __NR_spu_run 278 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 252 +#define __NR_statx 383 +#define __NR_stime 25 +#define __NR_stty 31 +#define __NR_subpage_prot 310 +#define __NR_swapcontext 249 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_switch_endian 363 +#define __NR_symlink 83 +#define __NR_symlinkat 295 +#define __NR_sync 36 +#define __NR_sync_file_range2 308 +#define __NR_syncfs 348 +#define __NR_sys_debug_setcontext 256 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 284 +#define __NR_tgkill 250 +#define __NR_time 13 +#define __NR_timer_create 240 +#define __NR_timer_delete 244 +#define __NR_timer_getoverrun 243 +#define __NR_timer_gettime 242 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 241 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 306 +#define __NR_timerfd_gettime 312 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 311 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 208 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_tuxcall 225 +#define __NR_ugetrlimit 190 +#define __NR_ulimit 58 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 292 +#define __NR_unshare 282 +#define __NR_uselib 86 +#define __NR_userfaultfd 364 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 304 +#define __NR_utimensat_time64 412 +#define __NR_utimes 251 +#define __NR_vfork 189 +#define __NR_vhangup 111 +#define __NR_vm86 113 +#define __NR_vmsplice 285 +#define __NR_wait4 114 +#define __NR_waitid 272 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h new file mode 100644 index 0000000000..e6786acd17 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-syscall.h @@ -0,0 +1,389 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 330 +#define __NR_accept4 344 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 269 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 327 +#define __NR_bpf 361 +#define __NR_break 17 +#define __NR_brk 45 +#define __NR_capget 183 +#define __NR_capset 184 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 181 +#define __NR_chroot 61 +#define __NR_clock_adjtime 347 +#define __NR_clock_getres 247 +#define __NR_clock_gettime 246 +#define __NR_clock_nanosleep 248 +#define __NR_clock_settime 245 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 328 +#define __NR_copy_file_range 379 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 316 +#define __NR_epoll_create 236 +#define __NR_epoll_create1 315 +#define __NR_epoll_ctl 237 +#define __NR_epoll_pwait 303 +#define __NR_epoll_wait 238 +#define __NR_eventfd 307 +#define __NR_eventfd2 314 +#define __NR_execve 11 +#define __NR_execveat 362 +#define __NR_exit 1 +#define __NR_exit_group 234 +#define __NR_faccessat 298 +#define __NR_fadvise64 233 +#define __NR_fallocate 309 +#define __NR_fanotify_init 323 +#define __NR_fanotify_mark 324 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 297 +#define __NR_fchown 95 +#define __NR_fchownat 289 +#define __NR_fcntl 55 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 214 +#define __NR_finit_module 353 +#define __NR_flistxattr 217 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 220 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 211 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 253 +#define __NR_fsync 118 +#define __NR_ftime 35 +#define __NR_ftruncate 93 +#define __NR_futex 221 +#define __NR_futimesat 290 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 260 +#define __NR_get_robust_list 299 +#define __NR_getcpu 302 +#define __NR_getcwd 182 +#define __NR_getdents 141 +#define __NR_getdents64 202 +#define __NR_getegid 50 +#define __NR_geteuid 49 +#define __NR_getgid 47 +#define __NR_getgroups 80 +#define __NR_getitimer 105 +#define __NR_getpeername 332 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 187 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 359 +#define __NR_getresgid 170 +#define __NR_getresuid 165 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 331 +#define __NR_getsockopt 340 +#define __NR_gettid 207 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getxattr 212 +#define __NR_gtty 32 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 276 +#define __NR_inotify_init 275 +#define __NR_inotify_init1 318 +#define __NR_inotify_rm_watch 277 +#define __NR_io_cancel 231 +#define __NR_io_destroy 228 +#define __NR_io_getevents 229 +#define __NR_io_pgetevents 388 +#define __NR_io_setup 227 +#define __NR_io_submit 230 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioperm 101 +#define __NR_iopl 110 +#define __NR_ioprio_get 274 +#define __NR_ioprio_set 273 +#define __NR_ipc 117 +#define __NR_kcmp 354 +#define __NR_kexec_file_load 382 +#define __NR_kexec_load 268 +#define __NR_keyctl 271 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lgetxattr 213 +#define __NR_link 9 +#define __NR_linkat 294 +#define __NR_listen 329 +#define __NR_listxattr 215 +#define __NR_llistxattr 216 +#define __NR_lock 53 +#define __NR_lookup_dcookie 235 +#define __NR_lremovexattr 219 +#define __NR_lseek 19 +#define __NR_lsetxattr 210 +#define __NR_lstat 107 +#define __NR_madvise 205 +#define __NR_mbind 259 +#define __NR_membarrier 365 +#define __NR_memfd_create 360 +#define __NR_migrate_pages 258 +#define __NR_mincore 206 +#define __NR_mkdir 39 +#define __NR_mkdirat 287 +#define __NR_mknod 14 +#define __NR_mknodat 288 +#define __NR_mlock 150 +#define __NR_mlock2 378 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_modify_ldt 123 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 301 +#define __NR_mprotect 125 +#define __NR_mpx 56 +#define __NR_mq_getsetattr 267 +#define __NR_mq_notify 266 +#define __NR_mq_open 262 +#define __NR_mq_timedreceive 265 +#define __NR_mq_timedsend 264 +#define __NR_mq_unlink 263 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_multiplexer 201 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 345 +#define __NR_nanosleep 162 +#define __NR_newfstatat 291 +#define __NR_nfsservctl 168 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldolduname 59 +#define __NR_oldstat 18 +#define __NR_olduname 109 +#define __NR_open 5 +#define __NR_open_by_handle_at 346 +#define __NR_open_tree 428 +#define __NR_openat 286 +#define __NR_pause 29 +#define __NR_pciconfig_iobase 200 +#define __NR_pciconfig_read 198 +#define __NR_pciconfig_write 199 +#define __NR_perf_event_open 319 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 317 +#define __NR_pivot_root 203 +#define __NR_pkey_alloc 384 +#define __NR_pkey_free 385 +#define __NR_pkey_mprotect 386 +#define __NR_poll 167 +#define __NR_ppoll 281 +#define __NR_prctl 171 +#define __NR_pread64 179 +#define __NR_preadv 320 +#define __NR_preadv2 380 +#define __NR_prlimit64 325 +#define __NR_process_vm_readv 351 +#define __NR_process_vm_writev 352 +#define __NR_prof 44 +#define __NR_profil 98 +#define __NR_pselect6 280 +#define __NR_ptrace 26 +#define __NR_putpmsg 188 +#define __NR_pwrite64 180 +#define __NR_pwritev 321 +#define __NR_pwritev2 381 +#define __NR_query_module 166 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 191 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 296 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 336 +#define __NR_recvfrom 337 +#define __NR_recvmmsg 343 +#define __NR_recvmsg 342 +#define __NR_remap_file_pages 239 +#define __NR_removexattr 218 +#define __NR_rename 38 +#define __NR_renameat 293 +#define __NR_renameat2 357 +#define __NR_request_key 270 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 387 +#define __NR_rt_sigaction 173 +#define __NR_rt_sigpending 175 +#define __NR_rt_sigprocmask 174 +#define __NR_rt_sigqueueinfo 177 +#define __NR_rt_sigreturn 172 +#define __NR_rt_sigsuspend 178 +#define __NR_rt_sigtimedwait 176 +#define __NR_rt_tgsigqueueinfo 322 +#define __NR_rtas 255 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 223 +#define __NR_sched_getattr 356 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_setaffinity 222 +#define __NR_sched_setattr 355 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 358 +#define __NR_select 82 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop 392 +#define __NR_send 334 +#define __NR_sendfile 186 +#define __NR_sendmmsg 349 +#define __NR_sendmsg 341 +#define __NR_sendto 335 +#define __NR_set_mempolicy 261 +#define __NR_set_robust_list 300 +#define __NR_set_tid_address 232 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsuid 138 +#define __NR_setgid 46 +#define __NR_setgroups 81 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 350 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setresgid 169 +#define __NR_setresuid 164 +#define __NR_setreuid 70 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 339 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setxattr 209 +#define __NR_sgetmask 68 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 338 +#define __NR_sigaction 67 +#define __NR_sigaltstack 185 +#define __NR_signal 48 +#define __NR_signalfd 305 +#define __NR_signalfd4 313 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 326 +#define __NR_socketcall 102 +#define __NR_socketpair 333 +#define __NR_splice 283 +#define __NR_spu_create 279 +#define __NR_spu_run 278 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_statfs 99 +#define __NR_statfs64 252 +#define __NR_statx 383 +#define __NR_stime 25 +#define __NR_stty 31 +#define __NR_subpage_prot 310 +#define __NR_swapcontext 249 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_switch_endian 363 +#define __NR_symlink 83 +#define __NR_symlinkat 295 +#define __NR_sync 36 +#define __NR_sync_file_range2 308 +#define __NR_syncfs 348 +#define __NR_sys_debug_setcontext 256 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 284 +#define __NR_tgkill 250 +#define __NR_time 13 +#define __NR_timer_create 240 +#define __NR_timer_delete 244 +#define __NR_timer_getoverrun 243 +#define __NR_timer_gettime 242 +#define __NR_timer_settime 241 +#define __NR_timerfd_create 306 +#define __NR_timerfd_gettime 312 +#define __NR_timerfd_settime 311 +#define __NR_times 43 +#define __NR_tkill 208 +#define __NR_truncate 92 +#define __NR_tuxcall 225 +#define __NR_ugetrlimit 190 +#define __NR_ulimit 58 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 292 +#define __NR_unshare 282 +#define __NR_uselib 86 +#define __NR_userfaultfd 364 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 304 +#define __NR_utimes 251 +#define __NR_vfork 189 +#define __NR_vhangup 111 +#define __NR_vm86 113 +#define __NR_vmsplice 285 +#define __NR_wait4 114 +#define __NR_waitid 272 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h new file mode 100644 index 0000000000..ddbbbe92f8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/riscv/rv64/arch-syscall.h @@ -0,0 +1,291 @@ +#define __NR_accept 202 +#define __NR_accept4 242 +#define __NR_acct 89 +#define __NR_add_key 217 +#define __NR_adjtimex 171 +#define __NR_bind 200 +#define __NR_bpf 280 +#define __NR_brk 214 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_chdir 49 +#define __NR_chroot 51 +#define __NR_clock_adjtime 266 +#define __NR_clock_getres 114 +#define __NR_clock_gettime 113 +#define __NR_clock_nanosleep 115 +#define __NR_clock_settime 112 +#define __NR_clone 220 +#define __NR_clone3 435 +#define __NR_close 57 +#define __NR_connect 203 +#define __NR_copy_file_range 285 +#define __NR_delete_module 106 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_eventfd2 19 +#define __NR_execve 221 +#define __NR_execveat 281 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_faccessat 48 +#define __NR_fadvise64 223 +#define __NR_fallocate 47 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_fchdir 50 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchown 55 +#define __NR_fchownat 54 +#define __NR_fcntl 25 +#define __NR_fdatasync 83 +#define __NR_fgetxattr 10 +#define __NR_finit_module 273 +#define __NR_flistxattr 13 +#define __NR_flock 32 +#define __NR_fremovexattr 16 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 7 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 80 +#define __NR_fstatfs 44 +#define __NR_fsync 82 +#define __NR_ftruncate 46 +#define __NR_futex 98 +#define __NR_get_mempolicy 236 +#define __NR_get_robust_list 100 +#define __NR_getcpu 168 +#define __NR_getcwd 17 +#define __NR_getdents64 61 +#define __NR_getegid 177 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getgroups 158 +#define __NR_getitimer 102 +#define __NR_getpeername 205 +#define __NR_getpgid 155 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getpriority 141 +#define __NR_getrandom 278 +#define __NR_getresgid 150 +#define __NR_getresuid 148 +#define __NR_getrlimit 163 +#define __NR_getrusage 165 +#define __NR_getsid 156 +#define __NR_getsockname 204 +#define __NR_getsockopt 209 +#define __NR_gettid 178 +#define __NR_gettimeofday 169 +#define __NR_getuid 174 +#define __NR_getxattr 8 +#define __NR_init_module 105 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_init1 26 +#define __NR_inotify_rm_watch 28 +#define __NR_io_cancel 3 +#define __NR_io_destroy 1 +#define __NR_io_getevents 4 +#define __NR_io_pgetevents 292 +#define __NR_io_setup 0 +#define __NR_io_submit 2 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 29 +#define __NR_ioprio_get 31 +#define __NR_ioprio_set 30 +#define __NR_kcmp 272 +#define __NR_kexec_file_load 294 +#define __NR_kexec_load 104 +#define __NR_keyctl 219 +#define __NR_kill 129 +#define __NR_lgetxattr 9 +#define __NR_linkat 37 +#define __NR_listen 201 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_lookup_dcookie 18 +#define __NR_lremovexattr 15 +#define __NR_lseek 62 +#define __NR_lsetxattr 6 +#define __NR_madvise 233 +#define __NR_mbind 235 +#define __NR_membarrier 283 +#define __NR_memfd_create 279 +#define __NR_migrate_pages 238 +#define __NR_mincore 232 +#define __NR_mkdirat 34 +#define __NR_mknodat 33 +#define __NR_mlock 228 +#define __NR_mlock2 284 +#define __NR_mlockall 230 +#define __NR_mmap 222 +#define __NR_mount 40 +#define __NR_move_mount 429 +#define __NR_move_pages 239 +#define __NR_mprotect 226 +#define __NR_mq_getsetattr 185 +#define __NR_mq_notify 184 +#define __NR_mq_open 180 +#define __NR_mq_timedreceive 183 +#define __NR_mq_timedsend 182 +#define __NR_mq_unlink 181 +#define __NR_mremap 216 +#define __NR_msgctl 187 +#define __NR_msgget 186 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_msync 227 +#define __NR_munlock 229 +#define __NR_munlockall 231 +#define __NR_munmap 215 +#define __NR_name_to_handle_at 264 +#define __NR_nanosleep 101 +#define __NR_newfstatat 79 +#define __NR_nfsservctl 42 +#define __NR_open_by_handle_at 265 +#define __NR_open_tree 428 +#define __NR_openat 56 +#define __NR_perf_event_open 241 +#define __NR_personality 92 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe2 59 +#define __NR_pivot_root 41 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_pkey_mprotect 288 +#define __NR_ppoll 73 +#define __NR_prctl 167 +#define __NR_pread64 67 +#define __NR_preadv 69 +#define __NR_preadv2 286 +#define __NR_prlimit64 261 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_pselect6 72 +#define __NR_ptrace 117 +#define __NR_pwrite64 68 +#define __NR_pwritev 70 +#define __NR_pwritev2 287 +#define __NR_quotactl 60 +#define __NR_read 63 +#define __NR_readahead 213 +#define __NR_readlinkat 78 +#define __NR_readv 65 +#define __NR_reboot 142 +#define __NR_recvfrom 207 +#define __NR_recvmmsg 243 +#define __NR_recvmsg 212 +#define __NR_remap_file_pages 234 +#define __NR_removexattr 14 +#define __NR_renameat2 276 +#define __NR_request_key 218 +#define __NR_restart_syscall 128 +#define __NR_riscv_flush_icache 259 +#define __NR_rseq 293 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_getaffinity 123 +#define __NR_sched_getattr 275 +#define __NR_sched_getparam 121 +#define __NR_sched_getscheduler 120 +#define __NR_sched_rr_get_interval 127 +#define __NR_sched_setaffinity 122 +#define __NR_sched_setattr 274 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_yield 124 +#define __NR_seccomp 277 +#define __NR_semctl 191 +#define __NR_semget 190 +#define __NR_semop 193 +#define __NR_semtimedop 192 +#define __NR_sendfile 71 +#define __NR_sendmmsg 269 +#define __NR_sendmsg 211 +#define __NR_sendto 206 +#define __NR_set_mempolicy 237 +#define __NR_set_robust_list 99 +#define __NR_set_tid_address 96 +#define __NR_setdomainname 162 +#define __NR_setfsgid 152 +#define __NR_setfsuid 151 +#define __NR_setgid 144 +#define __NR_setgroups 159 +#define __NR_sethostname 161 +#define __NR_setitimer 103 +#define __NR_setns 268 +#define __NR_setpgid 154 +#define __NR_setpriority 140 +#define __NR_setregid 143 +#define __NR_setresgid 149 +#define __NR_setresuid 147 +#define __NR_setreuid 145 +#define __NR_setrlimit 164 +#define __NR_setsid 157 +#define __NR_setsockopt 208 +#define __NR_settimeofday 170 +#define __NR_setuid 146 +#define __NR_setxattr 5 +#define __NR_shmat 196 +#define __NR_shmctl 195 +#define __NR_shmdt 197 +#define __NR_shmget 194 +#define __NR_shutdown 210 +#define __NR_sigaltstack 132 +#define __NR_signalfd4 74 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_splice 76 +#define __NR_statfs 43 +#define __NR_statx 291 +#define __NR_swapoff 225 +#define __NR_swapon 224 +#define __NR_symlinkat 36 +#define __NR_sync 81 +#define __NR_sync_file_range 84 +#define __NR_syncfs 267 +#define __NR_sysinfo 179 +#define __NR_syslog 116 +#define __NR_tee 77 +#define __NR_tgkill 131 +#define __NR_timer_create 107 +#define __NR_timer_delete 111 +#define __NR_timer_getoverrun 109 +#define __NR_timer_gettime 108 +#define __NR_timer_settime 110 +#define __NR_timerfd_create 85 +#define __NR_timerfd_gettime 87 +#define __NR_timerfd_settime 86 +#define __NR_times 153 +#define __NR_tkill 130 +#define __NR_truncate 45 +#define __NR_umask 166 +#define __NR_umount2 39 +#define __NR_uname 160 +#define __NR_unlinkat 35 +#define __NR_unshare 97 +#define __NR_userfaultfd 282 +#define __NR_utimensat 88 +#define __NR_vhangup 58 +#define __NR_vmsplice 75 +#define __NR_wait4 260 +#define __NR_waitid 95 +#define __NR_write 64 +#define __NR_writev 66 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h new file mode 100644 index 0000000000..d4f3429106 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/arch-syscall.h @@ -0,0 +1,406 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept4 364 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 278 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 361 +#define __NR_bpf 351 +#define __NR_brk 45 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 182 +#define __NR_chown32 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 337 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 261 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 260 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 262 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 259 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 362 +#define __NR_copy_file_range 375 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 326 +#define __NR_epoll_create 249 +#define __NR_epoll_create1 327 +#define __NR_epoll_ctl 250 +#define __NR_epoll_pwait 312 +#define __NR_epoll_wait 251 +#define __NR_eventfd 318 +#define __NR_eventfd2 323 +#define __NR_execve 11 +#define __NR_execveat 354 +#define __NR_exit 1 +#define __NR_exit_group 248 +#define __NR_faccessat 300 +#define __NR_fadvise64 253 +#define __NR_fadvise64_64 264 +#define __NR_fallocate 314 +#define __NR_fanotify_init 332 +#define __NR_fanotify_mark 333 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 299 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 291 +#define __NR_fcntl 55 +#define __NR_fcntl64 221 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 229 +#define __NR_finit_module 344 +#define __NR_flistxattr 232 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 235 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 226 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 293 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 266 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 238 +#define __NR_futex_time64 422 +#define __NR_futimesat 292 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 269 +#define __NR_get_robust_list 305 +#define __NR_getcpu 311 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpeername 368 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 188 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 349 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 367 +#define __NR_getsockopt 365 +#define __NR_gettid 236 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 227 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_init 284 +#define __NR_inotify_init1 324 +#define __NR_inotify_rm_watch 286 +#define __NR_io_cancel 247 +#define __NR_io_destroy 244 +#define __NR_io_getevents 245 +#define __NR_io_pgetevents 382 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 243 +#define __NR_io_submit 246 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioperm 101 +#define __NR_ioprio_get 283 +#define __NR_ioprio_set 282 +#define __NR_ipc 117 +#define __NR_kcmp 343 +#define __NR_kexec_file_load 381 +#define __NR_kexec_load 277 +#define __NR_keyctl 280 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 198 +#define __NR_lgetxattr 228 +#define __NR_link 9 +#define __NR_linkat 296 +#define __NR_listen 363 +#define __NR_listxattr 230 +#define __NR_llistxattr 231 +#define __NR_lookup_dcookie 110 +#define __NR_lremovexattr 234 +#define __NR_lseek 19 +#define __NR_lsetxattr 225 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 219 +#define __NR_mbind 268 +#define __NR_membarrier 356 +#define __NR_memfd_create 350 +#define __NR_migrate_pages 287 +#define __NR_mincore 218 +#define __NR_mkdir 39 +#define __NR_mkdirat 289 +#define __NR_mknod 14 +#define __NR_mknodat 290 +#define __NR_mlock 150 +#define __NR_mlock2 374 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 310 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 276 +#define __NR_mq_notify 275 +#define __NR_mq_open 271 +#define __NR_mq_timedreceive 274 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 273 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 272 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 335 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_open 5 +#define __NR_open_by_handle_at 336 +#define __NR_open_tree 428 +#define __NR_openat 288 +#define __NR_pause 29 +#define __NR_perf_event_open 331 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 325 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 385 +#define __NR_pkey_free 386 +#define __NR_pkey_mprotect 384 +#define __NR_poll 168 +#define __NR_ppoll 302 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 328 +#define __NR_preadv2 376 +#define __NR_prlimit64 334 +#define __NR_process_vm_readv 340 +#define __NR_process_vm_writev 341 +#define __NR_pselect6 301 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_putpmsg 189 +#define __NR_pwrite64 181 +#define __NR_pwritev 329 +#define __NR_pwritev2 377 +#define __NR_query_module 167 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 222 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 298 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recvfrom 371 +#define __NR_recvmmsg 357 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 372 +#define __NR_remap_file_pages 267 +#define __NR_removexattr 233 +#define __NR_rename 38 +#define __NR_renameat 295 +#define __NR_renameat2 347 +#define __NR_request_key 279 +#define __NR_restart_syscall 7 +#define __NR_rmdir 40 +#define __NR_rseq 383 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 330 +#define __NR_s390_guarded_storage 378 +#define __NR_s390_pci_mmio_read 353 +#define __NR_s390_pci_mmio_write 352 +#define __NR_s390_runtime_instr 342 +#define __NR_s390_sthyi 380 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 240 +#define __NR_sched_getattr 346 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 239 +#define __NR_sched_setattr 345 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 348 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile 187 +#define __NR_sendfile64 223 +#define __NR_sendmmsg 358 +#define __NR_sendmsg 370 +#define __NR_sendto 369 +#define __NR_set_mempolicy 270 +#define __NR_set_robust_list 304 +#define __NR_set_tid_address 252 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 339 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 366 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 224 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 373 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 316 +#define __NR_signalfd4 322 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 359 +#define __NR_socketcall 102 +#define __NR_socketpair 360 +#define __NR_splice 306 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 265 +#define __NR_statx 379 +#define __NR_stime 25 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 297 +#define __NR_sync 36 +#define __NR_sync_file_range 307 +#define __NR_syncfs 338 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 308 +#define __NR_tgkill 241 +#define __NR_time 13 +#define __NR_timer_create 254 +#define __NR_timer_delete 258 +#define __NR_timer_getoverrun 257 +#define __NR_timer_gettime 256 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 255 +#define __NR_timer_settime64 409 +#define __NR_timerfd 317 +#define __NR_timerfd_create 319 +#define __NR_timerfd_gettime 321 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 320 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 237 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 294 +#define __NR_unshare 303 +#define __NR_uselib 86 +#define __NR_userfaultfd 355 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 315 +#define __NR_utimensat_time64 412 +#define __NR_utimes 313 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vmsplice 309 +#define __NR_wait4 114 +#define __NR_waitid 281 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h new file mode 100644 index 0000000000..bd174facd8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/arch-syscall.h @@ -0,0 +1,354 @@ +#define __NR__sysctl 149 +#define __NR_accept4 364 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 278 +#define __NR_adjtimex 124 +#define __NR_afs_syscall 137 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 361 +#define __NR_bpf 351 +#define __NR_brk 45 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 337 +#define __NR_clock_getres 261 +#define __NR_clock_gettime 260 +#define __NR_clock_nanosleep 262 +#define __NR_clock_settime 259 +#define __NR_clone 120 +#define __NR_clone3 435 +#define __NR_close 6 +#define __NR_connect 362 +#define __NR_copy_file_range 375 +#define __NR_creat 8 +#define __NR_create_module 127 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 326 +#define __NR_epoll_create 249 +#define __NR_epoll_create1 327 +#define __NR_epoll_ctl 250 +#define __NR_epoll_pwait 312 +#define __NR_epoll_wait 251 +#define __NR_eventfd 318 +#define __NR_eventfd2 323 +#define __NR_execve 11 +#define __NR_execveat 354 +#define __NR_exit 1 +#define __NR_exit_group 248 +#define __NR_faccessat 300 +#define __NR_fadvise64 253 +#define __NR_fallocate 314 +#define __NR_fanotify_init 332 +#define __NR_fanotify_mark 333 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 299 +#define __NR_fchown 207 +#define __NR_fchownat 291 +#define __NR_fcntl 55 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 229 +#define __NR_finit_module 344 +#define __NR_flistxattr 232 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 235 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 226 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 266 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_futex 238 +#define __NR_futimesat 292 +#define __NR_get_kernel_syms 130 +#define __NR_get_mempolicy 269 +#define __NR_get_robust_list 305 +#define __NR_getcpu 311 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 202 +#define __NR_geteuid 201 +#define __NR_getgid 200 +#define __NR_getgroups 205 +#define __NR_getitimer 105 +#define __NR_getpeername 368 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getpmsg 188 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 349 +#define __NR_getresgid 211 +#define __NR_getresuid 209 +#define __NR_getrlimit 191 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 367 +#define __NR_getsockopt 365 +#define __NR_gettid 236 +#define __NR_gettimeofday 78 +#define __NR_getuid 199 +#define __NR_getxattr 227 +#define __NR_idle 112 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 285 +#define __NR_inotify_init 284 +#define __NR_inotify_init1 324 +#define __NR_inotify_rm_watch 286 +#define __NR_io_cancel 247 +#define __NR_io_destroy 244 +#define __NR_io_getevents 245 +#define __NR_io_pgetevents 382 +#define __NR_io_setup 243 +#define __NR_io_submit 246 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 283 +#define __NR_ioprio_set 282 +#define __NR_ipc 117 +#define __NR_kcmp 343 +#define __NR_kexec_file_load 381 +#define __NR_kexec_load 277 +#define __NR_keyctl 280 +#define __NR_kill 37 +#define __NR_lchown 198 +#define __NR_lgetxattr 228 +#define __NR_link 9 +#define __NR_linkat 296 +#define __NR_listen 363 +#define __NR_listxattr 230 +#define __NR_llistxattr 231 +#define __NR_lookup_dcookie 110 +#define __NR_lremovexattr 234 +#define __NR_lseek 19 +#define __NR_lsetxattr 225 +#define __NR_lstat 107 +#define __NR_madvise 219 +#define __NR_mbind 268 +#define __NR_membarrier 356 +#define __NR_memfd_create 350 +#define __NR_migrate_pages 287 +#define __NR_mincore 218 +#define __NR_mkdir 39 +#define __NR_mkdirat 289 +#define __NR_mknod 14 +#define __NR_mknodat 290 +#define __NR_mlock 150 +#define __NR_mlock2 374 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 310 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 276 +#define __NR_mq_notify 275 +#define __NR_mq_open 271 +#define __NR_mq_timedreceive 274 +#define __NR_mq_timedsend 273 +#define __NR_mq_unlink 272 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 335 +#define __NR_nanosleep 162 +#define __NR_newfstatat 293 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_open 5 +#define __NR_open_by_handle_at 336 +#define __NR_open_tree 428 +#define __NR_openat 288 +#define __NR_pause 29 +#define __NR_perf_event_open 331 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 325 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 385 +#define __NR_pkey_free 386 +#define __NR_pkey_mprotect 384 +#define __NR_poll 168 +#define __NR_ppoll 302 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 328 +#define __NR_preadv2 376 +#define __NR_prlimit64 334 +#define __NR_process_vm_readv 340 +#define __NR_process_vm_writev 341 +#define __NR_pselect6 301 +#define __NR_ptrace 26 +#define __NR_putpmsg 189 +#define __NR_pwrite64 181 +#define __NR_pwritev 329 +#define __NR_pwritev2 377 +#define __NR_query_module 167 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 222 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 298 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recvfrom 371 +#define __NR_recvmmsg 357 +#define __NR_recvmsg 372 +#define __NR_remap_file_pages 267 +#define __NR_removexattr 233 +#define __NR_rename 38 +#define __NR_renameat 295 +#define __NR_renameat2 347 +#define __NR_request_key 279 +#define __NR_restart_syscall 7 +#define __NR_rmdir 40 +#define __NR_rseq 383 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_tgsigqueueinfo 330 +#define __NR_s390_guarded_storage 378 +#define __NR_s390_pci_mmio_read 353 +#define __NR_s390_pci_mmio_write 352 +#define __NR_s390_runtime_instr 342 +#define __NR_s390_sthyi 380 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 240 +#define __NR_sched_getattr 346 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_setaffinity 239 +#define __NR_sched_setattr 345 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 348 +#define __NR_select 142 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop 392 +#define __NR_sendfile 187 +#define __NR_sendmmsg 358 +#define __NR_sendmsg 370 +#define __NR_sendto 369 +#define __NR_set_mempolicy 270 +#define __NR_set_robust_list 304 +#define __NR_set_tid_address 252 +#define __NR_setdomainname 121 +#define __NR_setfsgid 216 +#define __NR_setfsuid 215 +#define __NR_setgid 214 +#define __NR_setgroups 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 339 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 204 +#define __NR_setresgid 210 +#define __NR_setresuid 208 +#define __NR_setreuid 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 366 +#define __NR_settimeofday 79 +#define __NR_setuid 213 +#define __NR_setxattr 224 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 373 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 316 +#define __NR_signalfd4 322 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 359 +#define __NR_socketcall 102 +#define __NR_socketpair 360 +#define __NR_splice 306 +#define __NR_stat 106 +#define __NR_statfs 99 +#define __NR_statfs64 265 +#define __NR_statx 379 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 297 +#define __NR_sync 36 +#define __NR_sync_file_range 307 +#define __NR_syncfs 338 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 308 +#define __NR_tgkill 241 +#define __NR_timer_create 254 +#define __NR_timer_delete 258 +#define __NR_timer_getoverrun 257 +#define __NR_timer_gettime 256 +#define __NR_timer_settime 255 +#define __NR_timerfd 317 +#define __NR_timerfd_create 319 +#define __NR_timerfd_gettime 321 +#define __NR_timerfd_settime 320 +#define __NR_times 43 +#define __NR_tkill 237 +#define __NR_truncate 92 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 294 +#define __NR_unshare 303 +#define __NR_uselib 86 +#define __NR_userfaultfd 355 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 315 +#define __NR_utimes 313 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vmsplice 309 +#define __NR_wait4 114 +#define __NR_waitid 281 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/sh/arch-syscall.h b/sysdeps/unix/sysv/linux/sh/arch-syscall.h new file mode 100644 index 0000000000..e3ef3da4c6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/arch-syscall.h @@ -0,0 +1,400 @@ +#define __NR__llseek 140 +#define __NR__newselect 142 +#define __NR__sysctl 149 +#define __NR_accept 344 +#define __NR_accept4 358 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 285 +#define __NR_adjtimex 124 +#define __NR_alarm 27 +#define __NR_bdflush 134 +#define __NR_bind 341 +#define __NR_bpf 375 +#define __NR_brk 45 +#define __NR_cacheflush 123 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 182 +#define __NR_chown32 212 +#define __NR_chroot 61 +#define __NR_clock_adjtime 361 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 266 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 265 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 267 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 264 +#define __NR_clock_settime64 404 +#define __NR_clone 120 +#define __NR_close 6 +#define __NR_connect 342 +#define __NR_copy_file_range 380 +#define __NR_creat 8 +#define __NR_delete_module 129 +#define __NR_dup 41 +#define __NR_dup2 63 +#define __NR_dup3 330 +#define __NR_epoll_create 254 +#define __NR_epoll_create1 329 +#define __NR_epoll_ctl 255 +#define __NR_epoll_pwait 319 +#define __NR_epoll_wait 256 +#define __NR_eventfd 323 +#define __NR_eventfd2 328 +#define __NR_execve 11 +#define __NR_execveat 376 +#define __NR_exit 1 +#define __NR_exit_group 252 +#define __NR_faccessat 307 +#define __NR_fadvise64 250 +#define __NR_fadvise64_64 272 +#define __NR_fallocate 324 +#define __NR_fanotify_init 337 +#define __NR_fanotify_mark 338 +#define __NR_fchdir 133 +#define __NR_fchmod 94 +#define __NR_fchmodat 306 +#define __NR_fchown 95 +#define __NR_fchown32 207 +#define __NR_fchownat 298 +#define __NR_fcntl 55 +#define __NR_fcntl64 221 +#define __NR_fdatasync 148 +#define __NR_fgetxattr 231 +#define __NR_finit_module 368 +#define __NR_flistxattr 234 +#define __NR_flock 143 +#define __NR_fork 2 +#define __NR_fremovexattr 237 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 228 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 108 +#define __NR_fstat64 197 +#define __NR_fstatat64 300 +#define __NR_fstatfs 100 +#define __NR_fstatfs64 269 +#define __NR_fsync 118 +#define __NR_ftruncate 93 +#define __NR_ftruncate64 194 +#define __NR_futex 240 +#define __NR_futex_time64 422 +#define __NR_futimesat 299 +#define __NR_get_mempolicy 275 +#define __NR_get_robust_list 312 +#define __NR_getcpu 318 +#define __NR_getcwd 183 +#define __NR_getdents 141 +#define __NR_getdents64 220 +#define __NR_getegid 50 +#define __NR_getegid32 202 +#define __NR_geteuid 49 +#define __NR_geteuid32 201 +#define __NR_getgid 47 +#define __NR_getgid32 200 +#define __NR_getgroups 80 +#define __NR_getgroups32 205 +#define __NR_getitimer 105 +#define __NR_getpeername 346 +#define __NR_getpgid 132 +#define __NR_getpgrp 65 +#define __NR_getpid 20 +#define __NR_getppid 64 +#define __NR_getpriority 96 +#define __NR_getrandom 373 +#define __NR_getresgid 171 +#define __NR_getresgid32 211 +#define __NR_getresuid 165 +#define __NR_getresuid32 209 +#define __NR_getrlimit 76 +#define __NR_getrusage 77 +#define __NR_getsid 147 +#define __NR_getsockname 345 +#define __NR_getsockopt 354 +#define __NR_gettid 224 +#define __NR_gettimeofday 78 +#define __NR_getuid 24 +#define __NR_getuid32 199 +#define __NR_getxattr 229 +#define __NR_init_module 128 +#define __NR_inotify_add_watch 291 +#define __NR_inotify_init 290 +#define __NR_inotify_init1 332 +#define __NR_inotify_rm_watch 292 +#define __NR_io_cancel 249 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 245 +#define __NR_io_submit 248 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 289 +#define __NR_ioprio_set 288 +#define __NR_ipc 117 +#define __NR_kcmp 367 +#define __NR_kexec_load 283 +#define __NR_keyctl 287 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 198 +#define __NR_lgetxattr 230 +#define __NR_link 9 +#define __NR_linkat 303 +#define __NR_listen 343 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_lookup_dcookie 253 +#define __NR_lremovexattr 236 +#define __NR_lseek 19 +#define __NR_lsetxattr 227 +#define __NR_lstat 107 +#define __NR_lstat64 196 +#define __NR_madvise 219 +#define __NR_mbind 274 +#define __NR_membarrier 378 +#define __NR_memfd_create 374 +#define __NR_migrate_pages 294 +#define __NR_mincore 218 +#define __NR_mkdir 39 +#define __NR_mkdirat 296 +#define __NR_mknod 14 +#define __NR_mknodat 297 +#define __NR_mlock 150 +#define __NR_mlock2 379 +#define __NR_mlockall 152 +#define __NR_mmap 90 +#define __NR_mmap2 192 +#define __NR_mount 21 +#define __NR_move_mount 429 +#define __NR_move_pages 317 +#define __NR_mprotect 125 +#define __NR_mq_getsetattr 282 +#define __NR_mq_notify 281 +#define __NR_mq_open 277 +#define __NR_mq_timedreceive 280 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 279 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 278 +#define __NR_mremap 163 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 144 +#define __NR_munlock 151 +#define __NR_munlockall 153 +#define __NR_munmap 91 +#define __NR_name_to_handle_at 359 +#define __NR_nanosleep 162 +#define __NR_nfsservctl 169 +#define __NR_nice 34 +#define __NR_oldfstat 28 +#define __NR_oldlstat 84 +#define __NR_oldstat 18 +#define __NR_olduname 109 +#define __NR_open 5 +#define __NR_open_by_handle_at 360 +#define __NR_open_tree 428 +#define __NR_openat 295 +#define __NR_pause 29 +#define __NR_perf_event_open 336 +#define __NR_personality 136 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 331 +#define __NR_pivot_root 217 +#define __NR_pkey_alloc 385 +#define __NR_pkey_free 386 +#define __NR_pkey_mprotect 384 +#define __NR_poll 168 +#define __NR_ppoll 309 +#define __NR_ppoll_time64 414 +#define __NR_prctl 172 +#define __NR_pread64 180 +#define __NR_preadv 333 +#define __NR_preadv2 381 +#define __NR_prlimit64 339 +#define __NR_process_vm_readv 365 +#define __NR_process_vm_writev 366 +#define __NR_pselect6 308 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_pwrite64 181 +#define __NR_pwritev 334 +#define __NR_pwritev2 382 +#define __NR_quotactl 131 +#define __NR_read 3 +#define __NR_readahead 225 +#define __NR_readdir 89 +#define __NR_readlink 85 +#define __NR_readlinkat 305 +#define __NR_readv 145 +#define __NR_reboot 88 +#define __NR_recv 350 +#define __NR_recvfrom 351 +#define __NR_recvmmsg 357 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 356 +#define __NR_remap_file_pages 257 +#define __NR_removexattr 235 +#define __NR_rename 38 +#define __NR_renameat 302 +#define __NR_renameat2 371 +#define __NR_request_key 286 +#define __NR_restart_syscall 0 +#define __NR_rmdir 40 +#define __NR_rseq 387 +#define __NR_rt_sigaction 174 +#define __NR_rt_sigpending 176 +#define __NR_rt_sigprocmask 175 +#define __NR_rt_sigqueueinfo 178 +#define __NR_rt_sigreturn 173 +#define __NR_rt_sigsuspend 179 +#define __NR_rt_sigtimedwait 177 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 335 +#define __NR_sched_get_priority_max 159 +#define __NR_sched_get_priority_min 160 +#define __NR_sched_getaffinity 242 +#define __NR_sched_getattr 369 +#define __NR_sched_getparam 155 +#define __NR_sched_getscheduler 157 +#define __NR_sched_rr_get_interval 161 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_setaffinity 241 +#define __NR_sched_setattr 370 +#define __NR_sched_setparam 154 +#define __NR_sched_setscheduler 156 +#define __NR_sched_yield 158 +#define __NR_seccomp 372 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_send 348 +#define __NR_sendfile 187 +#define __NR_sendfile64 239 +#define __NR_sendmmsg 363 +#define __NR_sendmsg 355 +#define __NR_sendto 349 +#define __NR_set_mempolicy 276 +#define __NR_set_robust_list 311 +#define __NR_set_tid_address 258 +#define __NR_setdomainname 121 +#define __NR_setfsgid 139 +#define __NR_setfsgid32 216 +#define __NR_setfsuid 138 +#define __NR_setfsuid32 215 +#define __NR_setgid 46 +#define __NR_setgid32 214 +#define __NR_setgroups 81 +#define __NR_setgroups32 206 +#define __NR_sethostname 74 +#define __NR_setitimer 104 +#define __NR_setns 364 +#define __NR_setpgid 57 +#define __NR_setpriority 97 +#define __NR_setregid 71 +#define __NR_setregid32 204 +#define __NR_setresgid 170 +#define __NR_setresgid32 210 +#define __NR_setresuid 164 +#define __NR_setresuid32 208 +#define __NR_setreuid 70 +#define __NR_setreuid32 203 +#define __NR_setrlimit 75 +#define __NR_setsid 66 +#define __NR_setsockopt 353 +#define __NR_settimeofday 79 +#define __NR_setuid 23 +#define __NR_setuid32 213 +#define __NR_setxattr 226 +#define __NR_sgetmask 68 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 352 +#define __NR_sigaction 67 +#define __NR_sigaltstack 186 +#define __NR_signal 48 +#define __NR_signalfd 321 +#define __NR_signalfd4 327 +#define __NR_sigpending 73 +#define __NR_sigprocmask 126 +#define __NR_sigreturn 119 +#define __NR_sigsuspend 72 +#define __NR_socket 340 +#define __NR_socketcall 102 +#define __NR_socketpair 347 +#define __NR_splice 313 +#define __NR_ssetmask 69 +#define __NR_stat 106 +#define __NR_stat64 195 +#define __NR_statfs 99 +#define __NR_statfs64 268 +#define __NR_statx 383 +#define __NR_stime 25 +#define __NR_swapoff 115 +#define __NR_swapon 87 +#define __NR_symlink 83 +#define __NR_symlinkat 304 +#define __NR_sync 36 +#define __NR_sync_file_range 314 +#define __NR_syncfs 362 +#define __NR_sysfs 135 +#define __NR_sysinfo 116 +#define __NR_syslog 103 +#define __NR_tee 315 +#define __NR_tgkill 270 +#define __NR_time 13 +#define __NR_timer_create 259 +#define __NR_timer_delete 263 +#define __NR_timer_getoverrun 262 +#define __NR_timer_gettime 261 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 260 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 322 +#define __NR_timerfd_gettime 326 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 325 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 238 +#define __NR_truncate 92 +#define __NR_truncate64 193 +#define __NR_ugetrlimit 191 +#define __NR_umask 60 +#define __NR_umount 22 +#define __NR_umount2 52 +#define __NR_uname 122 +#define __NR_unlink 10 +#define __NR_unlinkat 301 +#define __NR_unshare 310 +#define __NR_uselib 86 +#define __NR_userfaultfd 377 +#define __NR_ustat 62 +#define __NR_utime 30 +#define __NR_utimensat 320 +#define __NR_utimensat_time64 412 +#define __NR_utimes 271 +#define __NR_vfork 190 +#define __NR_vhangup 111 +#define __NR_vmsplice 316 +#define __NR_wait4 114 +#define __NR_waitid 284 +#define __NR_waitpid 7 +#define __NR_write 4 +#define __NR_writev 146 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h new file mode 100644 index 0000000000..c5278a5966 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/arch-syscall.h @@ -0,0 +1,405 @@ +#define __NR__llseek 236 +#define __NR__newselect 230 +#define __NR__sysctl 251 +#define __NR_accept 99 +#define __NR_accept4 323 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 281 +#define __NR_adjtimex 219 +#define __NR_afs_syscall 227 +#define __NR_alarm 27 +#define __NR_bdflush 225 +#define __NR_bind 353 +#define __NR_bpf 349 +#define __NR_brk 17 +#define __NR_capget 21 +#define __NR_capset 22 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 13 +#define __NR_chown32 35 +#define __NR_chroot 61 +#define __NR_clock_adjtime 334 +#define __NR_clock_adjtime64 405 +#define __NR_clock_getres 258 +#define __NR_clock_getres_time64 406 +#define __NR_clock_gettime 257 +#define __NR_clock_gettime64 403 +#define __NR_clock_nanosleep 259 +#define __NR_clock_nanosleep_time64 407 +#define __NR_clock_settime 256 +#define __NR_clock_settime64 404 +#define __NR_clone 217 +#define __NR_close 6 +#define __NR_connect 98 +#define __NR_copy_file_range 357 +#define __NR_creat 8 +#define __NR_create_module 221 +#define __NR_delete_module 222 +#define __NR_dup 41 +#define __NR_dup2 90 +#define __NR_dup3 320 +#define __NR_epoll_create 193 +#define __NR_epoll_create1 319 +#define __NR_epoll_ctl 194 +#define __NR_epoll_pwait 309 +#define __NR_epoll_wait 195 +#define __NR_eventfd 313 +#define __NR_eventfd2 318 +#define __NR_execv 11 +#define __NR_execve 59 +#define __NR_execveat 350 +#define __NR_exit 1 +#define __NR_exit_group 188 +#define __NR_faccessat 296 +#define __NR_fadvise64 209 +#define __NR_fadvise64_64 210 +#define __NR_fallocate 314 +#define __NR_fanotify_init 329 +#define __NR_fanotify_mark 330 +#define __NR_fchdir 176 +#define __NR_fchmod 124 +#define __NR_fchmodat 295 +#define __NR_fchown 123 +#define __NR_fchown32 32 +#define __NR_fchownat 287 +#define __NR_fcntl 92 +#define __NR_fcntl64 155 +#define __NR_fdatasync 253 +#define __NR_fgetxattr 177 +#define __NR_finit_module 342 +#define __NR_flistxattr 180 +#define __NR_flock 131 +#define __NR_fork 2 +#define __NR_fremovexattr 186 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 171 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 62 +#define __NR_fstat64 63 +#define __NR_fstatat64 289 +#define __NR_fstatfs 158 +#define __NR_fstatfs64 235 +#define __NR_fsync 95 +#define __NR_ftruncate 130 +#define __NR_ftruncate64 84 +#define __NR_futex 142 +#define __NR_futex_time64 422 +#define __NR_futimesat 288 +#define __NR_get_kernel_syms 223 +#define __NR_get_mempolicy 304 +#define __NR_get_robust_list 301 +#define __NR_getcpu 308 +#define __NR_getcwd 119 +#define __NR_getdents 174 +#define __NR_getdents64 154 +#define __NR_getdomainname 162 +#define __NR_getegid 50 +#define __NR_getegid32 70 +#define __NR_geteuid 49 +#define __NR_geteuid32 69 +#define __NR_getgid 47 +#define __NR_getgid32 53 +#define __NR_getgroups 79 +#define __NR_getgroups32 115 +#define __NR_getitimer 86 +#define __NR_getpagesize 64 +#define __NR_getpeername 141 +#define __NR_getpgid 224 +#define __NR_getpgrp 81 +#define __NR_getpid 20 +#define __NR_getppid 197 +#define __NR_getpriority 100 +#define __NR_getrandom 347 +#define __NR_getresgid32 111 +#define __NR_getresuid32 109 +#define __NR_getrlimit 144 +#define __NR_getrusage 117 +#define __NR_getsid 252 +#define __NR_getsockname 150 +#define __NR_getsockopt 118 +#define __NR_gettid 143 +#define __NR_gettimeofday 116 +#define __NR_getuid 24 +#define __NR_getuid32 44 +#define __NR_getxattr 172 +#define __NR_init_module 190 +#define __NR_inotify_add_watch 152 +#define __NR_inotify_init 151 +#define __NR_inotify_init1 322 +#define __NR_inotify_rm_watch 156 +#define __NR_io_cancel 271 +#define __NR_io_destroy 269 +#define __NR_io_getevents 272 +#define __NR_io_pgetevents 361 +#define __NR_io_pgetevents_time64 416 +#define __NR_io_setup 268 +#define __NR_io_submit 270 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 218 +#define __NR_ioprio_set 196 +#define __NR_ipc 215 +#define __NR_kcmp 341 +#define __NR_kern_features 340 +#define __NR_kexec_load 306 +#define __NR_keyctl 283 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lchown32 31 +#define __NR_lgetxattr 173 +#define __NR_link 9 +#define __NR_linkat 292 +#define __NR_listen 354 +#define __NR_listxattr 178 +#define __NR_llistxattr 179 +#define __NR_lookup_dcookie 208 +#define __NR_lremovexattr 182 +#define __NR_lseek 19 +#define __NR_lsetxattr 170 +#define __NR_lstat 40 +#define __NR_lstat64 132 +#define __NR_madvise 75 +#define __NR_mbind 303 +#define __NR_membarrier 351 +#define __NR_memfd_create 348 +#define __NR_migrate_pages 302 +#define __NR_mincore 78 +#define __NR_mkdir 136 +#define __NR_mkdirat 285 +#define __NR_mknod 14 +#define __NR_mknodat 286 +#define __NR_mlock 237 +#define __NR_mlock2 356 +#define __NR_mlockall 239 +#define __NR_mmap 71 +#define __NR_mmap2 56 +#define __NR_mount 167 +#define __NR_move_mount 429 +#define __NR_move_pages 307 +#define __NR_mprotect 74 +#define __NR_mq_getsetattr 278 +#define __NR_mq_notify 277 +#define __NR_mq_open 273 +#define __NR_mq_timedreceive 276 +#define __NR_mq_timedreceive_time64 419 +#define __NR_mq_timedsend 275 +#define __NR_mq_timedsend_time64 418 +#define __NR_mq_unlink 274 +#define __NR_mremap 250 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 65 +#define __NR_munlock 238 +#define __NR_munlockall 240 +#define __NR_munmap 73 +#define __NR_name_to_handle_at 332 +#define __NR_nanosleep 249 +#define __NR_nfsservctl 254 +#define __NR_nice 34 +#define __NR_oldlstat 202 +#define __NR_open 5 +#define __NR_open_by_handle_at 333 +#define __NR_open_tree 428 +#define __NR_openat 284 +#define __NR_pause 29 +#define __NR_pciconfig_read 148 +#define __NR_pciconfig_write 149 +#define __NR_perf_event_open 327 +#define __NR_perfctr 18 +#define __NR_personality 191 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 321 +#define __NR_pivot_root 146 +#define __NR_pkey_alloc 363 +#define __NR_pkey_free 364 +#define __NR_pkey_mprotect 362 +#define __NR_poll 153 +#define __NR_ppoll 298 +#define __NR_ppoll_time64 414 +#define __NR_prctl 147 +#define __NR_pread64 67 +#define __NR_preadv 324 +#define __NR_preadv2 358 +#define __NR_prlimit64 331 +#define __NR_process_vm_readv 338 +#define __NR_process_vm_writev 339 +#define __NR_pselect6 297 +#define __NR_pselect6_time64 413 +#define __NR_ptrace 26 +#define __NR_pwrite64 68 +#define __NR_pwritev 325 +#define __NR_pwritev2 359 +#define __NR_query_module 184 +#define __NR_quotactl 165 +#define __NR_read 3 +#define __NR_readahead 205 +#define __NR_readdir 204 +#define __NR_readlink 58 +#define __NR_readlinkat 294 +#define __NR_readv 120 +#define __NR_reboot 55 +#define __NR_recvfrom 125 +#define __NR_recvmmsg 328 +#define __NR_recvmmsg_time64 417 +#define __NR_recvmsg 113 +#define __NR_remap_file_pages 192 +#define __NR_removexattr 181 +#define __NR_rename 128 +#define __NR_renameat 291 +#define __NR_renameat2 345 +#define __NR_request_key 282 +#define __NR_restart_syscall 0 +#define __NR_rmdir 137 +#define __NR_rseq 365 +#define __NR_rt_sigaction 102 +#define __NR_rt_sigpending 104 +#define __NR_rt_sigprocmask 103 +#define __NR_rt_sigqueueinfo 106 +#define __NR_rt_sigreturn 101 +#define __NR_rt_sigsuspend 107 +#define __NR_rt_sigtimedwait 105 +#define __NR_rt_sigtimedwait_time64 421 +#define __NR_rt_tgsigqueueinfo 326 +#define __NR_sched_get_affinity 161 +#define __NR_sched_get_priority_max 246 +#define __NR_sched_get_priority_min 247 +#define __NR_sched_getaffinity 260 +#define __NR_sched_getattr 344 +#define __NR_sched_getparam 242 +#define __NR_sched_getscheduler 244 +#define __NR_sched_rr_get_interval 248 +#define __NR_sched_rr_get_interval_time64 423 +#define __NR_sched_set_affinity 160 +#define __NR_sched_setaffinity 261 +#define __NR_sched_setattr 343 +#define __NR_sched_setparam 241 +#define __NR_sched_setscheduler 243 +#define __NR_sched_yield 245 +#define __NR_seccomp 346 +#define __NR_select 93 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop_time64 420 +#define __NR_sendfile 39 +#define __NR_sendfile64 140 +#define __NR_sendmmsg 336 +#define __NR_sendmsg 114 +#define __NR_sendto 133 +#define __NR_set_mempolicy 305 +#define __NR_set_robust_list 300 +#define __NR_set_tid_address 166 +#define __NR_setdomainname 163 +#define __NR_setfsgid 229 +#define __NR_setfsgid32 94 +#define __NR_setfsuid 228 +#define __NR_setfsuid32 91 +#define __NR_setgid 46 +#define __NR_setgid32 89 +#define __NR_setgroups 80 +#define __NR_setgroups32 82 +#define __NR_sethostname 88 +#define __NR_setitimer 83 +#define __NR_setns 337 +#define __NR_setpgid 185 +#define __NR_setpriority 96 +#define __NR_setregid 127 +#define __NR_setregid32 112 +#define __NR_setresgid32 110 +#define __NR_setresuid32 108 +#define __NR_setreuid 126 +#define __NR_setreuid32 72 +#define __NR_setrlimit 145 +#define __NR_setsid 175 +#define __NR_setsockopt 355 +#define __NR_settimeofday 122 +#define __NR_setuid 23 +#define __NR_setuid32 87 +#define __NR_setxattr 169 +#define __NR_sgetmask 199 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 134 +#define __NR_sigaction 198 +#define __NR_sigaltstack 28 +#define __NR_signal 48 +#define __NR_signalfd 311 +#define __NR_signalfd4 317 +#define __NR_sigpending 183 +#define __NR_sigprocmask 220 +#define __NR_sigreturn 216 +#define __NR_sigsuspend 201 +#define __NR_socket 97 +#define __NR_socketcall 206 +#define __NR_socketpair 135 +#define __NR_splice 232 +#define __NR_ssetmask 200 +#define __NR_stat 38 +#define __NR_stat64 139 +#define __NR_statfs 157 +#define __NR_statfs64 234 +#define __NR_statx 360 +#define __NR_stime 233 +#define __NR_swapoff 213 +#define __NR_swapon 85 +#define __NR_symlink 57 +#define __NR_symlinkat 293 +#define __NR_sync 36 +#define __NR_sync_file_range 255 +#define __NR_syncfs 335 +#define __NR_sysfs 226 +#define __NR_sysinfo 214 +#define __NR_syslog 207 +#define __NR_tee 280 +#define __NR_tgkill 211 +#define __NR_time 231 +#define __NR_timer_create 266 +#define __NR_timer_delete 265 +#define __NR_timer_getoverrun 264 +#define __NR_timer_gettime 263 +#define __NR_timer_gettime64 408 +#define __NR_timer_settime 262 +#define __NR_timer_settime64 409 +#define __NR_timerfd_create 312 +#define __NR_timerfd_gettime 316 +#define __NR_timerfd_gettime64 410 +#define __NR_timerfd_settime 315 +#define __NR_timerfd_settime64 411 +#define __NR_times 43 +#define __NR_tkill 187 +#define __NR_truncate 129 +#define __NR_truncate64 77 +#define __NR_umask 60 +#define __NR_umount 159 +#define __NR_umount2 45 +#define __NR_uname 189 +#define __NR_unlink 10 +#define __NR_unlinkat 290 +#define __NR_unshare 299 +#define __NR_uselib 203 +#define __NR_userfaultfd 352 +#define __NR_ustat 168 +#define __NR_utime 30 +#define __NR_utimensat 310 +#define __NR_utimensat_time64 412 +#define __NR_utimes 138 +#define __NR_vfork 66 +#define __NR_vhangup 76 +#define __NR_vmsplice 25 +#define __NR_vserver 267 +#define __NR_wait4 7 +#define __NR_waitid 279 +#define __NR_waitpid 212 +#define __NR_write 4 +#define __NR_writev 121 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h new file mode 100644 index 0000000000..495838303d --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/arch-syscall.h @@ -0,0 +1,368 @@ +#define __NR__llseek 236 +#define __NR__newselect 230 +#define __NR__sysctl 251 +#define __NR_accept 99 +#define __NR_accept4 323 +#define __NR_access 33 +#define __NR_acct 51 +#define __NR_add_key 281 +#define __NR_adjtimex 219 +#define __NR_afs_syscall 227 +#define __NR_alarm 27 +#define __NR_bdflush 225 +#define __NR_bind 353 +#define __NR_bpf 349 +#define __NR_brk 17 +#define __NR_capget 21 +#define __NR_capset 22 +#define __NR_chdir 12 +#define __NR_chmod 15 +#define __NR_chown 13 +#define __NR_chroot 61 +#define __NR_clock_adjtime 334 +#define __NR_clock_getres 258 +#define __NR_clock_gettime 257 +#define __NR_clock_nanosleep 259 +#define __NR_clock_settime 256 +#define __NR_clone 217 +#define __NR_close 6 +#define __NR_connect 98 +#define __NR_copy_file_range 357 +#define __NR_creat 8 +#define __NR_create_module 221 +#define __NR_delete_module 222 +#define __NR_dup 41 +#define __NR_dup2 90 +#define __NR_dup3 320 +#define __NR_epoll_create 193 +#define __NR_epoll_create1 319 +#define __NR_epoll_ctl 194 +#define __NR_epoll_pwait 309 +#define __NR_epoll_wait 195 +#define __NR_eventfd 313 +#define __NR_eventfd2 318 +#define __NR_execv 11 +#define __NR_execve 59 +#define __NR_execveat 350 +#define __NR_exit 1 +#define __NR_exit_group 188 +#define __NR_faccessat 296 +#define __NR_fadvise64 209 +#define __NR_fadvise64_64 210 +#define __NR_fallocate 314 +#define __NR_fanotify_init 329 +#define __NR_fanotify_mark 330 +#define __NR_fchdir 176 +#define __NR_fchmod 124 +#define __NR_fchmodat 295 +#define __NR_fchown 123 +#define __NR_fchownat 287 +#define __NR_fcntl 92 +#define __NR_fdatasync 253 +#define __NR_fgetxattr 177 +#define __NR_finit_module 342 +#define __NR_flistxattr 180 +#define __NR_flock 131 +#define __NR_fork 2 +#define __NR_fremovexattr 186 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 171 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 62 +#define __NR_fstat64 63 +#define __NR_fstatat64 289 +#define __NR_fstatfs 158 +#define __NR_fstatfs64 235 +#define __NR_fsync 95 +#define __NR_ftruncate 130 +#define __NR_futex 142 +#define __NR_futimesat 288 +#define __NR_get_kernel_syms 223 +#define __NR_get_mempolicy 304 +#define __NR_get_robust_list 301 +#define __NR_getcpu 308 +#define __NR_getcwd 119 +#define __NR_getdents 174 +#define __NR_getdents64 154 +#define __NR_getdomainname 162 +#define __NR_getegid 50 +#define __NR_geteuid 49 +#define __NR_getgid 47 +#define __NR_getgroups 79 +#define __NR_getitimer 86 +#define __NR_getpagesize 64 +#define __NR_getpeername 141 +#define __NR_getpgid 224 +#define __NR_getpgrp 81 +#define __NR_getpid 20 +#define __NR_getppid 197 +#define __NR_getpriority 100 +#define __NR_getrandom 347 +#define __NR_getresgid 111 +#define __NR_getresuid 109 +#define __NR_getrlimit 144 +#define __NR_getrusage 117 +#define __NR_getsid 252 +#define __NR_getsockname 150 +#define __NR_getsockopt 118 +#define __NR_gettid 143 +#define __NR_gettimeofday 116 +#define __NR_getuid 24 +#define __NR_getxattr 172 +#define __NR_init_module 190 +#define __NR_inotify_add_watch 152 +#define __NR_inotify_init 151 +#define __NR_inotify_init1 322 +#define __NR_inotify_rm_watch 156 +#define __NR_io_cancel 271 +#define __NR_io_destroy 269 +#define __NR_io_getevents 272 +#define __NR_io_pgetevents 361 +#define __NR_io_setup 268 +#define __NR_io_submit 270 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 54 +#define __NR_ioprio_get 218 +#define __NR_ioprio_set 196 +#define __NR_ipc 215 +#define __NR_kcmp 341 +#define __NR_kern_features 340 +#define __NR_kexec_load 306 +#define __NR_keyctl 283 +#define __NR_kill 37 +#define __NR_lchown 16 +#define __NR_lgetxattr 173 +#define __NR_link 9 +#define __NR_linkat 292 +#define __NR_listen 354 +#define __NR_listxattr 178 +#define __NR_llistxattr 179 +#define __NR_lookup_dcookie 208 +#define __NR_lremovexattr 182 +#define __NR_lseek 19 +#define __NR_lsetxattr 170 +#define __NR_lstat 40 +#define __NR_lstat64 132 +#define __NR_madvise 75 +#define __NR_mbind 303 +#define __NR_membarrier 351 +#define __NR_memfd_create 348 +#define __NR_memory_ordering 52 +#define __NR_migrate_pages 302 +#define __NR_mincore 78 +#define __NR_mkdir 136 +#define __NR_mkdirat 285 +#define __NR_mknod 14 +#define __NR_mknodat 286 +#define __NR_mlock 237 +#define __NR_mlock2 356 +#define __NR_mlockall 239 +#define __NR_mmap 71 +#define __NR_mount 167 +#define __NR_move_mount 429 +#define __NR_move_pages 307 +#define __NR_mprotect 74 +#define __NR_mq_getsetattr 278 +#define __NR_mq_notify 277 +#define __NR_mq_open 273 +#define __NR_mq_timedreceive 276 +#define __NR_mq_timedsend 275 +#define __NR_mq_unlink 274 +#define __NR_mremap 250 +#define __NR_msgctl 402 +#define __NR_msgget 399 +#define __NR_msgrcv 401 +#define __NR_msgsnd 400 +#define __NR_msync 65 +#define __NR_munlock 238 +#define __NR_munlockall 240 +#define __NR_munmap 73 +#define __NR_name_to_handle_at 332 +#define __NR_nanosleep 249 +#define __NR_nfsservctl 254 +#define __NR_nice 34 +#define __NR_oldlstat 202 +#define __NR_open 5 +#define __NR_open_by_handle_at 333 +#define __NR_open_tree 428 +#define __NR_openat 284 +#define __NR_pause 29 +#define __NR_pciconfig_read 148 +#define __NR_pciconfig_write 149 +#define __NR_perf_event_open 327 +#define __NR_perfctr 18 +#define __NR_personality 191 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 42 +#define __NR_pipe2 321 +#define __NR_pivot_root 146 +#define __NR_pkey_alloc 363 +#define __NR_pkey_free 364 +#define __NR_pkey_mprotect 362 +#define __NR_poll 153 +#define __NR_ppoll 298 +#define __NR_prctl 147 +#define __NR_pread64 67 +#define __NR_preadv 324 +#define __NR_preadv2 358 +#define __NR_prlimit64 331 +#define __NR_process_vm_readv 338 +#define __NR_process_vm_writev 339 +#define __NR_pselect6 297 +#define __NR_ptrace 26 +#define __NR_pwrite64 68 +#define __NR_pwritev 325 +#define __NR_pwritev2 359 +#define __NR_query_module 184 +#define __NR_quotactl 165 +#define __NR_read 3 +#define __NR_readahead 205 +#define __NR_readdir 204 +#define __NR_readlink 58 +#define __NR_readlinkat 294 +#define __NR_readv 120 +#define __NR_reboot 55 +#define __NR_recvfrom 125 +#define __NR_recvmmsg 328 +#define __NR_recvmsg 113 +#define __NR_remap_file_pages 192 +#define __NR_removexattr 181 +#define __NR_rename 128 +#define __NR_renameat 291 +#define __NR_renameat2 345 +#define __NR_request_key 282 +#define __NR_restart_syscall 0 +#define __NR_rmdir 137 +#define __NR_rseq 365 +#define __NR_rt_sigaction 102 +#define __NR_rt_sigpending 104 +#define __NR_rt_sigprocmask 103 +#define __NR_rt_sigqueueinfo 106 +#define __NR_rt_sigreturn 101 +#define __NR_rt_sigsuspend 107 +#define __NR_rt_sigtimedwait 105 +#define __NR_rt_tgsigqueueinfo 326 +#define __NR_sched_get_affinity 161 +#define __NR_sched_get_priority_max 246 +#define __NR_sched_get_priority_min 247 +#define __NR_sched_getaffinity 260 +#define __NR_sched_getattr 344 +#define __NR_sched_getparam 242 +#define __NR_sched_getscheduler 244 +#define __NR_sched_rr_get_interval 248 +#define __NR_sched_set_affinity 160 +#define __NR_sched_setaffinity 261 +#define __NR_sched_setattr 343 +#define __NR_sched_setparam 241 +#define __NR_sched_setscheduler 243 +#define __NR_sched_yield 245 +#define __NR_seccomp 346 +#define __NR_select 93 +#define __NR_semctl 394 +#define __NR_semget 393 +#define __NR_semtimedop 392 +#define __NR_sendfile 39 +#define __NR_sendfile64 140 +#define __NR_sendmmsg 336 +#define __NR_sendmsg 114 +#define __NR_sendto 133 +#define __NR_set_mempolicy 305 +#define __NR_set_robust_list 300 +#define __NR_set_tid_address 166 +#define __NR_setdomainname 163 +#define __NR_setfsgid 229 +#define __NR_setfsuid 228 +#define __NR_setgid 46 +#define __NR_setgroups 80 +#define __NR_sethostname 88 +#define __NR_setitimer 83 +#define __NR_setns 337 +#define __NR_setpgid 185 +#define __NR_setpriority 96 +#define __NR_setregid 127 +#define __NR_setresgid 110 +#define __NR_setresuid 108 +#define __NR_setreuid 126 +#define __NR_setrlimit 145 +#define __NR_setsid 175 +#define __NR_setsockopt 355 +#define __NR_settimeofday 122 +#define __NR_setuid 23 +#define __NR_setxattr 169 +#define __NR_sgetmask 199 +#define __NR_shmat 397 +#define __NR_shmctl 396 +#define __NR_shmdt 398 +#define __NR_shmget 395 +#define __NR_shutdown 134 +#define __NR_sigaction 198 +#define __NR_sigaltstack 28 +#define __NR_signal 48 +#define __NR_signalfd 311 +#define __NR_signalfd4 317 +#define __NR_sigpending 183 +#define __NR_sigprocmask 220 +#define __NR_sigreturn 216 +#define __NR_sigsuspend 201 +#define __NR_socket 97 +#define __NR_socketcall 206 +#define __NR_socketpair 135 +#define __NR_splice 232 +#define __NR_ssetmask 200 +#define __NR_stat 38 +#define __NR_stat64 139 +#define __NR_statfs 157 +#define __NR_statfs64 234 +#define __NR_statx 360 +#define __NR_stime 233 +#define __NR_swapoff 213 +#define __NR_swapon 85 +#define __NR_symlink 57 +#define __NR_symlinkat 293 +#define __NR_sync 36 +#define __NR_sync_file_range 255 +#define __NR_syncfs 335 +#define __NR_sysfs 226 +#define __NR_sysinfo 214 +#define __NR_syslog 207 +#define __NR_tee 280 +#define __NR_tgkill 211 +#define __NR_timer_create 266 +#define __NR_timer_delete 265 +#define __NR_timer_getoverrun 264 +#define __NR_timer_gettime 263 +#define __NR_timer_settime 262 +#define __NR_timerfd_create 312 +#define __NR_timerfd_gettime 316 +#define __NR_timerfd_settime 315 +#define __NR_times 43 +#define __NR_tkill 187 +#define __NR_truncate 129 +#define __NR_umask 60 +#define __NR_umount 159 +#define __NR_umount2 45 +#define __NR_uname 189 +#define __NR_unlink 10 +#define __NR_unlinkat 290 +#define __NR_unshare 299 +#define __NR_uselib 203 +#define __NR_userfaultfd 352 +#define __NR_ustat 168 +#define __NR_utime 30 +#define __NR_utimensat 310 +#define __NR_utimes 138 +#define __NR_utrap_install 164 +#define __NR_vfork 66 +#define __NR_vhangup 76 +#define __NR_vmsplice 25 +#define __NR_vserver 267 +#define __NR_wait4 7 +#define __NR_waitid 279 +#define __NR_waitpid 212 +#define __NR_write 4 +#define __NR_writev 121 diff --git a/sysdeps/unix/sysv/linux/tst-glibcsyscalls.py b/sysdeps/unix/sysv/linux/tst-glibcsyscalls.py new file mode 100644 index 0000000000..5ef0d3420d --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-glibcsyscalls.py @@ -0,0 +1,88 @@ +#!/usr/bin/python3 +# Consistency checks for glibc system call lists. +# 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 +# . + +import argparse +import sys + +import glibcextract +import glibcsyscalls + +def main(): + """The main entry point.""" + parser = argparse.ArgumentParser( + description="System call list consistency checks") + parser.add_argument('--cc', metavar='CC', required=True, + help='C compiler (including options) to use') + parser.add_argument('syscall_numbers_list', metavar='PATH', + help='Path to the list of system call numbers') + parser.add_argument('syscall_names_list', metavar='PATH', + help='Path to the list of system call names') + + args = parser.parse_args() + + glibc_constants = glibcsyscalls.load_arch_syscall_header( + args.syscall_numbers_list) + with open(args.syscall_names_list) as inp: + glibc_names = glibcsyscalls.SyscallNamesList(inp) + kernel_constants = glibcsyscalls.kernel_constants(args.cc) + kernel_version = glibcsyscalls.linux_kernel_version(args.cc) + + errors = 0 + warnings = False + for name in glibc_constants.keys() & kernel_constants.keys(): + if glibc_constants[name] != kernel_constants[name]: + print("error: syscall {!r} number mismatch: glibc={!r} kernel={!r}" + .format(name, glibc_constants[name], kernel_constants[name])) + errors = 1 + + # The architecture-specific list in the glibc tree must be a + # subset of the global list of system call names. + for name in glibc_constants.keys() - set(glibc_names.syscalls): + print("error: architecture syscall {!r} missing from global names list" + .format(name)) + errors = 1 + + for name in glibc_constants.keys() - kernel_constants.keys(): + print("info: glibc syscall {!r} not known to kernel".format(name)) + warnings = True + + # If the glibc-recorded kernel version is not older than the + # installed kernel headers, the glibc system call set must be a + # superset of the kernel system call set. + if glibc_names.kernel_version >= kernel_version: + for name in kernel_constants.keys() - glibc_constants.keys(): + print("error: kernel syscall {!r} ({}) not known to glibc" + .format(name, kernel_constants[name])) + errors = 1 + else: + for name in kernel_constants.keys() - glibc_constants.keys(): + print("warning: kernel syscall {!r} ({}) not known to glibc" + .format(name, kernel_constants[name])) + warnings = True + + if errors > 0 or warnings: + print("info: glibc tables are based on kernel version {}".format( + ".".join(map(str, glibc_names.kernel_version)))) + print("info: installed kernel headers are version {}".format( + ".".join(map(str, kernel_version)))) + + sys.exit(errors) + +if __name__ == '__main__': + main() diff --git a/sysdeps/unix/sysv/linux/tst-mman-consts.py b/sysdeps/unix/sysv/linux/tst-mman-consts.py index 3aaf2218f5..17e90ee8dc 100644 --- a/sysdeps/unix/sysv/linux/tst-mman-consts.py +++ b/sysdeps/unix/sysv/linux/tst-mman-consts.py @@ -21,15 +21,7 @@ import argparse import sys import glibcextract - - -def linux_kernel_version(cc): - """Return the (major, minor) version of the Linux kernel headers.""" - sym_data = ['#include ', 'START', - ('LINUX_VERSION_CODE', 'LINUX_VERSION_CODE')] - val = glibcextract.compute_c_consts(sym_data, cc)['LINUX_VERSION_CODE'] - val = int(val) - return ((val & 0xff0000) >> 16, (val & 0xff00) >> 8) +import glibcsyscalls def main(): @@ -40,7 +32,7 @@ def main(): parser.add_argument('--cc', metavar='CC', help='C compiler (including options) to use') args = parser.parse_args() - linux_version_headers = linux_kernel_version(args.cc) + linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) linux_version_glibc = (5, 4) sys.exit(glibcextract.compare_macro_consts( '#define _GNU_SOURCE 1\n' diff --git a/sysdeps/unix/sysv/linux/update-syscall-lists.py b/sysdeps/unix/sysv/linux/update-syscall-lists.py new file mode 100644 index 0000000000..6695583276 --- /dev/null +++ b/sysdeps/unix/sysv/linux/update-syscall-lists.py @@ -0,0 +1,66 @@ +#!/usr/bin/python3 +# Recreate and update syscall-names.list. +# 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 +# . + +import argparse +import os +import sys + +import glibcextract +import glibcsyscalls + +def main(): + """The main entry point.""" + parser = argparse.ArgumentParser( + description="System call list consistency checks") + parser.add_argument('--cc', metavar='CC', required=True, + help='C compiler (including options) to use') + parser.add_argument('arch_syscall', metavar='ARCH-SYSCALL-H', + help='The file to update') + parser.add_argument('names_list', metavar='SYSCALL-NAMES-LIST', + help='The syscall name list to update ') + + args = parser.parse_args() + + kernel_constants = glibcsyscalls.kernel_constants(args.cc) + + # Replace with data derived from kernel headers. + # No merging is necessary here. Arch-specific changes should go + # into . + with open(args.arch_syscall, "r+") as out: + os.lockf(out.fileno(), os.F_LOCK, 0) + out.truncate() + for name, value in sorted(kernel_constants.items()): + out.write("#define __NR_{} {}\n".format(name, value)) + + # Merge the architecture-specific system call names into the + # global names list, syscall-names.list. This file contains names + # from other architectures (and comments), so it is necessary to + # merge the existing files with the names obtained from the + # kernel. + with open(args.names_list, "r+") as list_file: + os.lockf(list_file.fileno(), os.F_LOCK, 0) + names_list = glibcsyscalls.SyscallNamesList(list_file) + merged = names_list.merge(kernel_constants.keys()) + list_file.truncate() + list_file.seek(0) + for line in merged: + list_file.write(line) + +if __name__ == '__main__': + main() diff --git a/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h new file mode 100644 index 0000000000..ff8434583e --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/64/arch-syscall.h @@ -0,0 +1,347 @@ +#define __NR__sysctl 156 +#define __NR_accept 43 +#define __NR_accept4 288 +#define __NR_access 21 +#define __NR_acct 163 +#define __NR_add_key 248 +#define __NR_adjtimex 159 +#define __NR_afs_syscall 183 +#define __NR_alarm 37 +#define __NR_arch_prctl 158 +#define __NR_bind 49 +#define __NR_bpf 321 +#define __NR_brk 12 +#define __NR_capget 125 +#define __NR_capset 126 +#define __NR_chdir 80 +#define __NR_chmod 90 +#define __NR_chown 92 +#define __NR_chroot 161 +#define __NR_clock_adjtime 305 +#define __NR_clock_getres 229 +#define __NR_clock_gettime 228 +#define __NR_clock_nanosleep 230 +#define __NR_clock_settime 227 +#define __NR_clone 56 +#define __NR_clone3 435 +#define __NR_close 3 +#define __NR_connect 42 +#define __NR_copy_file_range 326 +#define __NR_creat 85 +#define __NR_create_module 174 +#define __NR_delete_module 176 +#define __NR_dup 32 +#define __NR_dup2 33 +#define __NR_dup3 292 +#define __NR_epoll_create 213 +#define __NR_epoll_create1 291 +#define __NR_epoll_ctl 233 +#define __NR_epoll_ctl_old 214 +#define __NR_epoll_pwait 281 +#define __NR_epoll_wait 232 +#define __NR_epoll_wait_old 215 +#define __NR_eventfd 284 +#define __NR_eventfd2 290 +#define __NR_execve 59 +#define __NR_execveat 322 +#define __NR_exit 60 +#define __NR_exit_group 231 +#define __NR_faccessat 269 +#define __NR_fadvise64 221 +#define __NR_fallocate 285 +#define __NR_fanotify_init 300 +#define __NR_fanotify_mark 301 +#define __NR_fchdir 81 +#define __NR_fchmod 91 +#define __NR_fchmodat 268 +#define __NR_fchown 93 +#define __NR_fchownat 260 +#define __NR_fcntl 72 +#define __NR_fdatasync 75 +#define __NR_fgetxattr 193 +#define __NR_finit_module 313 +#define __NR_flistxattr 196 +#define __NR_flock 73 +#define __NR_fork 57 +#define __NR_fremovexattr 199 +#define __NR_fsconfig 431 +#define __NR_fsetxattr 190 +#define __NR_fsmount 432 +#define __NR_fsopen 430 +#define __NR_fspick 433 +#define __NR_fstat 5 +#define __NR_fstatfs 138 +#define __NR_fsync 74 +#define __NR_ftruncate 77 +#define __NR_futex 202 +#define __NR_futimesat 261 +#define __NR_get_kernel_syms 177 +#define __NR_get_mempolicy 239 +#define __NR_get_robust_list 274 +#define __NR_get_thread_area 211 +#define __NR_getcpu 309 +#define __NR_getcwd 79 +#define __NR_getdents 78 +#define __NR_getdents64 217 +#define __NR_getegid 108 +#define __NR_geteuid 107 +#define __NR_getgid 104 +#define __NR_getgroups 115 +#define __NR_getitimer 36 +#define __NR_getpeername 52 +#define __NR_getpgid 121 +#define __NR_getpgrp 111 +#define __NR_getpid 39 +#define __NR_getpmsg 181 +#define __NR_getppid 110 +#define __NR_getpriority 140 +#define __NR_getrandom 318 +#define __NR_getresgid 120 +#define __NR_getresuid 118 +#define __NR_getrlimit 97 +#define __NR_getrusage 98 +#define __NR_getsid 124 +#define __NR_getsockname 51 +#define __NR_getsockopt 55 +#define __NR_gettid 186 +#define __NR_gettimeofday 96 +#define __NR_getuid 102 +#define __NR_getxattr 191 +#define __NR_init_module 175 +#define __NR_inotify_add_watch 254 +#define __NR_inotify_init 253 +#define __NR_inotify_init1 294 +#define __NR_inotify_rm_watch 255 +#define __NR_io_cancel 210 +#define __NR_io_destroy 207 +#define __NR_io_getevents 208 +#define __NR_io_pgetevents 333 +#define __NR_io_setup 206 +#define __NR_io_submit 209 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_io_uring_setup 425 +#define __NR_ioctl 16 +#define __NR_ioperm 173 +#define __NR_iopl 172 +#define __NR_ioprio_get 252 +#define __NR_ioprio_set 251 +#define __NR_kcmp 312 +#define __NR_kexec_file_load 320 +#define __NR_kexec_load 246 +#define __NR_keyctl 250 +#define __NR_kill 62 +#define __NR_lchown 94 +#define __NR_lgetxattr 192 +#define __NR_link 86 +#define __NR_linkat 265 +#define __NR_listen 50 +#define __NR_listxattr 194 +#define __NR_llistxattr 195 +#define __NR_lookup_dcookie 212 +#define __NR_lremovexattr 198 +#define __NR_lseek 8 +#define __NR_lsetxattr 189 +#define __NR_lstat 6 +#define __NR_madvise 28 +#define __NR_mbind 237 +#define __NR_membarrier 324 +#define __NR_memfd_create 319 +#define __NR_migrate_pages 256 +#define __NR_mincore 27 +#define __NR_mkdir 83 +#define __NR_mkdirat 258 +#define __NR_mknod 133 +#define __NR_mknodat 259 +#define __NR_mlock 149 +#define __NR_mlock2 325 +#define __NR_mlockall 151 +#define __NR_mmap 9 +#define __NR_modify_ldt 154 +#define __NR_mount 165 +#define __NR_move_mount 429 +#define __NR_move_pages 279 +#define __NR_mprotect 10 +#define __NR_mq_getsetattr 245 +#define __NR_mq_notify 244 +#define __NR_mq_open 240 +#define __NR_mq_timedreceive 243 +#define __NR_mq_timedsend 242 +#define __NR_mq_unlink 241 +#define __NR_mremap 25 +#define __NR_msgctl 71 +#define __NR_msgget 68 +#define __NR_msgrcv 70 +#define __NR_msgsnd 69 +#define __NR_msync 26 +#define __NR_munlock 150 +#define __NR_munlockall 152 +#define __NR_munmap 11 +#define __NR_name_to_handle_at 303 +#define __NR_nanosleep 35 +#define __NR_newfstatat 262 +#define __NR_nfsservctl 180 +#define __NR_open 2 +#define __NR_open_by_handle_at 304 +#define __NR_open_tree 428 +#define __NR_openat 257 +#define __NR_pause 34 +#define __NR_perf_event_open 298 +#define __NR_personality 135 +#define __NR_pidfd_open 434 +#define __NR_pidfd_send_signal 424 +#define __NR_pipe 22 +#define __NR_pipe2 293 +#define __NR_pivot_root 155 +#define __NR_pkey_alloc 330 +#define __NR_pkey_free 331 +#define __NR_pkey_mprotect 329 +#define __NR_poll 7 +#define __NR_ppoll 271 +#define __NR_prctl 157 +#define __NR_pread64 17 +#define __NR_preadv 295 +#define __NR_preadv2 327 +#define __NR_prlimit64 302 +#define __NR_process_vm_readv 310 +#define __NR_process_vm_writev 311 +#define __NR_pselect6 270 +#define __NR_ptrace 101 +#define __NR_putpmsg 182 +#define __NR_pwrite64 18 +#define __NR_pwritev 296 +#define __NR_pwritev2 328 +#define __NR_query_module 178 +#define __NR_quotactl 179 +#define __NR_read 0 +#define __NR_readahead 187 +#define __NR_readlink 89 +#define __NR_readlinkat 267 +#define __NR_readv 19 +#define __NR_reboot 169 +#define __NR_recvfrom 45 +#define __NR_recvmmsg 299 +#define __NR_recvmsg 47 +#define __NR_remap_file_pages 216 +#define __NR_removexattr 197 +#define __NR_rename 82 +#define __NR_renameat 264 +#define __NR_renameat2 316 +#define __NR_request_key 249 +#define __NR_restart_syscall 219 +#define __NR_rmdir 84 +#define __NR_rseq 334 +#define __NR_rt_sigaction 13 +#define __NR_rt_sigpending 127 +#define __NR_rt_sigprocmask 14 +#define __NR_rt_sigqueueinfo 129 +#define __NR_rt_sigreturn 15 +#define __NR_rt_sigsuspend 130 +#define __NR_rt_sigtimedwait 128 +#define __NR_rt_tgsigqueueinfo 297 +#define __NR_sched_get_priority_max 146 +#define __NR_sched_get_priority_min 147 +#define __NR_sched_getaffinity 204 +#define __NR_sched_getattr 315 +#define __NR_sched_getparam 143 +#define __NR_sched_getscheduler 145 +#define __NR_sched_rr_get_interval 148 +#define __NR_sched_setaffinity 203 +#define __NR_sched_setattr 314 +#define __NR_sched_setparam 142 +#define __NR_sched_setscheduler 144 +#define __NR_sched_yield 24 +#define __NR_seccomp 317 +#define __NR_security 185 +#define __NR_select 23 +#define __NR_semctl 66 +#define __NR_semget 64 +#define __NR_semop 65 +#define __NR_semtimedop 220 +#define __NR_sendfile 40 +#define __NR_sendmmsg 307 +#define __NR_sendmsg 46 +#define __NR_sendto 44 +#define __NR_set_mempolicy 238 +#define __NR_set_robust_list 273 +#define __NR_set_thread_area 205 +#define __NR_set_tid_address 218 +#define __NR_setdomainname 171 +#define __NR_setfsgid 123 +#define __NR_setfsuid 122 +#define __NR_setgid 106 +#define __NR_setgroups 116 +#define __NR_sethostname 170 +#define __NR_setitimer 38 +#define __NR_setns 308 +#define __NR_setpgid 109 +#define __NR_setpriority 141 +#define __NR_setregid 114 +#define __NR_setresgid 119 +#define __NR_setresuid 117 +#define __NR_setreuid 113 +#define __NR_setrlimit 160 +#define __NR_setsid 112 +#define __NR_setsockopt 54 +#define __NR_settimeofday 164 +#define __NR_setuid 105 +#define __NR_setxattr 188 +#define __NR_shmat 30 +#define __NR_shmctl 31 +#define __NR_shmdt 67 +#define __NR_shmget 29 +#define __NR_shutdown 48 +#define __NR_sigaltstack 131 +#define __NR_signalfd 282 +#define __NR_signalfd4 289 +#define __NR_socket 41 +#define __NR_socketpair 53 +#define __NR_splice 275 +#define __NR_stat 4 +#define __NR_statfs 137 +#define __NR_statx 332 +#define __NR_swapoff 168 +#define __NR_swapon 167 +#define __NR_symlink 88 +#define __NR_symlinkat 266 +#define __NR_sync 162 +#define __NR_sync_file_range 277 +#define __NR_syncfs 306 +#define __NR_sysfs 139 +#define __NR_sysinfo 99 +#define __NR_syslog 103 +#define __NR_tee 276 +#define __NR_tgkill 234 +#define __NR_time 201 +#define __NR_timer_create 222 +#define __NR_timer_delete 226 +#define __NR_timer_getoverrun 225 +#define __NR_timer_gettime 224 +#define __NR_timer_settime 223 +#define __NR_timerfd_create 283 +#define __NR_timerfd_gettime 287 +#define __NR_timerfd_settime 286 +#define __NR_times 100 +#define __NR_tkill 200 +#define __NR_truncate 76 +#define __NR_tuxcall 184 +#define __NR_umask 95 +#define __NR_umount2 166 +#define __NR_uname 63 +#define __NR_unlink 87 +#define __NR_unlinkat 263 +#define __NR_unshare 272 +#define __NR_uselib 134 +#define __NR_userfaultfd 323 +#define __NR_ustat 136 +#define __NR_utime 132 +#define __NR_utimensat 280 +#define __NR_utimes 235 +#define __NR_vfork 58 +#define __NR_vhangup 153 +#define __NR_vmsplice 278 +#define __NR_vserver 236 +#define __NR_wait4 61 +#define __NR_waitid 247 +#define __NR_write 1 +#define __NR_writev 20 diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h new file mode 100644 index 0000000000..86b556e5be --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h @@ -0,0 +1,336 @@ +#define __NR_accept 1073741867 +#define __NR_accept4 1073742112 +#define __NR_access 1073741845 +#define __NR_acct 1073741987 +#define __NR_add_key 1073742072 +#define __NR_adjtimex 1073741983 +#define __NR_afs_syscall 1073742007 +#define __NR_alarm 1073741861 +#define __NR_arch_prctl 1073741982 +#define __NR_bind 1073741873 +#define __NR_bpf 1073742145 +#define __NR_brk 1073741836 +#define __NR_capget 1073741949 +#define __NR_capset 1073741950 +#define __NR_chdir 1073741904 +#define __NR_chmod 1073741914 +#define __NR_chown 1073741916 +#define __NR_chroot 1073741985 +#define __NR_clock_adjtime 1073742129 +#define __NR_clock_getres 1073742053 +#define __NR_clock_gettime 1073742052 +#define __NR_clock_nanosleep 1073742054 +#define __NR_clock_settime 1073742051 +#define __NR_clone 1073741880 +#define __NR_clone3 1073742259 +#define __NR_close 1073741827 +#define __NR_connect 1073741866 +#define __NR_copy_file_range 1073742150 +#define __NR_creat 1073741909 +#define __NR_delete_module 1073742000 +#define __NR_dup 1073741856 +#define __NR_dup2 1073741857 +#define __NR_dup3 1073742116 +#define __NR_epoll_create 1073742037 +#define __NR_epoll_create1 1073742115 +#define __NR_epoll_ctl 1073742057 +#define __NR_epoll_pwait 1073742105 +#define __NR_epoll_wait 1073742056 +#define __NR_eventfd 1073742108 +#define __NR_eventfd2 1073742114 +#define __NR_execve 1073742344 +#define __NR_execveat 1073742369 +#define __NR_exit 1073741884 +#define __NR_exit_group 1073742055 +#define __NR_faccessat 1073742093 +#define __NR_fadvise64 1073742045 +#define __NR_fallocate 1073742109 +#define __NR_fanotify_init 1073742124 +#define __NR_fanotify_mark 1073742125 +#define __NR_fchdir 1073741905 +#define __NR_fchmod 1073741915 +#define __NR_fchmodat 1073742092 +#define __NR_fchown 1073741917 +#define __NR_fchownat 1073742084 +#define __NR_fcntl 1073741896 +#define __NR_fdatasync 1073741899 +#define __NR_fgetxattr 1073742017 +#define __NR_finit_module 1073742137 +#define __NR_flistxattr 1073742020 +#define __NR_flock 1073741897 +#define __NR_fork 1073741881 +#define __NR_fremovexattr 1073742023 +#define __NR_fsconfig 1073742255 +#define __NR_fsetxattr 1073742014 +#define __NR_fsmount 1073742256 +#define __NR_fsopen 1073742254 +#define __NR_fspick 1073742257 +#define __NR_fstat 1073741829 +#define __NR_fstatfs 1073741962 +#define __NR_fsync 1073741898 +#define __NR_ftruncate 1073741901 +#define __NR_futex 1073742026 +#define __NR_futimesat 1073742085 +#define __NR_get_mempolicy 1073742063 +#define __NR_get_robust_list 1073742355 +#define __NR_getcpu 1073742133 +#define __NR_getcwd 1073741903 +#define __NR_getdents 1073741902 +#define __NR_getdents64 1073742041 +#define __NR_getegid 1073741932 +#define __NR_geteuid 1073741931 +#define __NR_getgid 1073741928 +#define __NR_getgroups 1073741939 +#define __NR_getitimer 1073741860 +#define __NR_getpeername 1073741876 +#define __NR_getpgid 1073741945 +#define __NR_getpgrp 1073741935 +#define __NR_getpid 1073741863 +#define __NR_getpmsg 1073742005 +#define __NR_getppid 1073741934 +#define __NR_getpriority 1073741964 +#define __NR_getrandom 1073742142 +#define __NR_getresgid 1073741944 +#define __NR_getresuid 1073741942 +#define __NR_getrlimit 1073741921 +#define __NR_getrusage 1073741922 +#define __NR_getsid 1073741948 +#define __NR_getsockname 1073741875 +#define __NR_getsockopt 1073742366 +#define __NR_gettid 1073742010 +#define __NR_gettimeofday 1073741920 +#define __NR_getuid 1073741926 +#define __NR_getxattr 1073742015 +#define __NR_init_module 1073741999 +#define __NR_inotify_add_watch 1073742078 +#define __NR_inotify_init 1073742077 +#define __NR_inotify_init1 1073742118 +#define __NR_inotify_rm_watch 1073742079 +#define __NR_io_cancel 1073742034 +#define __NR_io_destroy 1073742031 +#define __NR_io_getevents 1073742032 +#define __NR_io_pgetevents 1073742157 +#define __NR_io_setup 1073742367 +#define __NR_io_submit 1073742368 +#define __NR_io_uring_enter 1073742250 +#define __NR_io_uring_register 1073742251 +#define __NR_io_uring_setup 1073742249 +#define __NR_ioctl 1073742338 +#define __NR_ioperm 1073741997 +#define __NR_iopl 1073741996 +#define __NR_ioprio_get 1073742076 +#define __NR_ioprio_set 1073742075 +#define __NR_kcmp 1073742136 +#define __NR_kexec_file_load 1073742144 +#define __NR_kexec_load 1073742352 +#define __NR_keyctl 1073742074 +#define __NR_kill 1073741886 +#define __NR_lchown 1073741918 +#define __NR_lgetxattr 1073742016 +#define __NR_link 1073741910 +#define __NR_linkat 1073742089 +#define __NR_listen 1073741874 +#define __NR_listxattr 1073742018 +#define __NR_llistxattr 1073742019 +#define __NR_lookup_dcookie 1073742036 +#define __NR_lremovexattr 1073742022 +#define __NR_lseek 1073741832 +#define __NR_lsetxattr 1073742013 +#define __NR_lstat 1073741830 +#define __NR_madvise 1073741852 +#define __NR_mbind 1073742061 +#define __NR_membarrier 1073742148 +#define __NR_memfd_create 1073742143 +#define __NR_migrate_pages 1073742080 +#define __NR_mincore 1073741851 +#define __NR_mkdir 1073741907 +#define __NR_mkdirat 1073742082 +#define __NR_mknod 1073741957 +#define __NR_mknodat 1073742083 +#define __NR_mlock 1073741973 +#define __NR_mlock2 1073742149 +#define __NR_mlockall 1073741975 +#define __NR_mmap 1073741833 +#define __NR_modify_ldt 1073741978 +#define __NR_mount 1073741989 +#define __NR_move_mount 1073742253 +#define __NR_move_pages 1073742357 +#define __NR_mprotect 1073741834 +#define __NR_mq_getsetattr 1073742069 +#define __NR_mq_notify 1073742351 +#define __NR_mq_open 1073742064 +#define __NR_mq_timedreceive 1073742067 +#define __NR_mq_timedsend 1073742066 +#define __NR_mq_unlink 1073742065 +#define __NR_mremap 1073741849 +#define __NR_msgctl 1073741895 +#define __NR_msgget 1073741892 +#define __NR_msgrcv 1073741894 +#define __NR_msgsnd 1073741893 +#define __NR_msync 1073741850 +#define __NR_munlock 1073741974 +#define __NR_munlockall 1073741976 +#define __NR_munmap 1073741835 +#define __NR_name_to_handle_at 1073742127 +#define __NR_nanosleep 1073741859 +#define __NR_newfstatat 1073742086 +#define __NR_open 1073741826 +#define __NR_open_by_handle_at 1073742128 +#define __NR_open_tree 1073742252 +#define __NR_openat 1073742081 +#define __NR_pause 1073741858 +#define __NR_perf_event_open 1073742122 +#define __NR_personality 1073741959 +#define __NR_pidfd_open 1073742258 +#define __NR_pidfd_send_signal 1073742248 +#define __NR_pipe 1073741846 +#define __NR_pipe2 1073742117 +#define __NR_pivot_root 1073741979 +#define __NR_pkey_alloc 1073742154 +#define __NR_pkey_free 1073742155 +#define __NR_pkey_mprotect 1073742153 +#define __NR_poll 1073741831 +#define __NR_ppoll 1073742095 +#define __NR_prctl 1073741981 +#define __NR_pread64 1073741841 +#define __NR_preadv 1073742358 +#define __NR_preadv2 1073742370 +#define __NR_prlimit64 1073742126 +#define __NR_process_vm_readv 1073742363 +#define __NR_process_vm_writev 1073742364 +#define __NR_pselect6 1073742094 +#define __NR_ptrace 1073742345 +#define __NR_putpmsg 1073742006 +#define __NR_pwrite64 1073741842 +#define __NR_pwritev 1073742359 +#define __NR_pwritev2 1073742371 +#define __NR_quotactl 1073742003 +#define __NR_read 1073741824 +#define __NR_readahead 1073742011 +#define __NR_readlink 1073741913 +#define __NR_readlinkat 1073742091 +#define __NR_readv 1073742339 +#define __NR_reboot 1073741993 +#define __NR_recvfrom 1073742341 +#define __NR_recvmmsg 1073742361 +#define __NR_recvmsg 1073742343 +#define __NR_remap_file_pages 1073742040 +#define __NR_removexattr 1073742021 +#define __NR_rename 1073741906 +#define __NR_renameat 1073742088 +#define __NR_renameat2 1073742140 +#define __NR_request_key 1073742073 +#define __NR_restart_syscall 1073742043 +#define __NR_rmdir 1073741908 +#define __NR_rseq 1073742158 +#define __NR_rt_sigaction 1073742336 +#define __NR_rt_sigpending 1073742346 +#define __NR_rt_sigprocmask 1073741838 +#define __NR_rt_sigqueueinfo 1073742348 +#define __NR_rt_sigreturn 1073742337 +#define __NR_rt_sigsuspend 1073741954 +#define __NR_rt_sigtimedwait 1073742347 +#define __NR_rt_tgsigqueueinfo 1073742360 +#define __NR_sched_get_priority_max 1073741970 +#define __NR_sched_get_priority_min 1073741971 +#define __NR_sched_getaffinity 1073742028 +#define __NR_sched_getattr 1073742139 +#define __NR_sched_getparam 1073741967 +#define __NR_sched_getscheduler 1073741969 +#define __NR_sched_rr_get_interval 1073741972 +#define __NR_sched_setaffinity 1073742027 +#define __NR_sched_setattr 1073742138 +#define __NR_sched_setparam 1073741966 +#define __NR_sched_setscheduler 1073741968 +#define __NR_sched_yield 1073741848 +#define __NR_seccomp 1073742141 +#define __NR_security 1073742009 +#define __NR_select 1073741847 +#define __NR_semctl 1073741890 +#define __NR_semget 1073741888 +#define __NR_semop 1073741889 +#define __NR_semtimedop 1073742044 +#define __NR_sendfile 1073741864 +#define __NR_sendmmsg 1073742362 +#define __NR_sendmsg 1073742342 +#define __NR_sendto 1073741868 +#define __NR_set_mempolicy 1073742062 +#define __NR_set_robust_list 1073742354 +#define __NR_set_tid_address 1073742042 +#define __NR_setdomainname 1073741995 +#define __NR_setfsgid 1073741947 +#define __NR_setfsuid 1073741946 +#define __NR_setgid 1073741930 +#define __NR_setgroups 1073741940 +#define __NR_sethostname 1073741994 +#define __NR_setitimer 1073741862 +#define __NR_setns 1073742132 +#define __NR_setpgid 1073741933 +#define __NR_setpriority 1073741965 +#define __NR_setregid 1073741938 +#define __NR_setresgid 1073741943 +#define __NR_setresuid 1073741941 +#define __NR_setreuid 1073741937 +#define __NR_setrlimit 1073741984 +#define __NR_setsid 1073741936 +#define __NR_setsockopt 1073742365 +#define __NR_settimeofday 1073741988 +#define __NR_setuid 1073741929 +#define __NR_setxattr 1073742012 +#define __NR_shmat 1073741854 +#define __NR_shmctl 1073741855 +#define __NR_shmdt 1073741891 +#define __NR_shmget 1073741853 +#define __NR_shutdown 1073741872 +#define __NR_sigaltstack 1073742349 +#define __NR_signalfd 1073742106 +#define __NR_signalfd4 1073742113 +#define __NR_socket 1073741865 +#define __NR_socketpair 1073741877 +#define __NR_splice 1073742099 +#define __NR_stat 1073741828 +#define __NR_statfs 1073741961 +#define __NR_statx 1073742156 +#define __NR_swapoff 1073741992 +#define __NR_swapon 1073741991 +#define __NR_symlink 1073741912 +#define __NR_symlinkat 1073742090 +#define __NR_sync 1073741986 +#define __NR_sync_file_range 1073742101 +#define __NR_syncfs 1073742130 +#define __NR_sysfs 1073741963 +#define __NR_sysinfo 1073741923 +#define __NR_syslog 1073741927 +#define __NR_tee 1073742100 +#define __NR_tgkill 1073742058 +#define __NR_time 1073742025 +#define __NR_timer_create 1073742350 +#define __NR_timer_delete 1073742050 +#define __NR_timer_getoverrun 1073742049 +#define __NR_timer_gettime 1073742048 +#define __NR_timer_settime 1073742047 +#define __NR_timerfd_create 1073742107 +#define __NR_timerfd_gettime 1073742111 +#define __NR_timerfd_settime 1073742110 +#define __NR_times 1073741924 +#define __NR_tkill 1073742024 +#define __NR_truncate 1073741900 +#define __NR_tuxcall 1073742008 +#define __NR_umask 1073741919 +#define __NR_umount2 1073741990 +#define __NR_uname 1073741887 +#define __NR_unlink 1073741911 +#define __NR_unlinkat 1073742087 +#define __NR_unshare 1073742096 +#define __NR_userfaultfd 1073742147 +#define __NR_ustat 1073741960 +#define __NR_utime 1073741956 +#define __NR_utimensat 1073742104 +#define __NR_utimes 1073742059 +#define __NR_vfork 1073741882 +#define __NR_vhangup 1073741977 +#define __NR_vmsplice 1073742356 +#define __NR_wait4 1073741885 +#define __NR_waitid 1073742353 +#define __NR_write 1073741825 +#define __NR_writev 1073742340 From patchwork Mon Jan 6 15:57:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108468-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="i6llLhkF"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="sxdlcK7z"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0YJ10DZz9s29 for ; Tue, 7 Jan 2020 02:58:43 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=r2fxwjcvEG98X45DBZTcOU29qWyGsMO DejfA8Yuq54vL3tFcOcqzdTdjuOn9VuAzE7AhxXpGhYSIk31e444uIf7jptl1Dgd jbLT/2kmKqbDHVW10l3eJEM6QSm93UDqak0IKg8Qg/YTs2ohVvIhSiDE2++JZ7vT AmTPF0Q81Gzw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=YENJwhzCbsF50Uh6fYNEAeyohxY=; b=i6llL hkFtHir1E/Af8ExMHyFuBqFKw368LLz0FuquSZljg6eLfZwUNsw0vJ9g24KdjVHR 38WGwvHGFq7M1e9BJjGb2CkmWMPIQY7MEVzCtL0+VKAVWgLDZzvLFEsDvSGSNW04 pISG6raEVN53cWjSvaPRrPPvkQa72ggENe2aPQ= Received: (qmail 95573 invoked by alias); 6 Jan 2020 15:57:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95482 invoked by uid 89); 6 Jan 2020 15:57:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=ipc X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 002541EA1AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=NfgUzjWJCaCcv86X8PKrC2e51n+B/519LegjT+GJCu0=; h=From:To:Date:Message-Id; b=sxdlcK7z9u8QHs9jwMNwFhIyL2I7LTkLFo2L43A+ozn2f20LQqzCqh7BDthe8YcCv hgs6lgNaJKqigiUogFsHKtH8FsuHa2mC7neyORcH+d/4DvOOv3uEveHEBhYkcFKi2D mr5NRulY90f8BUbCBYX/eqmFv9RT8ie3/a/cY3Vc4UTAmBRSswAn6i4V8ak8fhd9/s W1sHknVLlEu+OiiA2sXJTep+eAQd2UZYt+BCQESIEc4+pdUeb60eshiZH5+FBcLPqG lpXILXuASEejyT2ERpUo77E04VsDVk/hHxkVtuG/xlBx6q39OhCxI+uqtuCaAexSpZ 9H+sPzVQobxdw== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 05/13] Linux: Use system call tables during build Date: Mon, 6 Jan 2020 10:57:05 -0500 Message-Id: <20200106155713.397-6-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer Use instead of to obtain the system call numbers. A few direct includes of need to be removed (if the system call numbers are already provided indirectly by ) or replaced with . Current Linux headers for alpha define the required system call names, so most of the _NR_* hacks are no longer needed. For the 32-bit arm architecture, eliminate the INTERNAL_SYSCALL_ARM macro, now that we have regular system call names for cacheflush and set_tls. There are more such cleanup opportunities for other architectures, but these cleanups are required to avoid macro redefinition errors during the build. For ia64, it is desirable to use directly to obtain the break number for system calls (which is not a system call number itself). This requires replacing __BREAK_SYSCALL with __IA64_BREAK_SYSCALL because the former is defined as an alias in , but not in . --- NEWS | 3 +- sysdeps/ia64/start.S | 1 - sysdeps/microblaze/backtrace_linux.c | 2 +- .../unix/sysv/linux/alpha/kernel-features.h | 5 ---- sysdeps/unix/sysv/linux/alpha/sysdep.h | 25 ---------------- sysdeps/unix/sysv/linux/arm/dl-machine.h | 2 +- sysdeps/unix/sysv/linux/arm/sysdep.h | 4 --- sysdeps/unix/sysv/linux/arm/tls.h | 2 +- sysdeps/unix/sysv/linux/hppa/clone.S | 1 - sysdeps/unix/sysv/linux/ia64/brk.S | 1 - sysdeps/unix/sysv/linux/ia64/clone2.S | 4 +-- sysdeps/unix/sysv/linux/ia64/syscall.S | 2 +- sysdeps/unix/sysv/linux/ia64/sysdep.S | 2 +- sysdeps/unix/sysv/linux/ia64/sysdep.h | 5 ++-- sysdeps/unix/sysv/linux/include/sys/syscall.h | 29 +++++++++++++++++++ sysdeps/unix/sysv/linux/mips/vfork.S | 1 - sysdeps/unix/sysv/linux/nios2/sysdep.h | 1 - sysdeps/unix/sysv/linux/riscv/flush-icache.c | 1 + sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 1 - sysdeps/unix/sysv/linux/sys/syscall.h | 11 +++---- 21 files changed, 46 insertions(+), 58 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/include/sys/syscall.h diff --git a/NEWS b/NEWS index 5a2d0a5b8b..65140cbc42 100644 --- a/NEWS +++ b/NEWS @@ -101,7 +101,8 @@ Deprecated and removed features, and other changes affecting compatibility: Changes to build and runtime requirements: - [Add changes to build and runtime requirements here] +* It is no longer necessary to have recent Linux kernel headers to build + working (non-stub) system call wrappers. Security related changes: diff --git a/sysdeps/ia64/start.S b/sysdeps/ia64/start.S index 7c52d39fc9..239a728006 100644 --- a/sysdeps/ia64/start.S +++ b/sysdeps/ia64/start.S @@ -35,7 +35,6 @@ #include -#include #include /* diff --git a/sysdeps/microblaze/backtrace_linux.c b/sysdeps/microblaze/backtrace_linux.c index d4035bda43..89a318f62a 100644 --- a/sysdeps/microblaze/backtrace_linux.c +++ b/sysdeps/microblaze/backtrace_linux.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include int _identify_sighandler (unsigned long fp, unsigned long pc, diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index d12916c656..8b10cc748b 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -28,11 +28,6 @@ # define __ASSUME_STATFS64 0 #endif -/* Alpha used to define SysV ipc shmat syscall with a different name. */ -#ifndef __NR_shmat -# define __NR_shmat __NR_osf_shmat -#endif - #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h index acb9de44c2..4779d62689 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -37,31 +37,6 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name -/* Define some aliases to make automatic syscall generation work - properly. The SYS_* variants are for the benefit of the files in - sysdeps/unix. */ -#define __NR_getpid __NR_getxpid -#define __NR_getuid __NR_getxuid -#define __NR_getgid __NR_getxgid -#define SYS_getpid __NR_getxpid -#define SYS_getuid __NR_getxuid -#define SYS_getgid __NR_getxgid - -/* - * Some syscalls no Linux program should know about: - */ -#define __NR_osf_sigprocmask 48 -#ifndef __NR_osf_shmat -# define __NR_osf_shmat 209 -#endif -#define __NR_osf_getsysinfo 256 -#define __NR_osf_setsysinfo 257 - -/* Help old kernel headers where particular syscalls are not available. */ -#ifndef __NR_semtimedop -# define __NR_semtimedop 423 -#endif - /* This is a kludge to make syscalls.list find these under the names pread and pwrite, since some kernel headers define those names and some define the *64 names for the same system calls. */ diff --git a/sysdeps/unix/sysv/linux/arm/dl-machine.h b/sysdeps/unix/sysv/linux/arm/dl-machine.h index 5860258a61..ab5b4a988f 100644 --- a/sysdeps/unix/sysv/linux/arm/dl-machine.h +++ b/sysdeps/unix/sysv/linux/arm/dl-machine.h @@ -20,7 +20,7 @@ /* This definition is Linux-specific. */ #define CLEAR_CACHE(BEG,END) \ - INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0) + INTERNAL_SYSCALL (cacheflush, , 3, (BEG), (END), 0) #endif diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index e9e022e037..5b2a9df162 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -377,10 +377,6 @@ __local_syscall_error: \ #define INTERNAL_SYSCALL(name, err, nr, args...) \ INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) -#undef INTERNAL_SYSCALL_ARM -#define INTERNAL_SYSCALL_ARM(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args) - #undef INTERNAL_SYSCALL_ERROR_P #define INTERNAL_SYSCALL_ERROR_P(val, err) \ ((unsigned int) (val) >= 0xfffff001u) diff --git a/sysdeps/unix/sysv/linux/arm/tls.h b/sysdeps/unix/sysv/linux/arm/tls.h index 7dd9b646d4..54d6012160 100644 --- a/sysdeps/unix/sysv/linux/arm/tls.h +++ b/sysdeps/unix/sysv/linux/arm/tls.h @@ -33,7 +33,7 @@ # define TLS_INIT_TP(tcbp) \ ({ INTERNAL_SYSCALL_DECL (err); \ long int result_var; \ - result_var = INTERNAL_SYSCALL_ARM (set_tls, err, 1, (tcbp)); \ + result_var = INTERNAL_SYSCALL (set_tls, err, 1, (tcbp)); \ INTERNAL_SYSCALL_ERROR_P (result_var, err) \ ? "unknown error" : NULL; }) diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S index 372d29a838..536071b41e 100644 --- a/sysdeps/unix/sysv/linux/hppa/clone.S +++ b/sysdeps/unix/sysv/linux/hppa/clone.S @@ -20,7 +20,6 @@ /* clone() is even more special than fork() as it mucks with stacks and invokes a function in the right context after its all over. */ -#include #include #define _ERRNO_H 1 #include diff --git a/sysdeps/unix/sysv/linux/ia64/brk.S b/sysdeps/unix/sysv/linux/ia64/brk.S index 884ca2b2ff..8e5f22e97a 100644 --- a/sysdeps/unix/sysv/linux/ia64/brk.S +++ b/sysdeps/unix/sysv/linux/ia64/brk.S @@ -20,7 +20,6 @@ #include -#include #include .global __curbrk diff --git a/sysdeps/unix/sysv/linux/ia64/clone2.S b/sysdeps/unix/sysv/linux/ia64/clone2.S index 01e9eb931f..b43770d8d4 100644 --- a/sysdeps/unix/sysv/linux/ia64/clone2.S +++ b/sysdeps/unix/sysv/linux/ia64/clone2.S @@ -58,7 +58,7 @@ ENTRY(__clone2) */ mov r15=SYS_ify (clone2) .save rp, r0 - break __BREAK_SYSCALL + break __IA64_BREAK_SYSCALL .body cmp.eq p6,p0=-1,r10 cmp.eq CHILD,PARENT=0,r8 /* Are we the child? */ @@ -78,7 +78,7 @@ ENTRY(__clone2) mov gp=loc0 mov r15=SYS_ify (exit) .save rp, r0 - break __BREAK_SYSCALL + break __IA64_BREAK_SYSCALL ret /* Not reached. */ PSEUDO_END(__clone2) diff --git a/sysdeps/unix/sysv/linux/ia64/syscall.S b/sysdeps/unix/sysv/linux/ia64/syscall.S index b8209d2ed5..51430aa613 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscall.S +++ b/sysdeps/unix/sysv/linux/ia64/syscall.S @@ -25,7 +25,7 @@ ENTRY(syscall) in {out0...out5} like the kernel syscall handler expects. */ alloc r2=ar.pfs,1,0,8,0 mov r15=r32 /* syscall number */ - break __BREAK_SYSCALL + break __IA64_BREAK_SYSCALL ;; cmp.ne p6,p0=-1,r10 /* r10 = -1 on error */ (p6) ret diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.S b/sysdeps/unix/sysv/linux/ia64/sysdep.S index 0371c417a9..d3836e6040 100644 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.S +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.S @@ -51,7 +51,7 @@ END(__syscall_error) ENTRY(__ia64_syscall) mov r15=r37 /* syscall number */ - break __BREAK_SYSCALL + break __IA64_BREAK_SYSCALL cmp.eq p6,p0=-1,r10 /* r10 = -1 on error */ (p6) br.cond.spnt.few __syscall_error ret diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h index 4abe152ab7..e55b2eb316 100644 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -25,6 +25,7 @@ #include #include #include +#include /* In order to get __set_errno() definition in INLINE_SYSCALL. */ #ifndef __ASSEMBLER__ @@ -115,7 +116,7 @@ #define DO_CALL_VIA_BREAK(num) \ mov r15=num; \ - break __BREAK_SYSCALL + break __IA64_BREAK_SYSCALL #ifdef IA64_USE_NEW_STUB # ifdef SHARED @@ -229,7 +230,7 @@ register long _r15 asm ("r15") = name; \ long _retval; \ LOAD_REGS_##nr \ - __asm __volatile (BREAK_INSN (__BREAK_SYSCALL) \ + __asm __volatile (BREAK_INSN (__IA64_BREAK_SYSCALL) \ : "=r" (_r8), "=r" (_r10), "=r" (_r15) \ ASM_OUTARGS_##nr \ : "2" (_r15) ASM_ARGS_##nr \ diff --git a/sysdeps/unix/sysv/linux/include/sys/syscall.h b/sysdeps/unix/sysv/linux/include/sys/syscall.h new file mode 100644 index 0000000000..fe87e8ee25 --- /dev/null +++ b/sysdeps/unix/sysv/linux/include/sys/syscall.h @@ -0,0 +1,29 @@ +/* Wrapper header for . Linux version. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYSCALL_H + +#ifdef _ISOMAC +# include +#else /* !_ISOMAC */ +/* Use the built-in system call list, not , which may + not list all the system call numbers we need. */ +# define _SYSCALL_H +# include +#endif /* !_ISOMAC */ + +#endif /* _SYSCALL_H */ diff --git a/sysdeps/unix/sysv/linux/mips/vfork.S b/sysdeps/unix/sysv/linux/mips/vfork.S index ec0f6bd376..03b6cc269e 100644 --- a/sysdeps/unix/sysv/linux/mips/vfork.S +++ b/sysdeps/unix/sysv/linux/mips/vfork.S @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index 58c119dd06..dda6405027 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -19,7 +19,6 @@ #ifndef _LINUX_NIOS2_SYSDEP_H #define _LINUX_NIOS2_SYSDEP_H 1 -#include #include #include #include diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c index c5bd60d9c2..39dd293830 100644 --- a/sysdeps/unix/sysv/linux/riscv/flush-icache.c +++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c @@ -26,6 +26,7 @@ #else # include #endif +#include typedef int (*func_type) (void *, void *, unsigned long int); diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S index 6f6518e766..ee82d82721 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S @@ -20,7 +20,6 @@ and invokes a function in the right context after its all over. */ #include -#include #include #include diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S index f6122e5108..603c0a0384 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S @@ -20,7 +20,6 @@ and invokes a function in the right context after its all over. */ #include -#include #include #include diff --git a/sysdeps/unix/sysv/linux/sys/syscall.h b/sysdeps/unix/sysv/linux/sys/syscall.h index 223fba5a21..71e4250b96 100644 --- a/sysdeps/unix/sysv/linux/sys/syscall.h +++ b/sysdeps/unix/sysv/linux/sys/syscall.h @@ -23,12 +23,9 @@ from the kernel sources. */ #include -#ifndef _LIBC -/* The Linux kernel header file defines macros `__NR_', but some - programs expect the traditional form `SYS_'. So in building libc - we scan the kernel's list and produce with macros for - all the `SYS_' names. */ -# include -#endif +/* The Linux kernel header file defines macros __NR_*, but some + programs expect the traditional form SYS_*. + defines SYS_* macros for __NR_* macros of known names. */ +#include #endif From patchwork Mon Jan 6 15:57:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108465-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="jkVWTFcZ"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="c6ySnqLm"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Xh6vRzz9s29 for ; Tue, 7 Jan 2020 02:58:12 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=oksi2tsjEL0OwiCqcup2GcPcwArSfUQ bakNo3ApkvI6kf0hM03tb7pSEhagcH/eWfCQKxlmrcj9qgXbJO0LhEh29qsLUFow iXqnbVad5gXTfv1dhu2X+SFISmrUDP5SU7h9kDsMT0mtVbtJpiraiQT+sX8bYwZ6 5EK22HpQob9E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=mlg1/0HUUagNpKNnYEvrFPu5+b0=; b=jkVWT FcZTg9zAUnQ6+oaiJgi4FBVvu9xb78Zl1VyGVcJSjVFJ+1RfS4eHi0wB0qU0Pni1 w174uWemvqpHx4EFO3qVI0J1EtfEWDS5nCOw5115fPSQxTRk3eY0zS+MglUGDG3v iBFtlhqK42fJo0XXzy0JKJPHr4eH95HD+ArvgQ= Received: (qmail 95233 invoked by alias); 6 Jan 2020 15:57:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95139 invoked by uid 89); 6 Jan 2020 15:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=parisc X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 2634A1EA1B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=czcG+n6Qg2IAi29tBAMymh3L2XrUzfjCRs5xRkXzafw=; h=From:To:Date:Message-Id; b=c6ySnqLmk0LOocaRVwZtmYHqITTqvgrV5A6zKI8UMgnI0NtoTBLah1T2QV0katxFn KJFiUmm3uh05s7y9Ns2pVMV/lheyOMcz7hsbBSPI9nFK2KeVlO9c2DxgSazdikWvmq CNFjJMZZNytZzoIity1PUudwhn6rKg25r8N08RoifAkVR4OJueU0FZQUNnN63BtShU jaTs4KIsh+Szl32lw+Usw6Ic+scRyCfI8zwfx4Sp4P2jRDRcQfggt7YQNF/hJMUn8f fFI7DD5rjN4XEMeOHuF6fxWQIyy+NyutNe2w9o8JE9iH8odo/aDKg8zV15Ca0c83Vi lbBcZ0cIlri9Q== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 06/13] build-many-glibcs.py: Introduce LinuxHeadersPolicyForBuild Date: Mon, 6 Jan 2020 10:57:06 -0500 Message-Id: <20200106155713.397-7-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer And move install_linux_headers to the top level. --- scripts/build-many-glibcs.py | 91 +++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 193d49727b..56160a16fc 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -1160,6 +1160,53 @@ class Context(object): print('Script changed, bot re-execing.') self.exec_self() +class LinuxHeadersPolicyForBuild(object): + """Names and directories for installing Linux headers. Build variant.""" + + def __init__(self, config): + self.arch = config.arch + self.srcdir = config.ctx.component_srcdir('linux') + self.builddir = config.component_builddir('linux') + self.headers_dir = os.path.join(config.sysroot, 'usr') + +def install_linux_headers(policy, cmdlist): + """Install Linux kernel headers.""" + arch_map = {'aarch64': 'arm64', + 'alpha': 'alpha', + 'arm': 'arm', + 'csky': 'csky', + 'hppa': 'parisc', + 'i486': 'x86', + 'i586': 'x86', + 'i686': 'x86', + 'i786': 'x86', + 'ia64': 'ia64', + 'm68k': 'm68k', + 'microblaze': 'microblaze', + 'mips': 'mips', + 'nios2': 'nios2', + 'powerpc': 'powerpc', + 's390': 's390', + 'riscv32': 'riscv', + 'riscv64': 'riscv', + 'sh': 'sh', + 'sparc': 'sparc', + 'x86_64': 'x86'} + linux_arch = None + for k in arch_map: + if policy.arch.startswith(k): + linux_arch = arch_map[k] + break + assert linux_arch is not None + cmdlist.push_subdesc('linux') + cmdlist.create_use_dir(policy.builddir) + cmdlist.add_command('install-headers', + ['make', '-C', policy.srcdir, 'O=%s' % policy.builddir, + 'ARCH=%s' % linux_arch, + 'INSTALL_HDR_PATH=%s' % policy.headers_dir, + 'headers_install']) + cmdlist.cleanup_dir() + cmdlist.pop_subdesc() class Config(object): """A configuration for building a compiler and associated libraries.""" @@ -1218,7 +1265,7 @@ class Config(object): '--disable-readline', '--disable-sim']) if self.os.startswith('linux'): - self.install_linux_headers(cmdlist) + install_linux_headers(LinuxHeadersPolicyForBuild(self), cmdlist) self.build_gcc(cmdlist, True) if self.os == 'gnu': self.install_gnumach_headers(cmdlist) @@ -1266,48 +1313,6 @@ class Config(object): cmdlist.cleanup_dir() cmdlist.pop_subdesc() - def install_linux_headers(self, cmdlist): - """Install Linux kernel headers.""" - arch_map = {'aarch64': 'arm64', - 'alpha': 'alpha', - 'arm': 'arm', - 'csky': 'csky', - 'hppa': 'parisc', - 'i486': 'x86', - 'i586': 'x86', - 'i686': 'x86', - 'i786': 'x86', - 'ia64': 'ia64', - 'm68k': 'm68k', - 'microblaze': 'microblaze', - 'mips': 'mips', - 'nios2': 'nios2', - 'powerpc': 'powerpc', - 's390': 's390', - 'riscv32': 'riscv', - 'riscv64': 'riscv', - 'sh': 'sh', - 'sparc': 'sparc', - 'x86_64': 'x86'} - linux_arch = None - for k in arch_map: - if self.arch.startswith(k): - linux_arch = arch_map[k] - break - assert linux_arch is not None - srcdir = self.ctx.component_srcdir('linux') - builddir = self.component_builddir('linux') - headers_dir = os.path.join(self.sysroot, 'usr') - cmdlist.push_subdesc('linux') - cmdlist.create_use_dir(builddir) - cmdlist.add_command('install-headers', - ['make', '-C', srcdir, 'O=%s' % builddir, - 'ARCH=%s' % linux_arch, - 'INSTALL_HDR_PATH=%s' % headers_dir, - 'headers_install']) - cmdlist.cleanup_dir() - cmdlist.pop_subdesc() - def install_gnumach_headers(self, cmdlist): """Install GNU Mach headers.""" srcdir = self.ctx.component_srcdir('gnumach') From patchwork Mon Jan 6 15:57:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218283 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108467-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="hgEItI1i"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="EZdSeOs3"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Y44LG9z9s29 for ; Tue, 7 Jan 2020 02:58:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=WRTCvcCPa/99hXDteU10EQiR+E0iKci jO27d+BtXEnhfovzHE6Cbnp/iu48NFh9es4SHpuG9nyFISamCvO9Pby9deCNLFAb cgQ24P4p02rwEmt04yLCSLfJZtJByfNK6jchB49OnM1xbTsLQI53xvpXjsAnzZPa rAxhWVotAIeU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=LM3ZuuN2hrR5BGPaOLE88PbLoVs=; b=hgEIt I1iCLjaobBlxi2V4vSxhgmwgH5xuhWCusWdAunu5J3z3w3HBAE0rjr/Ml33ZcVKc VC0y2KGW+8yNVzct8Z2+3rchGkCE1HJzRKGjkwKlbKls7mWFnkuswC0fbzzilqGv 3jvPlZIUbHCM4kcAxLW2X9z3Yu/ksJt9hMiqQw= Received: (qmail 95321 invoked by alias); 6 Jan 2020 15:57:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95202 invoked by uid 89); 6 Jan 2020 15:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=customization X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 49C961EA1C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=tiXUHsM93xqC3TTSfHwpu5ksYq7F6/2Kd7zQkyMAphs=; h=From:To:Date:Message-Id; b=EZdSeOs30M4cc7D/4BqBSOE5dZ1Fs/eTlqcnYz26OSwu/vJ1zfu0xOhp/w67fZC9c 3SqGmihvN1eK1axPcDSIXg4+qwKqfK5O9c7VzQIBkx0XkFELjxE+XwK6VFgIGq1Dne RXrek3mG43874iT1b003PPwI4Ahfpr7Dkc8Z7g+1G9fEpQO8nuN+/zX7k9mPacEt0J chRAg034RgeMt57C1SIr52URBM8zFHoS6iB7w7pyViZii86AlxMmNYsZLGZqxtOAXa d++0FgtDkw+w0Urf6nBuwwVj7bEAYiEb2omnVPO+RWlBbSrvfgYyWE85MaBUdSKVnp mgYAqQOtJoIcg== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 07/13] build-many-glibcs.py: Introduce glibc build policy classes Date: Mon, 6 Jan 2020 10:57:07 -0500 Message-Id: <20200106155713.397-8-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> From: Florian Weimer The new classes GlibcPolicyForCompiler and GlibcPolicyForBuild allow customization of the Glibc.build_glibc method, replacing the existing for_compiler flag. --- scripts/build-many-glibcs.py | 129 ++++++++++++++++++++++------------- 1 file changed, 80 insertions(+), 49 deletions(-) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 56160a16fc..58f2409b1d 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -1274,7 +1274,7 @@ class Config(object): for g in self.compiler_glibcs: cmdlist.push_subdesc('glibc') cmdlist.push_subdesc(g.name) - g.build_glibc(cmdlist, True) + g.build_glibc(cmdlist, GlibcPolicyForCompiler(g)) cmdlist.pop_subdesc() cmdlist.pop_subdesc() self.build_gcc(cmdlist, False) @@ -1395,6 +1395,76 @@ class Config(object): '--enable-shared', '--enable-threads'] self.build_cross_tool(cmdlist, 'gcc', tool_build, cfg_opts) +class GlibcPolicyDefault(object): + """Build policy for glibc: common defaults.""" + + def __init__(self, glibc): + self.srcdir = glibc.ctx.component_srcdir('glibc') + self.use_usr = glibc.os != 'gnu' + self.prefix = '/usr' if self.use_usr else '' + self.configure_args = [ + '--prefix=%s' % self.prefix, + '--enable-profile', + '--build=%s' % glibc.ctx.build_triplet, + '--host=%s' % glibc.triplet, + 'CC=%s' % glibc.tool_name('gcc'), + 'CXX=%s' % glibc.tool_name('g++'), + 'AR=%s' % glibc.tool_name('ar'), + 'AS=%s' % glibc.tool_name('as'), + 'LD=%s' % glibc.tool_name('ld'), + 'NM=%s' % glibc.tool_name('nm'), + 'OBJCOPY=%s' % glibc.tool_name('objcopy'), + 'OBJDUMP=%s' % glibc.tool_name('objdump'), + 'RANLIB=%s' % glibc.tool_name('ranlib'), + 'READELF=%s' % glibc.tool_name('readelf'), + 'STRIP=%s' % glibc.tool_name('strip'), + ] + if glibc.os == 'gnu': + self.configure_args.append('MIG=%s' % glibc.tool_name('mig')) + self.configure_args += glibc.cfg + + def configure(self, cmdlist): + """Invoked to add the configure command to the command list.""" + cmdlist.add_command('configure', + [os.path.join(self.srcdir, 'configure'), + *self.configure_args]) + + def extra_commands(self, cmdlist): + """Invoked to inject additional commands (make check) after build.""" + pass + +class GlibcPolicyForCompiler(GlibcPolicyDefault): + """Build policy for glibc during the compilers stage.""" + + def __init__(self, glibc): + super().__init__(glibc) + self.builddir = glibc.ctx.component_builddir( + 'compilers', glibc.compiler.name, 'glibc', glibc.name) + self.installdir = glibc.compiler.sysroot + +class GlibcPolicyForBuild(GlibcPolicyDefault): + """Build policy for glibc during the glibcs stage.""" + + def __init__(self, glibc): + super().__init__(glibc) + self.builddir = glibc.ctx.component_builddir( + 'glibcs', glibc.name, 'glibc') + self.installdir = glibc.ctx.glibc_installdir(glibc.name) + if glibc.ctx.strip: + self.strip = glibc.tool_name('strip') + else: + self.strip = None + self.save_logs = glibc.ctx.save_logs + + def extra_commands(self, cmdlist): + if self.strip: + cmdlist.add_command('strip', + ['sh', '-c', + ('%s $(find %s/lib* -name "*.so")' % + (self.strip, self.installdir))]) + cmdlist.add_command('check', ['make', 'check']) + cmdlist.add_command('save-logs', [self.save_logs], always_run=True) + class Glibc(object): """A configuration for building glibc.""" @@ -1442,66 +1512,27 @@ class Glibc(object): ['test', '-f', os.path.join(self.compiler.installdir, 'ok')]) cmdlist.use_path(self.compiler.bindir) - self.build_glibc(cmdlist, False) + self.build_glibc(cmdlist, GlibcPolicyForBuild(self)) self.ctx.add_makefile_cmdlist('glibcs-%s' % self.name, cmdlist, logsdir) - def build_glibc(self, cmdlist, for_compiler): + def build_glibc(self, cmdlist, policy): """Generate commands to build this glibc, either as part of a compiler build or with the bootstrapped compiler (and in the latter case, run tests as well).""" - srcdir = self.ctx.component_srcdir('glibc') - if for_compiler: - builddir = self.ctx.component_builddir('compilers', - self.compiler.name, 'glibc', - self.name) - installdir = self.compiler.sysroot - else: - builddir = self.ctx.component_builddir('glibcs', self.name, - 'glibc') - installdir = self.ctx.glibc_installdir(self.name) - cmdlist.create_use_dir(builddir) - use_usr = self.os != 'gnu' - prefix = '/usr' if use_usr else '' - cfg_cmd = [os.path.join(srcdir, 'configure'), - '--prefix=%s' % prefix, - '--enable-profile', - '--build=%s' % self.ctx.build_triplet, - '--host=%s' % self.triplet, - 'CC=%s' % self.tool_name('gcc'), - 'CXX=%s' % self.tool_name('g++'), - 'AR=%s' % self.tool_name('ar'), - 'AS=%s' % self.tool_name('as'), - 'LD=%s' % self.tool_name('ld'), - 'NM=%s' % self.tool_name('nm'), - 'OBJCOPY=%s' % self.tool_name('objcopy'), - 'OBJDUMP=%s' % self.tool_name('objdump'), - 'RANLIB=%s' % self.tool_name('ranlib'), - 'READELF=%s' % self.tool_name('readelf'), - 'STRIP=%s' % self.tool_name('strip')] - if self.os == 'gnu': - cfg_cmd += ['MIG=%s' % self.tool_name('mig')] - cfg_cmd += self.cfg - cmdlist.add_command('configure', cfg_cmd) + cmdlist.create_use_dir(policy.builddir) + policy.configure(cmdlist) cmdlist.add_command('build', ['make']) cmdlist.add_command('install', ['make', 'install', - 'install_root=%s' % installdir]) + 'install_root=%s' % policy.installdir]) # GCC uses paths such as lib/../lib64, so make sure lib # directories always exist. mkdir_cmd = ['mkdir', '-p', - os.path.join(installdir, 'lib')] - if use_usr: - mkdir_cmd += [os.path.join(installdir, 'usr', 'lib')] + os.path.join(policy.installdir, 'lib')] + if policy.use_usr: + mkdir_cmd += [os.path.join(policy.installdir, 'usr', 'lib')] cmdlist.add_command('mkdir-lib', mkdir_cmd) - if not for_compiler: - if self.ctx.strip: - cmdlist.add_command('strip', - ['sh', '-c', - ('%s $(find %s/lib* -name "*.so")' % - (self.tool_name('strip'), installdir))]) - cmdlist.add_command('check', ['make', 'check']) - cmdlist.add_command('save-logs', [self.ctx.save_logs], - always_run=True) + policy.extra_commands(cmdlist) cmdlist.cleanup_dir() From patchwork Mon Jan 6 15:57:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108466-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="JSTibT8r"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="Zba9TCsa"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Xt1NSWz9sR1 for ; Tue, 7 Jan 2020 02:58:22 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=fpkVSAiqLJapiiZdxsAIXsLS8HMW9qEUoesdYaXelR3 PW3hrGm2w4/NbgzovroGXAFkL3BW5U42SRbEZwja6ItkMFUdzDQbhf8GxbwcaJfs DEnavZiVcBkvTtvd2Fj+bFvR2f1jsAKyGrbjkzQv16y4quOeaA8gUv/7MHCBIeCA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=2SwQZ3/Eso+JwFD2OovXrbsmtaM=; b=JSTibT8rhEJ0Ahg6B hT0b31vl91Bi3yyFZ9Qq5f1jqbOMsYnsi69wJLRlSNA+R4Vflzdaog8Ts8iN0SzQ hgsLgava0hJn/Y3V3Ro7kvWcfZtk8bxQFmzc8WH4rLOLe5tCDXAGkZnWSfRrnWRU DxI3Cmd98RWom+7Xdi2BoMwAXI= Received: (qmail 95307 invoked by alias); 6 Jan 2020 15:57:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95229 invoked by uid 89); 6 Jan 2020 15:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=glibc's, Command X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 7116A1EA1CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=S35KlLadx2UHOqn4tYNFcqiGB5ep8U8QNNZ8P0gAjQQ=; h=From:To:Date:Message-Id:MIME-Version; b=Zba9TCsa4ikRbk43yhoU1lriFFzCvgGIJEE8F58XRR6fTvH9L0IBAkqcdnzc3kiZ/ XVcymMcqSqApVUo8pZfhZ3QAW1f8ZAv9OrdQn6BCobWpwPbAnSzlSROT6qfdnOGLyK 0m65YDyOsgsvk7ZgnBMo3SQI+g2d9EAzIdgrdpiU4WzAkRjs1RwTCxzhQGeVxmavD2 6a4Gk/FVZkR+L6MyYftx3+fBYJ/zlS/OXjQa/JXQPjrqKBB+lWfClCYMcloXOcn+RL ofD6KZGNWmxzwXjmXCvnAnKtHL0EdY9YKudCblfJAIxgUTDuj6DbXK+oyZDgL0Lot9 LKZAg3092CzwQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org Subject: [RFC PATCH glibc 08/13] build-many-glibcs.py: Implement update-syscalls command Date: Mon, 6 Jan 2020 10:57:08 -0500 Message-Id: <20200106155713.397-9-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 From: Florian Weimer This command uses pre-built compilers to re-install the Linux headers from the current sources into a temporary location and runs glibc's “make update-syscalls-lists” against that. This updates the glibc source tree with the current system call numbers. --- scripts/build-many-glibcs.py | 65 ++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 58f2409b1d..eedaa55033 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -498,7 +498,10 @@ class Context(object): old_components = ('gmp', 'mpfr', 'mpc', 'binutils', 'gcc', 'linux', 'mig', 'gnumach', 'hurd') old_versions = self.build_state['compilers']['build-versions'] - self.build_glibcs(configs) + if action == 'update-syscalls': + self.update_syscalls(configs) + else: + self.build_glibcs(configs) self.write_files() self.do_build() if configs: @@ -689,6 +692,15 @@ class Context(object): for c in configs: self.glibc_configs[c].build() + def update_syscalls(self, configs): + """Update the glibc syscall lists.""" + if not configs: + self.remove_dirs(os.path.join(self.builddir, 'update-syscalls')) + self.remove_dirs(os.path.join(self.logsdir, 'update-syscalls')) + configs = sorted(self.glibc_configs.keys()) + for c in configs: + self.glibc_configs[c].update_syscalls() + def load_versions_json(self): """Load information about source directory versions.""" if not os.access(self.versions_json, os.F_OK): @@ -921,7 +933,7 @@ class Context(object): self.build_state = json.load(f) else: self.build_state = {} - for k in ('host-libraries', 'compilers', 'glibcs'): + for k in ('host-libraries', 'compilers', 'glibcs', 'update-syscalls'): if k not in self.build_state: self.build_state[k] = {} if 'build-time' not in self.build_state[k]: @@ -1169,6 +1181,16 @@ class LinuxHeadersPolicyForBuild(object): self.builddir = config.component_builddir('linux') self.headers_dir = os.path.join(config.sysroot, 'usr') +class LinuxHeadersPolicyForUpdateSyscalls(object): + """Names and directories for Linux headers. update-syscalls variant.""" + + def __init__(self, glibc, headers_dir): + self.arch = glibc.compiler.arch + self.srcdir = glibc.compiler.ctx.component_srcdir('linux') + self.builddir = glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'build-linux') + self.headers_dir = headers_dir + def install_linux_headers(policy, cmdlist): """Install Linux kernel headers.""" arch_map = {'aarch64': 'arm64', @@ -1465,6 +1487,20 @@ class GlibcPolicyForBuild(GlibcPolicyDefault): cmdlist.add_command('check', ['make', 'check']) cmdlist.add_command('save-logs', [self.save_logs], always_run=True) +class GlibcPolicyForUpdateSyscalls(GlibcPolicyDefault): + """Build policy for glibc during update-syscalls.""" + + def __init__(self, glibc): + super().__init__(glibc) + self.builddir = glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'glibc') + self.linuxdir = glibc.ctx.component_builddir( + 'update-syscalls', glibc.name, 'linux') + self.linux_policy = LinuxHeadersPolicyForUpdateSyscalls( + glibc, self.linuxdir) + self.configure_args.insert( + 0, '--with-headers=%s' % os.path.join(self.linuxdir, 'include')) + # self.installdir not set because installation is not supported class Glibc(object): """A configuration for building glibc.""" @@ -1535,6 +1571,28 @@ class Glibc(object): policy.extra_commands(cmdlist) cmdlist.cleanup_dir() + def update_syscalls(self): + if self.os == 'gnu': + # Hurd does not have system call tables that need updating. + return + + policy = GlibcPolicyForUpdateSyscalls(self) + logsdir = os.path.join(self.ctx.logsdir, 'update-syscalls', self.name) + self.ctx.remove_recreate_dirs(policy.builddir, logsdir) + cmdlist = CommandList('update-syscalls-%s' % self.name, self.ctx.keep) + cmdlist.add_command('check-compilers', + ['test', '-f', + os.path.join(self.compiler.installdir, 'ok')]) + cmdlist.use_path(self.compiler.bindir) + + install_linux_headers(policy.linux_policy, cmdlist) + + cmdlist.create_use_dir(policy.builddir) + policy.configure(cmdlist) + cmdlist.add_command('build', ['make', 'update-syscall-lists']) + cmdlist.cleanup_dir() + self.ctx.add_makefile_cmdlist('update-syscalls-%s' % self.name, + cmdlist, logsdir) class Command(object): """A command run in the build process.""" @@ -1702,7 +1760,8 @@ def get_parser(): parser.add_argument('action', help='What to do', choices=('checkout', 'bot-cycle', 'bot', - 'host-libraries', 'compilers', 'glibcs')) + 'host-libraries', 'compilers', 'glibcs', + 'update-syscalls')) parser.add_argument('configs', help='Versions to check out or configurations to build', nargs='*') From patchwork Mon Jan 6 15:57:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108472-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="G+erdzhH"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="rQHoXLqW"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Z44rnbz9s29 for ; Tue, 7 Jan 2020 02:59:24 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=SU6kQRgGVwKQ8gV1J/4rZ6CATQmNfXq wHoP7YC3UkByWK3oLYtzkGh2ew5cZRKB+FewzHQk4KY/ZLKsj1TBU1VxgVfEwhDs 8iznv577qjZEZXwdsndKlIvH15eYoj83jN6FgmbSWQGxWuzPHw3UO5PIqv7P+LPq GfaQJK6DeolY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=VRYB0wZcHi2qCIgq6upkFZcX06M=; b=G+erd zhHx4j6TAADmiOmJudtyAwBKY18RLDnrBDcLAIOuQDUxfbaxNXugn3scPj0TpHJd wBm1UN8VOdB3Dx00r1xD4l5+dBYyOqJ1f5z+gwLt+ZQMOoxijzbawB1bKm3dvEXe jKwJQ50XkkZvIWjhAqFLRNS9Tzl8Luv+01uac4= Received: (qmail 97175 invoked by alias); 6 Jan 2020 15:57:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97092 invoked by uid 89); 6 Jan 2020 15:57:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=excluding, Binary, organized, wishing X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 4DF901EA1F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326244; bh=1uQ286fXLmYtBWkZmNHYSM1oIrCIfsUDrWXoREm6KVA=; h=From:To:Date:Message-Id; b=rQHoXLqW6hDReYNXlH4vmWfS22OvjAX8GORff5uA7/EBFHmgbNtqc3Qp7VqlE9qk7 3z/itjHVhE8j4oj0a+x1AzYH5OeNFaRXfqcz/drUGWQTVUf15XoOK8gHVHaqgho7Id cTWjcSarvxZljq8Dysnl/PiGEQCooy+++OTNNoTGkzLLycKYGZYOvtE3FbYlUyTUcp Q8BFWd/VGCcToDJsAowBOCvblYtRD6NQY3dkNeChoRu21Vsb5dJXt26FoPsqi+LbWL uNKehr3fG4OhoDFm8yQiyUlMCLKrvSoKiJkddCN1V90nsWGLKHRX61sxAuTVc5lOhr hGtCZngPjvsMQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: [RFC PATCH glibc 09/13] glibc: Perform rseq(2) registration at C startup and thread creation (v13) Date: Mon, 6 Jan 2020 10:57:09 -0500 Message-Id: <20200106155713.397-10-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> Register rseq(2) TLS for each thread (including main), and unregister for each thread (excluding main). "rseq" stands for Restartable Sequences. See the rseq(2) man page proposed here: https://lkml.org/lkml/2018/9/19/647 This patch is based on glibc-2.30. The rseq(2) system call was merged into Linux 4.18. * NEWS: Add Restartable Sequences feature description. * elf/libc_early_init.c: Perform rseq(2) registration at C startup. startup for shared libc. * nptl/pthread_create.c: Perform rseq(2) registration at thread creation. * manual/threads.texi: Document __rseq_abi, RSEQ_SIG, sys/rseq.h. * sysdeps/unix/sysv/linux/Makefile: Add rseq-sym, sys/rseq.h, bits/rseq.h. * sysdeps/unix/sysv/linux/Versions: Export __rseq_abi from libc. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * misc/rseq-internal.h: New file. * sysdeps/unix/sysv/linux/rseq-internal.h: Likewise. * sysdeps/unix/sysv/linux/rseq-sym.c: Likewise. * sysdeps/unix/sysv/linux/sys/rseq.h: Likewise. * sysdeps/unix/sysv/linux/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/arm/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/rseq.h: Likewise. * sysdeps/unix/sysv/linux/x86/bits/rseq.h: Likewise. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: Rich Felker CC: libc-alpha@sourceware.org CC: linux-kernel@vger.kernel.org CC: linux-api@vger.kernel.org --- Changes since v1: - Move __rseq_refcount to an extra field at the end of __rseq_abi to eliminate one symbol. All libraries/programs which try to register rseq (glibc, early-adopter applications, early-adopter libraries) should use the rseq refcount. It becomes part of the ABI within a user-space process, but it's not part of the ABI shared with the kernel per se. - Restructure how this code is organized so glibc keeps building on non-Linux targets. - Use non-weak symbol for __rseq_abi. - Move rseq registration/unregistration implementation into its own nptl/rseq.c compile unit. - Move __rseq_abi symbol under GLIBC_2.29. Changes since v2: - Move __rseq_refcount to its own symbol, which is less ugly than trying to play tricks with the rseq uapi. - Move __rseq_abi from nptl to csu (C start up), so it can be used across glibc, including memory allocator and sched_getcpu(). The __rseq_refcount symbol is kept in nptl, because there is no reason to use it elsewhere in glibc. Changes since v3: - Set __rseq_refcount TLS to 1 on register/set to 0 on unregister because glibc is the first/last user. - Unconditionally register/unregister rseq at thread start/exit, because glibc is the first/last user. - Add missing abilist items. - Rebase on glibc master commit a502c5294. - Add NEWS entry. Changes since v4: - Do not use "weak" symbols for __rseq_abi and __rseq_refcount. Based on "System V Application Binary Interface", weak only affects the link editor, not the dynamic linker. - Install a new sys/rseq.h system header on Linux, which contains the RSEQ_SIG definition, __rseq_abi declaration and __rseq_refcount declaration. Move those definition/declarations from rseq-internal.h to the installed sys/rseq.h header. - Considering that rseq is only available on Linux, move csu/rseq.c to sysdeps/unix/sysv/linux/rseq-sym.c. - Move __rseq_refcount from nptl/rseq.c to sysdeps/unix/sysv/linux/rseq-sym.c, so it is only defined on Linux. - Move both ABI definitions for __rseq_abi and __rseq_refcount to sysdeps/unix/sysv/linux/Versions, so they only appear on Linux. - Document __rseq_abi and __rseq_refcount volatile. - Document the RSEQ_SIG signature define. - Move registration functions from rseq.c to rseq-internal.h static inline functions. Introduce empty stubs in misc/rseq-internal.h, which can be overridden by architecture code in sysdeps/unix/sysv/linux/rseq-internal.h. - Rename __rseq_register_current_thread and __rseq_unregister_current_thread to rseq_register_current_thread and rseq_unregister_current_thread, now that those are only visible as internal static inline functions. - Invoke rseq_register_current_thread() from libc-start.c LIBC_START_MAIN rather than nptl init, so applications not linked against libpthread.so have rseq registered for their main() thread. Note that it is invoked separately for SHARED and !SHARED builds. Changes since v5: - Replace __rseq_refcount by __rseq_lib_abi, which contains two uint32_t: register_state and refcount. The "register_state" field allows inhibiting rseq registration from signal handlers nested on top of glibc registration and occuring after rseq unregistration by glibc. - Introduce enum rseq_register_state, which contains the states allowed for the struct rseq_lib_abi register_state field. Changes since v6: - Introduce bits/rseq.h to define RSEQ_SIG for each architecture. The generic bits/rseq.h does not define RSEQ_SIG, meaning that each architecture implementing rseq needs to implement bits/rseq.h. - Rename enum item RSEQ_REGISTER_NESTED to RSEQ_REGISTER_ONGOING. - Port to glibc-2.29. Changes since v7: - Remove __rseq_lib_abi symbol, including refcount and register_state fields. - Remove reference counting and nested signals handling from registration/unregistration functions. - Introduce new __rseq_handled exported symbol, which is set to 1 by glibc on C startup when it handles restartable sequences. This allows glibc to coexist with early adopter libraries and applications wishing to register restartable sequences when it is not handled by glibc. - Introduce rseq_init (), which sets __rseq_handled to 1 from C startup. - Update NEWS entry. - Update comments at the beginning of new files. - Registration depends on both __NR_rseq and RSEQ_SIG. - Remove ARM, powerpc, MIPS RSEQ_SIG until we agree with maintainers on the signature choice. - Update x86, s390 RSEQ_SIG based on discussion with arch maintainers. - Remove rseq-internal.h from headers list of misc/Makefile, so it it not installed by make install. Changes since v8: - Introduce RSEQ_SIG_CODE and RSEQ_SIG_DATA on aarch64 to handle compiling with -mbig-endian. Changes since v9: - Update Changelog. - Remove unneeded new file comment header newlines. Changes since v10: - Remove volatile from __rseq_abi declaration. - Document that __rseq_handled is about library managing rseq registration, independently of whether rseq is available or not. - Move __rseq_handled symbol to ld.so, initialize this symbol within the dynamic linker initialization for both shared (rtld.c) and static (dl-support.c) builds. - Only register the rseq TLS on initialization once in multiple-libc scenarios. Use rtld_active () for this purpose. - In the static libc case, register the rseq TLS after LD_PRELOAD constructors are run, so it matches the order of this initialization vs LD_PRELOAD contructors execution for the shared libc. - Agreed on signature choice with powerpc and MIPS maintainers, re-adding those signatures, - The main architecture still left out signature-wise is ARM32. Changes since v11: - Rebase on glibc 2.30. - Re-introduce ARM RSEQ_SIG following feedback from Will Deacon. Changes since v12: - Remove __rseq_handled, - Rely on OS implicit rseq unregistration on thread teardown, - Register main thread in __libc_early_init (). - Add Restartable Sequences entry to threads manual. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: Rich Felker CC: libc-alpha@sourceware.org CC: linux-kernel@vger.kernel.org CC: linux-api@vger.kernel.org --- NEWS | 10 +++ elf/libc_early_init.c | 3 + manual/threads.texi | 17 ++++ misc/rseq-internal.h | 33 ++++++++ nptl/pthread_create.c | 12 +++ sysdeps/unix/sysv/linux/Makefile | 5 +- sysdeps/unix/sysv/linux/Versions | 3 + sysdeps/unix/sysv/linux/aarch64/bits/rseq.h | 43 ++++++++++ sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/bits/rseq.h | 83 +++++++++++++++++++ sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/bits/rseq.h | 29 +++++++ sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/bits/rseq.h | 62 ++++++++++++++ .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + sysdeps/unix/sysv/linux/powerpc/bits/rseq.h | 37 +++++++++ .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + sysdeps/unix/sysv/linux/rseq-internal.h | 77 +++++++++++++++++ sysdeps/unix/sysv/linux/rseq-sym.c | 43 ++++++++++ sysdeps/unix/sysv/linux/s390/bits/rseq.h | 37 +++++++++ .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sys/rseq.h | 30 +++++++ sysdeps/unix/sysv/linux/x86/bits/rseq.h | 30 +++++++ .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 44 files changed, 579 insertions(+), 2 deletions(-) create mode 100644 misc/rseq-internal.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/arm/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/rseq-internal.h create mode 100644 sysdeps/unix/sysv/linux/rseq-sym.c create mode 100644 sysdeps/unix/sysv/linux/s390/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/sys/rseq.h create mode 100644 sysdeps/unix/sysv/linux/x86/bits/rseq.h diff --git a/NEWS b/NEWS index 65140cbc42..e2830450d1 100644 --- a/NEWS +++ b/NEWS @@ -49,6 +49,16 @@ Major new features: responses, indicating a lack of DNSSEC validation. (Therefore, the name servers and the network path to them are treated as untrusted.) +* Support for automatically registering threads with the Linux rseq(2) + system call has been added. This system call is implemented starting + from Linux 4.18. The Restartable Sequences ABI accelerates user-space + operations on per-cpu data. It allows user-space to perform updates + on per-cpu data without requiring heavy-weight atomic operations. + Automatically registering threads allows all libraries, including libc, + to make immediate use of the rseq(2) support by using the documented ABI. + See 'man 2 rseq' for the details of the ABI shared between libc and the + kernel. + Deprecated and removed features, and other changes affecting compatibility: * The totalorder and totalordermag functions, and the corresponding diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c index 1ac66d895d..30466afea0 100644 --- a/elf/libc_early_init.c +++ b/elf/libc_early_init.c @@ -18,10 +18,13 @@ #include #include +#include void __libc_early_init (void) { /* Initialize ctype data. */ __ctype_init (); + /* Register rseq ABI to the kernel. */ + (void) rseq_register_current_thread (); } diff --git a/manual/threads.texi b/manual/threads.texi index 0858ef8f92..059f781120 100644 --- a/manual/threads.texi +++ b/manual/threads.texi @@ -881,3 +881,20 @@ Behaves like @code{pthread_timedjoin_np} except that the absolute time in @c pthread_spin_unlock @c pthread_testcancel @c pthread_yield + +@node Restartable Sequences +@section Restartable Sequences +@cindex rseq + +This section describes the @glibcadj{} Restartable Sequences integration. + +The @glibcadj{} implements a __rseq_abi TLS symbol to interact with the +Restartable Sequences system call (Linux-specific). The layout of this +structure is defined by the Linux kernel rseq.h UAPI. Registration of each +thread's __rseq_abi is performed by @glibcadj{} at libc initialization and +pthread creation. + +Each supported architecture provide a RSEQ_SIG signature in sys/rseq.h. That +signature is expected to be present in the code before each Restartable +Sequences abort handler. Failure to provide the expected signature may +terminate the process with a Segmentation fault. diff --git a/misc/rseq-internal.h b/misc/rseq-internal.h new file mode 100644 index 0000000000..df8fc6c006 --- /dev/null +++ b/misc/rseq-internal.h @@ -0,0 +1,33 @@ +/* Restartable Sequences internal API. Stub version. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 RSEQ_INTERNAL_H +#define RSEQ_INTERNAL_H + +static inline int +rseq_register_current_thread (void) +{ + return -1; +} + +static inline int +rseq_unregister_current_thread (void) +{ + return -1; +} + +#endif /* rseq-internal.h */ diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index b220ec526b..253443701c 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "libioP.h" #include @@ -384,6 +385,9 @@ START_THREAD_DEFN /* Initialize pointers to locale data. */ __ctype_init (); + /* Register rseq TLS to the kernel. */ + (void) rseq_register_current_thread (); + #ifdef __NR_set_robust_list # ifndef __ASSUME_SET_ROBUST_LIST if (__set_robust_list_avail >= 0) @@ -581,6 +585,14 @@ START_THREAD_DEFN process is really dead since 'clone' got passed the CLONE_CHILD_CLEARTID flag. The 'tid' field in the TCB will be set to zero. + rseq TLS is still registered at this point. Rely on implicit unregistration + performed by the kernel on thread teardown. This is not a problem because the + rseq TLS lives on the stack, and the stack outlives the thread. If TCB + allocation is ever changed, additional steps may be required, such as + performing explicit rseq unregistration before reclaiming the rseq TLS area + memory. It is NOT sufficient to block signals because the kernel may write + to the rseq area even without signals. + The exit code is zero since in case all threads exit by calling 'pthread_exit' the exit status must be 0 (zero). */ __exit_thread (); diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 502589c330..9da43b393e 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -37,7 +37,7 @@ update-syscall-lists: arch-syscall.h endif ifeq ($(subdir),csu) -sysdep_routines += errno-loc +sysdep_routines += errno-loc rseq-sym endif ifeq ($(subdir),assert) @@ -87,7 +87,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/termios-baud.h bits/termios-c_cflag.h \ bits/termios-c_lflag.h bits/termios-tcflow.h \ bits/termios-misc.h \ - bits/ipc-perm.h + bits/ipc-perm.h \ + sys/rseq.h bits/rseq.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index d385085c61..7f0da50580 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -177,6 +177,9 @@ libc { GLIBC_2.30 { getdents64; gettid; tgkill; } + GLIBC_2.31 { + __rseq_abi; + } GLIBC_PRIVATE { # functions used in other libraries __syscall_rt_sigqueueinfo; diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h b/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h new file mode 100644 index 0000000000..35fcc41f1e --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h @@ -0,0 +1,43 @@ +/* Restartable Sequences Linux aarch64 architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + aarch64 -mbig-endian generates mixed endianness code vs data: + little-endian code and big-endian data. Ensure the RSEQ_SIG signature + matches code endianness. */ + +#define RSEQ_SIG_CODE 0xd428bc00 /* BRK #0x45E0. */ + +#ifdef __AARCH64EB__ +#define RSEQ_SIG_DATA 0x00bc28d4 /* BRK #0x45E0. */ +#else +#define RSEQ_SIG_DATA RSEQ_SIG_CODE +#endif + +#define RSEQ_SIG RSEQ_SIG_DATA diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index a4c31932cb..6784f13c09 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2145,3 +2145,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index e7f2174ac2..71db8422a2 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2225,6 +2225,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/arm/bits/rseq.h b/sysdeps/unix/sysv/linux/arm/bits/rseq.h new file mode 100644 index 0000000000..cd00513bfb --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/bits/rseq.h @@ -0,0 +1,83 @@ +/* Restartable Sequences Linux arm architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* + RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + - ARM little endian + + RSEQ_SIG uses the udf A32 instruction with an uncommon immediate operand + value 0x5de3. This traps if user-space reaches this instruction by mistake, + and the uncommon operand ensures the kernel does not move the instruction + pointer to attacker-controlled code on rseq abort. + + The instruction pattern in the A32 instruction set is: + + e7f5def3 udf #24035 ; 0x5de3 + + This translates to the following instruction pattern in the T16 instruction + set: + + little endian: + def3 udf #243 ; 0xf3 + e7f5 b.n <7f5> + + - ARMv6+ big endian (BE8): + + ARMv6+ -mbig-endian generates mixed endianness code vs data: little-endian + code and big-endian data. The data value of the signature needs to have its + byte order reversed to generate the trap instruction: + + Data: 0xf3def5e7 + + Translates to this A32 instruction pattern: + + e7f5def3 udf #24035 ; 0x5de3 + + Translates to this T16 instruction pattern: + + def3 udf #243 ; 0xf3 + e7f5 b.n <7f5> + + - Prior to ARMv6 big endian (BE32): + + Prior to ARMv6, -mbig-endian generates big-endian code and data + (which match), so the endianness of the data representation of the + signature should not be reversed. However, the choice between BE32 + and BE8 is done by the linker, so we cannot know whether code and + data endianness will be mixed before the linker is invoked. So rather + than try to play tricks with the linker, the rseq signature is simply + data (not a trap instruction) prior to ARMv6 on big endian. This is + why the signature is expressed as data (.word) rather than as + instruction (.inst) in assembler. */ + +#ifdef __ARMEB__ +#define RSEQ_SIG 0xf3def5e7 /* udf #24035 ; 0x5de3 (ARMv6+) */ +#else +#define RSEQ_SIG 0xe7f5def3 /* udf #24035 ; 0x5de3 */ +#endif diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 9371927927..3e7434d3d5 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/bits/rseq.h b/sysdeps/unix/sysv/linux/bits/rseq.h new file mode 100644 index 0000000000..a3c023f5c7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/rseq.h @@ -0,0 +1,29 @@ +/* Restartable Sequences architecture header. Stub version. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. */ diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 9b3cee65bb..b7ed346b1c 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2089,3 +2089,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index df6d96fbae..d55b153c48 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2046,6 +2046,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index fcb625b6bf..c9061600f6 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2212,6 +2212,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index cb556c5998..f794303f0e 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2078,6 +2078,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 5e3cdea246..e5e545f3af 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 GLIBC_2.4 _IO_2_1_stdin_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index ea5e7a41af..3fc1223e2c 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2158,6 +2158,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index f7ced487f7..a2ce147dde 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2137,3 +2137,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/mips/bits/rseq.h b/sysdeps/unix/sysv/linux/mips/bits/rseq.h new file mode 100644 index 0000000000..8c75f107e7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/rseq.h @@ -0,0 +1,62 @@ +/* Restartable Sequences Linux mips architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the break instruction. The instruction pattern is: + + On MIPS: + 0350000d break 0x350 + + On nanoMIPS: + 00100350 break 0x350 + + On microMIPS: + 0000d407 break 0x350 + + For nanoMIPS32 and microMIPS, the instruction stream is encoded as + 16-bit halfwords, so the signature halfwords need to be swapped + accordingly for little-endian. */ + +#if defined(__nanomips__) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0x03500010 +# else +# define RSEQ_SIG 0x00100350 +# endif +#elif defined(__mips_micromips) +# ifdef __MIPSEL__ +# define RSEQ_SIG 0xd4070000 +# else +# define RSEQ_SIG 0x0000d407 +# endif +#elif defined(__mips__) +# define RSEQ_SIG 0x0350000d +#else +/* Unknown MIPS architecture. */ +#endif diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 06c2e64edd..c0040ddd4e 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2129,6 +2129,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index bdfd073b86..61f19076eb 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2127,6 +2127,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 3d61d4974a..df4f3a3c04 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2135,6 +2135,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 675acca5db..a96de2e467 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2129,6 +2129,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 7fec0c9670..7b2ccbe953 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2178,3 +2178,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h b/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h new file mode 100644 index 0000000000..bae8f4aaa1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h @@ -0,0 +1,37 @@ +/* Restartable Sequences Linux powerpc architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the following trap instruction: + + powerpc-be: 0f e5 00 0b twui r5,11 + powerpc64-le: 0b 00 e5 0f twui r5,11 + powerpc64-be: 0f e5 00 0b twui r5,11 */ + +#define RSEQ_SIG 0x0fe5000b diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 1e8ff6f83e..6f4c6515dc 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2185,6 +2185,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index b5a0751d90..f9875b4e22 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2218,6 +2218,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 0c86217fc6..db06080db8 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2048,6 +2048,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 2229a1dcc0..608ad49593 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2247,3 +2247,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 31010e6cf7..c7657ce7f6 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2107,3 +2107,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h new file mode 100644 index 0000000000..1dd3b9a968 --- /dev/null +++ b/sysdeps/unix/sysv/linux/rseq-internal.h @@ -0,0 +1,77 @@ +/* Restartable Sequences internal API. Linux implementation. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 RSEQ_INTERNAL_H +#define RSEQ_INTERNAL_H + +#include +#include + +#ifdef __NR_rseq +#include +#endif + +#if defined __NR_rseq && defined RSEQ_SIG + +static inline int +rseq_register_current_thread (void) +{ + int rc, ret = 0; + INTERNAL_SYSCALL_DECL (err); + + if (__rseq_abi.cpu_id == RSEQ_CPU_ID_REGISTRATION_FAILED) + return -1; + rc = INTERNAL_SYSCALL_CALL (rseq, err, &__rseq_abi, sizeof (struct rseq), + 0, RSEQ_SIG); + if (!rc) + goto end; + if (INTERNAL_SYSCALL_ERRNO (rc, err) != EBUSY) + __rseq_abi.cpu_id = RSEQ_CPU_ID_REGISTRATION_FAILED; + ret = -1; +end: + return ret; +} + +static inline int +rseq_unregister_current_thread (void) +{ + int rc, ret = 0; + INTERNAL_SYSCALL_DECL (err); + + rc = INTERNAL_SYSCALL_CALL (rseq, err, &__rseq_abi, sizeof (struct rseq), + RSEQ_FLAG_UNREGISTER, RSEQ_SIG); + if (!rc) + goto end; + ret = -1; +end: + return ret; +} +#else +static inline int +rseq_register_current_thread (void) +{ + return -1; +} + +static inline int +rseq_unregister_current_thread (void) +{ + return -1; +} +#endif + +#endif /* rseq-internal.h */ diff --git a/sysdeps/unix/sysv/linux/rseq-sym.c b/sysdeps/unix/sysv/linux/rseq-sym.c new file mode 100644 index 0000000000..f86869a380 --- /dev/null +++ b/sysdeps/unix/sysv/linux/rseq-sym.c @@ -0,0 +1,43 @@ +/* Restartable Sequences exported symbols. Linux Implementation. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +#include +#include + +#ifdef __NR_rseq +#include +#else + +enum rseq_cpu_id_state { + RSEQ_CPU_ID_UNINITIALIZED = -1, + RSEQ_CPU_ID_REGISTRATION_FAILED = -2, +}; + +/* linux/rseq.h defines struct rseq as aligned on 32 bytes. The kernel ABI + size is 20 bytes. */ +struct rseq { + uint32_t cpu_id_start; + uint32_t cpu_id; + uint64_t rseq_cs; + uint32_t flags; +} __attribute__ ((aligned(4 * sizeof(uint64_t)))); + +#endif + +__thread struct rseq __rseq_abi = { + .cpu_id = RSEQ_CPU_ID_UNINITIALIZED, +}; diff --git a/sysdeps/unix/sysv/linux/s390/bits/rseq.h b/sysdeps/unix/sysv/linux/s390/bits/rseq.h new file mode 100644 index 0000000000..453250d761 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/bits/rseq.h @@ -0,0 +1,37 @@ +/* Restartable Sequences Linux s390 architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + It is a 32-bit value that maps to actual architecture code compiled + into applications and libraries. It needs to be defined for each + architecture. When choosing this value, it needs to be taken into + account that generating invalid instructions may have ill effects on + tools like objdump, and may also have impact on the CPU speculative + execution efficiency in some cases. + + RSEQ_SIG uses the trap4 instruction. As Linux does not make use of the + access-register mode nor the linkage stack this instruction will always + cause a special-operation exception (the trap-enabled bit in the DUCT + is and will stay 0). The instruction pattern is + b2 ff 0f ff trap4 4095(%r0) */ + +#define RSEQ_SIG 0xB2FF0FFF diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 4feca641b0..9c29ec0d2d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2183,6 +2183,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index efe588a072..99424ceac9 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2084,6 +2084,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 4b057bf4a2..916aa0b7f0 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2050,6 +2050,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 49cd597fd6..9a27df8e43 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2174,6 +2174,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 95e68e0ba1..32908666c4 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2101,6 +2101,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h new file mode 100644 index 0000000000..e675219ace --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/rseq.h @@ -0,0 +1,30 @@ +/* Restartable Sequences exported symbols. Linux header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +#define _SYS_RSEQ_H 1 + +/* We use the structures declarations from the kernel headers. */ +#include +/* Architecture-specific rseq signature. */ +#include +#include + +extern __thread struct rseq __rseq_abi +__attribute__ ((tls_model ("initial-exec"))); + +#endif /* sys/rseq.h */ diff --git a/sysdeps/unix/sysv/linux/x86/bits/rseq.h b/sysdeps/unix/sysv/linux/x86/bits/rseq.h new file mode 100644 index 0000000000..a2918c4617 --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86/bits/rseq.h @@ -0,0 +1,30 @@ +/* Restartable Sequences Linux x86 architecture header. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 _SYS_RSEQ_H +# error "Never use directly; include instead." +#endif + +/* RSEQ_SIG is a signature required before each abort handler code. + + RSEQ_SIG is used with the following reserved undefined instructions, which + trap in user-space: + + x86-32: 0f b9 3d 53 30 05 53 ud1 0x53053053,%edi + x86-64: 0f b9 3d 53 30 05 53 ud1 0x53053053(%rip),%edi */ + +#define RSEQ_SIG 0x53053053 diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 1f2dbd1451..7366565608 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2059,6 +2059,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 59da85a5d8..c1aa86f06e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2158,3 +2158,4 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.31 __rseq_abi T 0x20 From patchwork Mon Jan 6 15:57:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218289 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108474-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="fgLd/PFX"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="uG6SHO5p"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0ky1D16z9sPK for ; Tue, 7 Jan 2020 03:07:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=P9R/OuSnZ4QOu2RTpsT9U2VFVl1wnQG 5+/a8oA7l4MiX3y4tPVqtECuxhZE627ywzMn3aAYS2wBGhbXDquynbppVdRcr5Yp QbjjFdrWzuhKOeC97hNqkLP2cvIK7nc6rVHuC5h92ww79+AlZ2QkJ48gewUUhaTm XSMRgPsEyYfY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=+3Kg2mkyRgVAxoHOKP/VW8isgjM=; b=fgLd/ PFXff2it3n32xtRxzIDF08GJb7a3qcvJ2mPVE3p6a9NI/As+omsHyeKb7YIHF5sC tPrVVTJXF+Wx5lwjvMeGsaSXe4mD85iTfbyKywuxyEiAlghcX0tmnRtP03Ige3wT wLETV6OhXV64dS0luCQtXlnfJRvJXvc3UYVkJM= Received: (qmail 15648 invoked by alias); 6 Jan 2020 16:06:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15602 invoked by uid 89); 6 Jan 2020 16:06:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=3823, 13.7, 08, 0.8 X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 983511EA1D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=V01sGTkdCO7SqIi8D+mEDAjTS4ndQ4TnKwFDOpxXqBA=; h=From:To:Date:Message-Id; b=uG6SHO5pZWLZyzrvJ+miQCWNOw3+othcNc8D+G11B4x+s8a/NnE40NAwnCnPV9a1a nMf4dVo1cgWqrNkk2Ty+wUL0fsuLyYCrFPPOybJbz83WicNS/dAqIxx9W43qbX2Ly6 4LfJwkED7+3LD8PyOtRtVs73tO2dX1CNsir7zitNaoOWXcOH8cwoMY5Q8H3VFb2Bgp zIwjMW2T8C2G3csESuMWfzfArC9UFprrDr1lKmxmI0Gw/PfOQgRRF6n9LjH3gtxx2v s1xlFESfthQEnrMzF+E43fzxYaAeLY5kP+hqP9eQ/CE13r00TjfkoetsarAzHnVSQw GTHE4UZALHTsg== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: [RFC PATCH glibc 10/13] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v5) Date: Mon, 6 Jan 2020 10:57:10 -0500 Message-Id: <20200106155713.397-11-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> When available, use the cpu_id field from __rseq_abi on Linux to implement sched_getcpu(). Fall-back on the vgetcpu vDSO if unavailable. Benchmarks: x86-64: Intel E5-2630 v3@2.40GHz, 16-core, hyperthreading glibc sched_getcpu(): 13.7 ns (baseline) glibc sched_getcpu() using rseq: 2.5 ns (speedup: 5.5x) inline load cpuid from __rseq_abi TLS: 0.8 ns (speedup: 17.1x) * sysdeps/unix/sysv/linux/sched_getcpu.c: use rseq cpu_id TLS on Linux. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: libc-alpha@sourceware.org CC: linux-kernel@vger.kernel.org CC: linux-api@vger.kernel.org --- Changes since v1: - rseq is only used if both __NR_rseq and RSEQ_SIG are defined. Changes since v2: - remove duplicated __rseq_abi extern declaration. Changes since v3: - update ChangeLog. Changes since v4: - Use atomic_load_relaxed to load the __rseq_abi.cpu_id field, a consequence of the fact that __rseq_abi is not volatile anymore. - Include atomic.h which provides atomic_load_relaxed. --- sysdeps/unix/sysv/linux/sched_getcpu.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/sched_getcpu.c b/sysdeps/unix/sysv/linux/sched_getcpu.c index 65dd9fdda7..6f24c1db99 100644 --- a/sysdeps/unix/sysv/linux/sched_getcpu.c +++ b/sysdeps/unix/sysv/linux/sched_getcpu.c @@ -18,14 +18,15 @@ #include #include #include +#include #ifdef HAVE_GETCPU_VSYSCALL # define HAVE_VSYSCALL #endif #include -int -sched_getcpu (void) +static int +vsyscall_sched_getcpu (void) { #ifdef __NR_getcpu unsigned int cpu; @@ -37,3 +38,23 @@ sched_getcpu (void) return -1; #endif } + +#ifdef __NR_rseq +#include +#endif + +#if defined __NR_rseq && defined RSEQ_SIG +int +sched_getcpu (void) +{ + int cpu_id = atomic_load_relaxed (&__rseq_abi.cpu_id); + + return cpu_id >= 0 ? cpu_id : vsyscall_sched_getcpu (); +} +#else +int +sched_getcpu (void) +{ + return vsyscall_sched_getcpu (); +} +#endif From patchwork Mon Jan 6 15:57:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108469-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="GQ4IuTX6"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="ZR7lICG/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0YV0tDMz9s29 for ; Tue, 7 Jan 2020 02:58:53 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=sIig3sc+7bUbm5kOEFo5V39V86WiQWg wEBcvInU+r4922u1mV/7WvbynsBhrJXpDYCiQNOIhVru+RSNT6jhgGykG1KkJ50E 1xmboHU+GkXwfMBu8z+/IYzhbE8MvnL08PnEH+p74wY+6OHahlTxoY0aSCmSfYKP XLDDShvzFJBc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=lA60dTiXVVo9RrDmJ/MZfK5d4F0=; b=GQ4Iu TX6RapbLi4RT2RjpyFKE2qX7kzOxAbpLdxFQWq6t8gyxt3JokIW9JtDlFsx47S49 TCsE2k1J5RiNyAH0rOd9J60sJsdg/p5STQzzeZBsryA6TbwHl89UPkzmUbSdexnA r/8XO1uTYsdi47iufJCia6LHMn/VKLbx26c6Ew= Received: (qmail 95874 invoked by alias); 6 Jan 2020 15:57:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95795 invoked by uid 89); 6 Jan 2020 15:57:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=expose, processes, recording, U*carlos X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com BFFF31EA1DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=XUyhqOnJK2L8XoVFKJpGbZ+shMeWtDqnDGuoYxu7m74=; h=From:To:Date:Message-Id; b=ZR7lICG/lE62f48B3PXP2lH6DEzqawC9WAK5UI5pTmFakFrvLXzjE/c8tlcD49DLn QPDBdsJveHjFBEskeJ7ZYDRoo9Sl02VZnDtPmyN/fRyOKYy8aJDKNtLhdLmsBdFk70 AOwJzOqKEQ2n5Zcd4hS1ZwjX2F8crqqNpWVAElREhgoDdbUibUtJ7qach549pGf1BI O7kCQPD/kI7tvKoqbap6PQMvHOuU083HlYl8mbV8r5uptMakf54ckdI/5zSBUv+4Hp 3MhkcVG+wDWUfMSY1mcGQ0PMTtDDyngRPkffw0hflOI7/3HG66YaB7iRL2NIRqlDxT suHvqp8fUVoLA== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers Subject: [RFC PATCH glibc 11/13] support record failure: allow use from constructor Date: Mon, 6 Jan 2020 10:57:11 -0500 Message-Id: <20200106155713.397-12-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> Expose support_record_failure_init () so constructors can explicitly initialize the record failure API. This is preferred to lazy initialization at first use, because lazy initialization does not cover use in constructors within forked children processes (forked from parent constructor). Signed-off-by: Mathieu Desnoyers Reviewed-by: Carlos O'Donell CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: libc-alpha@sourceware.org --- support/check.h | 4 ++++ support/support_record_failure.c | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/support/check.h b/support/check.h index e95f4ae91b..630d263c81 100644 --- a/support/check.h +++ b/support/check.h @@ -88,6 +88,10 @@ void support_test_verify_exit_impl (int status, const char *file, int line, does not support reporting failures from a DSO. */ void support_record_failure (void); +/* Initialize record failure. Calling this is only needed when + recording failures from constructors. */ +void support_record_failure_init (void); + /* Static assertion, under a common name for both C++ and C11. */ #ifdef __cplusplus # define support_static_assert static_assert diff --git a/support/support_record_failure.c b/support/support_record_failure.c index 9df679c4cc..8b9e97d882 100644 --- a/support/support_record_failure.c +++ b/support/support_record_failure.c @@ -32,8 +32,12 @@ zero, the failure of a test can be detected. The init constructor function below puts *state on a shared - annonymous mapping, so that failure reports from subprocesses - propagate to the parent process. */ + anonymous mapping, so that failure reports from subprocesses + propagate to the parent process. + + support_record_failure_init is exposed so it can be called explicitly + in case this API needs to be used from a constructor. */ + struct test_failures { unsigned int counter; @@ -41,10 +45,14 @@ struct test_failures }; static struct test_failures *state; -static __attribute__ ((constructor)) void -init (void) +__attribute__ ((constructor)) void +support_record_failure_init (void) { - void *ptr = mmap (NULL, sizeof (*state), PROT_READ | PROT_WRITE, + void *ptr; + + if (state != NULL) + return; + ptr = mmap (NULL, sizeof (*state), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); if (ptr == MAP_FAILED) { From patchwork Mon Jan 6 15:57:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218286 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108470-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="dheelU4a"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="JbPxfT+o"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Yg4pHgz9s29 for ; Tue, 7 Jan 2020 02:59:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=pLJi8F4jlimI+LFFPD/xUgliveVIIgV ypSjKZGLpszMKvJEaAacgrW8XCEYWkDXrAgWE7XIHn3z9hShHHvQn7DoCXCwiSSE HFFG5AOH1AgCCnvgWclUY0L5z4eDLOiU+mSKihAeQZKNbGWANQK9DO+sAEV5oPQA DDnMjOTxHxdU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=G8bhR+O/+lU5n9Bp1MjgzJVM1MQ=; b=dheel U4azpbLvTYNwO1uYbGnlTvBrC6741cScHisiEengkmrbA4VWCc3dxJ9bYdwcZP0Q 3sP3RUANbLwDDGCuN1wp60VUgPIW6iUgykP3LrMv0YORXHiDOMGlmQcMvh9DdQeT k9yL/dQrStNmvnl0pqCgxuGIh0MJnJwnF9SS5Y= Received: (qmail 95988 invoked by alias); 6 Jan 2020 15:57:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95897 invoked by uid 89); 6 Jan 2020 15:57:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=expose, sk:carlos, wrap, U*carlos X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com E765E1EA1E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326241; bh=i92kmCPFIYhA2AzBQQi0It6BOwMOil8RcF5iAv+iUvw=; h=From:To:Date:Message-Id; b=JbPxfT+oQGIuAfa14E78Qo7eKifRriLJHGKTh17xahymWUsnQkoaSFD2HXg+WduSd mePfEFTOrqdg6zH5ZzIaRqUY0D53UjCNxu7vh6vG18QPMyV90sLGJayPQn8+Z86hnW GhSVDk4ah6MeVpaRc+UecnKSyJdShf6NGLqXV1Uv7zOrv7HNZZvw6AeDqjFCBOqbOQ yEFXGXbJEem4Gc4llGghxdXdlXwJwCOQOuHZkHV0TClKvxRnp4fLFbWvKt2qkaXX3w UkQ+ICI7ycBgHZFy0/8dW4oYRQyo9PHgCo3BGWqSjhzV2SgldU2jtQvomHBxpXI6SM yQqn0j/ASHKlQ== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers Subject: [RFC PATCH glibc 12/13] support: implement xpthread key create/delete (v3) Date: Mon, 6 Jan 2020 10:57:12 -0500 Message-Id: <20200106155713.397-13-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> Expose xpthread_key_create () and xpthread_key_delete () wrappers for tests. * support/Makefile: Add xpthread_key_create and xpthread_key_delete. * support/xthread.h: Add prototype for xpthread_key_create and xpthread_key_delete. * support/xpthread_key_create.c: New file. * support/xpthread_key_delete.c: New file. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: libc-alpha@sourceware.org --- Changes since v1: - Update ChangeLog. - Wrap long line in xpthread_key_create. Changes since v2: - Rebase on glibc 2.30. --- support/Makefile | 2 ++ support/xpthread_key_create.c | 25 +++++++++++++++++++++++++ support/xpthread_key_delete.c | 24 ++++++++++++++++++++++++ support/xthread.h | 2 ++ 4 files changed, 53 insertions(+) create mode 100644 support/xpthread_key_create.c create mode 100644 support/xpthread_key_delete.c diff --git a/support/Makefile b/support/Makefile index 23c6d74627..affc598c65 100644 --- a/support/Makefile +++ b/support/Makefile @@ -127,6 +127,8 @@ libsupport-routines = \ xpthread_create \ xpthread_detach \ xpthread_join \ + xpthread_key_create \ + xpthread_key_delete \ xpthread_mutex_consistent \ xpthread_mutex_destroy \ xpthread_mutex_init \ diff --git a/support/xpthread_key_create.c b/support/xpthread_key_create.c new file mode 100644 index 0000000000..fb5a89ab3a --- /dev/null +++ b/support/xpthread_key_create.c @@ -0,0 +1,25 @@ +/* pthread_key_create with error checking. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +#include + +void +xpthread_key_create (pthread_key_t *key, void (*destr_function) (void *)) +{ + xpthread_check_return ("pthread_key_create", + pthread_key_create (key, destr_function)); +} diff --git a/support/xpthread_key_delete.c b/support/xpthread_key_delete.c new file mode 100644 index 0000000000..423ff4584d --- /dev/null +++ b/support/xpthread_key_delete.c @@ -0,0 +1,24 @@ +/* pthread_key_delete with error checking. + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +#include + +void +xpthread_key_delete (pthread_key_t key) +{ + xpthread_check_return ("pthread_key_delete", pthread_key_delete (key)); +} diff --git a/support/xthread.h b/support/xthread.h index f39720cb23..4be86b39a0 100644 --- a/support/xthread.h +++ b/support/xthread.h @@ -95,6 +95,8 @@ void xpthread_rwlock_wrlock (pthread_rwlock_t *rwlock); void xpthread_rwlock_rdlock (pthread_rwlock_t *rwlock); void xpthread_rwlock_unlock (pthread_rwlock_t *rwlock); void xpthread_rwlock_destroy (pthread_rwlock_t *rwlock); +void xpthread_key_create (pthread_key_t *key, void (*destr_function) (void *)); +void xpthread_key_delete (pthread_key_t key); __END_DECLS From patchwork Mon Jan 6 15:57:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1218287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108471-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="VZnRAV1S"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="cFcV5N+F"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s0Ys5xkQz9s29 for ; Tue, 7 Jan 2020 02:59:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=oOMG3vLN1lODW2zkaYyTrdmHA28z50A DyQKhntozYy956tU1lFF1dDpvAgd3+/pYKb9hWqFzAsTv2TX9Wcv7zOVFj/NfHTw vizEk3G7b1RORDzp/FpPiz/rcImj5IvXZEdq+Gy9n4FpcFKicUU1jRQ9zQ0HNMlm QLbTz74EQ8Vs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=+BGf9D+u1treGhqWRILA0NZ49lE=; b=VZnRA V1Sn/URj59xHazZUC3hmpT7Xs92mELFDTggKwihE/9A8AmTGEwpHjtyadT/cKdpC a5hylDDxJYoFcElUXA0W5krxsTsB3AVT8VfN2YKz0Q/EiLaZBKvL0ussYq0BhX2F z3CdPZ9u+VyJDqnS0rbJHnRKzFWZBwgvHzYjH4= Received: (qmail 96249 invoked by alias); 6 Jan 2020 15:57:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 96170 invoked by uid 89); 6 Jan 2020 15:57:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:carlos, U*carlos, sk:carlos@ X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 211681EA1EB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578326242; bh=EJr5U5rl8ypQGran2rlQbRtikUrlm3CJWJaDhDogzjg=; h=From:To:Date:Message-Id; b=cFcV5N+FtmoFcGnv6I8SxmQE/eXqCLS4N2F0uuNPVzLmQYtZgEQ9rcL1j3+VsDzZN Md78D1ebeLGsMOQl3VYfgqHvx45BeFnE/pU2MASJHvDXYy7C0BYvEhRolaUkc+mYzY UabowIzz8Kp8ltxCZa7V2sUbfRWt5mxkpg6PLP3gE1FYs69PbxCrfnVWWRXaFyLH06 asK3GC7oGzcJkgEIqNQ8fbz1V1ojgs77jXGZUvvqagxt2z5GhUFIIjOfFal6NBC0wS 9tYg/95ERiWvk82/kQWVddCvuQem4fyRiCTvm9IOzYxBqOtSyT9uDUCJMi90m/gRK1 EPhf5O1qjCCZA== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner Subject: [RFC PATCH glibc 13/13] rseq registration tests (v7) Date: Mon, 6 Jan 2020 10:57:13 -0500 Message-Id: <20200106155713.397-14-mathieu.desnoyers@efficios.com> In-Reply-To: <20200106155713.397-1-mathieu.desnoyers@efficios.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> These tests validate that rseq is registered from various execution contexts (main thread, constructor, destructor, other threads, other threads created from constructor and destructor, forked process (without exec), pthread_atfork handlers, pthread setspecific destructors, C++ thread and process destructors, signal handlers, atexit handlers). tst-rseq.c only links against libc.so, testing registration of rseq in a non-multithreaded environment. tst-rseq-nptl.c also links against libpthread.so, testing registration of rseq in a multithreaded environment. See the Linux kernel selftests for extensive rseq stress-tests. * sysdeps/unix/sysv/linux/Makefile: Add tst-rseq and tst-rseq-nptl. * sysdeps/unix/sysv/linux/tst-rseq-nptl.c: New file. * sysdeps/unix/sysv/linux/tst-rseq.c: Likewise. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun Feng CC: Will Deacon CC: Dave Watson CC: Paul Turner CC: libc-alpha@sourceware.org --- Changes since v1: - Rename tst-rseq.c to tst-rseq-nptl.c. - Introduce tst-rseq.c testing rseq registration in a non-multithreaded environment. Chances since v2: - Update file headers. - use xpthread key create/delete. - remove set stacksize. - Tests depend on both __NR_rseq and RSEQ_SIG being defined. Changes since v3: - Update ChangeLog. Changes since v4: - Remove volatile from sys_rseq() rseq_abi parameter. - Use atomic_load_relaxed to load __rseq_abi.cpu_id, consequence of the fact that __rseq_abi is not volatile anymore. - Include atomic.h from tst-rseq.c for use of atomic_load_relaxed. Move tst-rseq.c to internal tests within Makefile due to its use of atomic.h. - Test __rseq_handled initialization by glibc. Changes since v5: - Rebase on glibc 2.30. Changes since v6: - Remove __rseq_handled. --- sysdeps/unix/sysv/linux/Makefile | 6 +- sysdeps/unix/sysv/linux/tst-rseq-nptl.c | 353 ++++++++++++++++++++++++ sysdeps/unix/sysv/linux/tst-rseq.c | 114 ++++++++ 3 files changed, 471 insertions(+), 2 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/tst-rseq-nptl.c create mode 100644 sysdeps/unix/sysv/linux/tst-rseq.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 9da43b393e..b5a93a4757 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -95,7 +95,9 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \ tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \ tst-tgkill -tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc + +tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc \ + tst-ofdlocks-compat tst-rseq CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables @@ -298,5 +300,5 @@ ifeq ($(subdir),nptl) tests += tst-align-clone tst-getpid1 \ tst-thread-affinity-pthread tst-thread-affinity-pthread2 \ tst-thread-affinity-sched -tests-internal += tst-setgetname +tests-internal += tst-setgetname tst-rseq-nptl endif diff --git a/sysdeps/unix/sysv/linux/tst-rseq-nptl.c b/sysdeps/unix/sysv/linux/tst-rseq-nptl.c new file mode 100644 index 0000000000..bfae56aec6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-rseq-nptl.c @@ -0,0 +1,353 @@ +/* Restartable Sequences NPTL test. + + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +/* These tests validate that rseq is registered from various execution + contexts (main thread, constructor, destructor, other threads, other + threads created from constructor and destructor, forked process + (without exec), pthread_atfork handlers, pthread setspecific + destructors, C++ thread and process destructors, signal handlers, + atexit handlers). + + See the Linux kernel selftests for extensive rseq stress-tests. */ + +#include +#include +#include +#include +#include + +#ifdef __NR_rseq +#include +#endif + +#if defined __NR_rseq && defined RSEQ_SIG +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static pthread_key_t rseq_test_key; + +static int +rseq_thread_registered (void) +{ + return (int32_t) atomic_load_relaxed (&__rseq_abi.cpu_id) >= 0; +} + +static int +do_rseq_main_test (void) +{ + if (raise (SIGUSR1)) + FAIL_EXIT1 ("error raising signal"); + if (pthread_setspecific (rseq_test_key, (void *) 1l)) + FAIL_EXIT1 ("error in pthread_setspecific"); + if (!rseq_thread_registered ()) + { + FAIL_RET ("rseq not registered in main thread"); + } + return 0; +} + +static void +cancel_routine (void *arg) +{ + if (!rseq_thread_registered ()) + { + printf ("rseq not registered in cancel routine\n"); + support_record_failure (); + } +} + +static int cancel_thread_ready; + +static void +test_cancel_thread (void) +{ + pthread_cleanup_push (cancel_routine, NULL); + atomic_store_release (&cancel_thread_ready, 1); + for (;;) + usleep (100); + pthread_cleanup_pop (0); +} + +static void * +thread_function (void * arg) +{ + int i = (int) (intptr_t) arg; + + if (raise (SIGUSR1)) + FAIL_EXIT1 ("error raising signal"); + if (i == 0) + test_cancel_thread (); + if (pthread_setspecific (rseq_test_key, (void *) 1l)) + FAIL_EXIT1 ("error in pthread_setspecific"); + return rseq_thread_registered () ? NULL : (void *) 1l; +} + +static void +sighandler (int sig) +{ + if (!rseq_thread_registered ()) + { + printf ("rseq not registered in signal handler\n"); + support_record_failure (); + } +} + +static void +setup_signals (void) +{ + struct sigaction sa; + + sigemptyset (&sa.sa_mask); + sigaddset (&sa.sa_mask, SIGUSR1); + sa.sa_flags = 0; + sa.sa_handler = sighandler; + if (sigaction (SIGUSR1, &sa, NULL) != 0) + { + FAIL_EXIT1 ("sigaction failure: %s", strerror (errno)); + } +} + +#define N 7 +static const int t[N] = { 1, 2, 6, 5, 4, 3, 50 }; + +static int +do_rseq_threads_test (int nr_threads) +{ + pthread_t th[nr_threads]; + int i; + int result = 0; + + cancel_thread_ready = 0; + for (i = 0; i < nr_threads; ++i) + if (pthread_create (&th[i], NULL, thread_function, + (void *) (intptr_t) i) != 0) + { + FAIL_EXIT1 ("creation of thread %d failed", i); + } + + while (!atomic_load_acquire (&cancel_thread_ready)) + usleep (100); + + if (pthread_cancel (th[0])) + FAIL_EXIT1 ("error in pthread_cancel"); + + for (i = 0; i < nr_threads; ++i) + { + void *v; + if (pthread_join (th[i], &v) != 0) + { + printf ("join of thread %d failed\n", i); + result = 1; + } + else if (i != 0 && v != NULL) + { + printf ("join %d successful, but child failed\n", i); + result = 1; + } + else if (i == 0 && v == NULL) + { + printf ("join %d successful, child did not fail as expected\n", i); + result = 1; + } + } + return result; +} + +static int +sys_rseq (struct rseq *rseq_abi, uint32_t rseq_len, int flags, uint32_t sig) +{ + return syscall (__NR_rseq, rseq_abi, rseq_len, flags, sig); +} + +static int +rseq_available (void) +{ + int rc; + + rc = sys_rseq (NULL, 0, 0, 0); + if (rc != -1) + FAIL_EXIT1 ("Unexpected rseq return value %d", rc); + switch (errno) + { + case ENOSYS: + return 0; + case EINVAL: + return 1; + default: + FAIL_EXIT1 ("Unexpected rseq error %s", strerror (errno)); + } +} + +static int +do_rseq_fork_test (void) +{ + int status; + pid_t pid, retpid; + + pid = fork (); + switch (pid) + { + case 0: + exit (do_rseq_main_test ()); + case -1: + FAIL_EXIT1 ("Unexpected fork error %s", strerror (errno)); + } + retpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0)); + if (retpid != pid) + { + FAIL_EXIT1 ("waitpid returned %ld, expected %ld", + (long int) retpid, (long int) pid); + } + if (WEXITSTATUS (status)) + { + printf ("rseq not registered in child\n"); + return 1; + } + return 0; +} + +static int +do_rseq_test (void) +{ + int i, result = 0; + + if (!rseq_available ()) + { + FAIL_UNSUPPORTED ("kernel does not support rseq, skipping test"); + } + setup_signals (); + if (raise (SIGUSR1)) + FAIL_EXIT1 ("error raising signal"); + if (do_rseq_main_test ()) + result = 1; + for (i = 0; i < N; i++) + { + if (do_rseq_threads_test (t[i])) + result = 1; + } + if (do_rseq_fork_test ()) + result = 1; + return result; +} + +static void +atfork_prepare (void) +{ + if (!rseq_thread_registered ()) + { + printf ("rseq not registered in pthread atfork prepare\n"); + support_record_failure (); + } +} + +static void +atfork_parent (void) +{ + if (!rseq_thread_registered ()) + { + printf ("rseq not registered in pthread atfork parent\n"); + support_record_failure (); + } +} + +static void +atfork_child (void) +{ + if (!rseq_thread_registered ()) + { + printf ("rseq not registered in pthread atfork child\n"); + support_record_failure (); + } +} + +static void +rseq_key_destructor (void *arg) +{ + /* Cannot use deferred failure reporting after main () returns. */ + if (!rseq_thread_registered ()) + FAIL_EXIT1 ("rseq not registered in pthread key destructor"); +} + +static void +atexit_handler (void) +{ + /* Cannot use deferred failure reporting after main () returns. */ + if (!rseq_thread_registered ()) + FAIL_EXIT1 ("rseq not registered in atexit handler"); +} + +static void __attribute__ ((constructor)) +do_rseq_constructor_test (void) +{ + support_record_failure_init (); + if (atexit (atexit_handler)) + FAIL_EXIT1 ("error calling atexit"); + xpthread_key_create (&rseq_test_key, rseq_key_destructor); + if (pthread_atfork (atfork_prepare, atfork_parent, atfork_child)) + FAIL_EXIT1 ("error calling pthread_atfork"); + if (do_rseq_test ()) + FAIL_EXIT1 ("rseq not registered within constructor"); +} + +static void __attribute__ ((destructor)) +do_rseq_destructor_test (void) +{ + /* Cannot use deferred failure reporting after main () returns. */ + if (do_rseq_test ()) + FAIL_EXIT1 ("rseq not registered within destructor"); + xpthread_key_delete (rseq_test_key); +} + +/* Test C++ destructor called at thread and process exit. */ +void +__call_tls_dtors (void) +{ + /* Cannot use deferred failure reporting after main () returns. */ + if (!rseq_thread_registered ()) + FAIL_EXIT1 ("rseq not registered in C++ thread/process exit destructor"); +} +#else +static int +do_rseq_test (void) +{ +#ifndef __NR_rseq + FAIL_UNSUPPORTED ("kernel headers do not support rseq, skipping test"); +#endif +#ifndef RSEQ_SIG + FAIL_UNSUPPORTED ("glibc does not define RSEQ_SIG, skipping test"); +#endif + return 0; +} +#endif + +static int +do_test (void) +{ + return do_rseq_test (); +} + +#include diff --git a/sysdeps/unix/sysv/linux/tst-rseq.c b/sysdeps/unix/sysv/linux/tst-rseq.c new file mode 100644 index 0000000000..3322739854 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-rseq.c @@ -0,0 +1,114 @@ +/* Restartable Sequences single-threaded tests. + + Copyright (C) 2019 Free Software Foundation, Inc. + + 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 + . */ + +/* These tests validate that rseq is registered from main in an executable + not linked against libpthread. */ + +#include +#include +#include +#include + +#ifdef __NR_rseq +#include +#endif + +#if defined __NR_rseq && defined RSEQ_SIG +#include +#include +#include +#include +#include +#include +#include + +static int +rseq_thread_registered (void) +{ + return (int32_t) atomic_load_relaxed (&__rseq_abi.cpu_id) >= 0; +} + +static int +do_rseq_main_test (void) +{ + if (!rseq_thread_registered ()) + { + FAIL_RET ("rseq not registered in main thread"); + } + return 0; +} + +static int +sys_rseq (struct rseq *rseq_abi, uint32_t rseq_len, int flags, uint32_t sig) +{ + return syscall (__NR_rseq, rseq_abi, rseq_len, flags, sig); +} + +static int +rseq_available (void) +{ + int rc; + + rc = sys_rseq (NULL, 0, 0, 0); + if (rc != -1) + FAIL_EXIT1 ("Unexpected rseq return value %d", rc); + switch (errno) + { + case ENOSYS: + return 0; + case EINVAL: + return 1; + default: + FAIL_EXIT1 ("Unexpected rseq error %s", strerror (errno)); + } +} + +static int +do_rseq_test (void) +{ + int result = 0; + + if (!rseq_available ()) + { + FAIL_UNSUPPORTED ("kernel does not support rseq, skipping test"); + } + if (do_rseq_main_test ()) + result = 1; + return result; +} +#else +static int +do_rseq_test (void) +{ +#ifndef __NR_rseq + FAIL_UNSUPPORTED ("kernel headers do not support rseq, skipping test"); +#endif +#ifndef RSEQ_SIG + FAIL_UNSUPPORTED ("glibc does not define RSEQ_SIG, skipping test"); +#endif + return 0; +} +#endif + +static int +do_test (void) +{ + return do_rseq_test (); +} + +#include