From patchwork Sun Aug 11 18:27:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 1971374 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WhmNr3mB3z1yXh for ; Mon, 12 Aug 2024 04:28:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DE89F81006; Sun, 11 Aug 2024 18:28:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pQD942Y8mUq2; Sun, 11 Aug 2024 18:28:03 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3DF8E8111C Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 3DF8E8111C; Sun, 11 Aug 2024 18:28:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2F4141BF239 for ; Sun, 11 Aug 2024 18:28:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 26DEA40179 for ; Sun, 11 Aug 2024 18:28:01 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5FLoAcgpdbWj for ; Sun, 11 Aug 2024 18:27:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=wbx@openadk.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 23DA740106 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 23DA740106 Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by smtp2.osuosl.org (Postfix) with ESMTPS id 23DA740106 for ; Sun, 11 Aug 2024 18:27:57 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id 3B687353DA9B; Sun, 11 Aug 2024 20:27:54 +0200 (CEST) Date: Sun, 11 Aug 2024 20:27:54 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 5.10.0-31-amd64 x86_64 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openadk.org; s=2022; t=1723400874; bh=sFMw5pcyVNpi82l9aERxyYubZNOqBFZ4pTdEG2h8LQU=; h=Date:From:To:Subject:From; b=om+z0BJsyODmJnGsLKyIR9fDKilYVQTzQlyaGAIWC8+N2J8sfSFSUFQFqjUJewnAI pKVnAe7I5hzkOPpEkD1Q0yVGDtQr+TSkGR30kCkqBdaGvMcNBv9v/NOfuehz9r2q1I wJZv7zDeBq1eXz0+dC40345vIIv1k9e4lyDPu5OR0NvcTCIlug1ZvibnZUi9aU0CTt Wu5Lu3Rkx2x/vaRK3GbXHBVQ3c6kv/S3JszW1U9Qlv/ypkJk2+kQF5O5iqmWGG1kUI CX0zSWO9h/3MYNGzNEfb0XqT8wSKQLr/JUZt98uJDXMvOPJFAEr9h7Y+1fB5lb/V9H pqcXNU0KYvgfg== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=none (p=none dis=none) header.from=openadk.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=openadk.org header.i=@openadk.org header.a=rsa-sha256 header.s=2022 header.b=om+z0BJs Subject: [Buildroot] [PATCH] package/uclibc: add memfd_create syscall wrapper X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Waldemar Brodkorb --- ...005-add-memfd_create-syscall-wrapper.patch | 467 ++++++++++++++++++ 1 file changed, 467 insertions(+) create mode 100644 package/uclibc/0005-add-memfd_create-syscall-wrapper.patch diff --git a/package/uclibc/0005-add-memfd_create-syscall-wrapper.patch b/package/uclibc/0005-add-memfd_create-syscall-wrapper.patch new file mode 100644 index 0000000000..75309d195a --- /dev/null +++ b/package/uclibc/0005-add-memfd_create-syscall-wrapper.patch @@ -0,0 +1,467 @@ +From 811cd361e144dd7bdf75bcad8b4572ec786af5c7 Mon Sep 17 00:00:00 2001 +From: Waldemar Brodkorb +Date: Sun, 11 Aug 2024 20:22:48 +0200 +Subject: [PATCH] add memfd_create syscall wrapper + +Signed-off-by: Waldemar Brodkorb +Upstream: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=811cd361e144dd7bdf75bcad8b4572ec786af5c7 +--- + libc/sysdeps/linux/aarch64/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/alpha/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/arc/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/arm/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/avr32/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/bfin/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/c6x/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/common/Makefile.in | 1 + + libc/sysdeps/linux/common/bits/fcntl-linux.h | 34 ++++++++++++++++++++ + libc/sysdeps/linux/common/bits/mman-shared.h | 2 -- + libc/sysdeps/linux/common/memfd_create.c | 13 ++++++++ + libc/sysdeps/linux/cris/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/csky/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/frv/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/h8300/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/hppa/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/i386/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/ia64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/kvx/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/lm32/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/m68k/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/metag/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/microblaze/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/mips/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/nds32/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/nios2/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/or1k/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/powerpc/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/riscv32/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/riscv64/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/sh/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/sparc/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/sparc64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/tile/bits/fcntl.h | 3 ++ + libc/sysdeps/linux/x86_64/bits/fcntl.h | 2 ++ + libc/sysdeps/linux/xtensa/bits/fcntl.h | 2 ++ + 36 files changed, 121 insertions(+), 2 deletions(-) + create mode 100644 libc/sysdeps/linux/common/bits/fcntl-linux.h + create mode 100644 libc/sysdeps/linux/common/memfd_create.c + +diff --git a/libc/sysdeps/linux/aarch64/bits/fcntl.h b/libc/sysdeps/linux/aarch64/bits/fcntl.h +index dbe929351..024344eec 100644 +--- a/libc/sysdeps/linux/aarch64/bits/fcntl.h ++++ b/libc/sysdeps/linux/aarch64/bits/fcntl.h +@@ -289,3 +289,6 @@ extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + #endif /* use GNU */ + + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h +index 11e68214e..7d06c76b7 100644 +--- a/libc/sysdeps/linux/alpha/bits/fcntl.h ++++ b/libc/sysdeps/linux/alpha/bits/fcntl.h +@@ -236,3 +236,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/arc/bits/fcntl.h b/libc/sysdeps/linux/arc/bits/fcntl.h +index beb32e41e..b02849691 100755 +--- a/libc/sysdeps/linux/arc/bits/fcntl.h ++++ b/libc/sysdeps/linux/arc/bits/fcntl.h +@@ -230,3 +230,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h +index 823660648..52dee4287 100644 +--- a/libc/sysdeps/linux/arm/bits/fcntl.h ++++ b/libc/sysdeps/linux/arm/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h +index ec0a3b55d..9e41550be 100644 +--- a/libc/sysdeps/linux/avr32/bits/fcntl.h ++++ b/libc/sysdeps/linux/avr32/bits/fcntl.h +@@ -218,3 +218,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + __END_DECLS + #endif ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h +index 0909ae6c4..67d2c5245 100644 +--- a/libc/sysdeps/linux/bfin/bits/fcntl.h ++++ b/libc/sysdeps/linux/bfin/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/c6x/bits/fcntl.h b/libc/sysdeps/linux/c6x/bits/fcntl.h +index 14aea565e..00f3b34e0 100644 +--- a/libc/sysdeps/linux/c6x/bits/fcntl.h ++++ b/libc/sysdeps/linux/c6x/bits/fcntl.h +@@ -237,3 +237,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in +index 848bc1e4a..83be2691e 100644 +--- a/libc/sysdeps/linux/common/Makefile.in ++++ b/libc/sysdeps/linux/common/Makefile.in +@@ -30,6 +30,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ + inotify.c \ + ioperm.c \ + iopl.c \ ++ memfd_create.c \ + modify_ldt.c \ + module.c \ + name_to_handle_at.c \ +diff --git a/libc/sysdeps/linux/common/bits/fcntl-linux.h b/libc/sysdeps/linux/common/bits/fcntl-linux.h +new file mode 100644 +index 000000000..d0236fd8b +--- /dev/null ++++ b/libc/sysdeps/linux/common/bits/fcntl-linux.h +@@ -0,0 +1,34 @@ ++/* O_*, F_*, FD_* bit values for Linux. ++ Copyright (C) 2001-2024 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 _FCNTL_H ++# error "Never use directly; include instead." ++#endif ++ ++#ifdef __USE_GNU ++/* Types of seals. */ ++# define F_SEAL_SEAL 0x0001 /* Prevent further seals from being set. */ ++# define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */ ++# define F_SEAL_GROW 0x0004 /* Prevent file from growing. */ ++# define F_SEAL_WRITE 0x0008 /* Prevent writes. */ ++# define F_SEAL_FUTURE_WRITE 0x0010 /* Prevent future writes while ++ mapped. */ ++# define F_SEAL_EXEC 0x0020 /* Prevent chmod modifying exec bits. */ ++ ++# define F_ADD_SEALS 1033 /* Add seals to file. */ ++# define F_GET_SEALS 1034 /* Get seals for file. */ ++#endif +diff --git a/libc/sysdeps/linux/common/bits/mman-shared.h b/libc/sysdeps/linux/common/bits/mman-shared.h +index 98c9e1d3c..c40ae2d1e 100644 +--- a/libc/sysdeps/linux/common/bits/mman-shared.h ++++ b/libc/sysdeps/linux/common/bits/mman-shared.h +@@ -40,11 +40,9 @@ + + __BEGIN_DECLS + +-#if 0 + /* Create a new memory file descriptor. NAME is a name for debugging. + FLAGS is a combination of the MFD_* constants. */ + int memfd_create (const char *__name, unsigned int __flags) __THROW; +-#endif + + /* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into + memory. FLAGS is a combination of the MLOCK_* flags above. */ +diff --git a/libc/sysdeps/linux/common/memfd_create.c b/libc/sysdeps/linux/common/memfd_create.c +new file mode 100644 +index 000000000..7165f3278 +--- /dev/null ++++ b/libc/sysdeps/linux/common/memfd_create.c +@@ -0,0 +1,13 @@ ++/* ++ * memfd_create() for uClibc-ng ++ * ++ * Copyright (C) 2024 Waldemar Brodkorb ++ * ++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. ++ */ ++ ++#include ++#include ++#if defined(__NR_memfd_create) ++_syscall2(int, memfd_create, const char *, name, unsigned int, flags) ++#endif +diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h +index e9bc90ea9..e1d4ee1a6 100644 +--- a/libc/sysdeps/linux/cris/bits/fcntl.h ++++ b/libc/sysdeps/linux/cris/bits/fcntl.h +@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/csky/bits/fcntl.h b/libc/sysdeps/linux/csky/bits/fcntl.h +index b36f41569..25f4491ba 100644 +--- a/libc/sysdeps/linux/csky/bits/fcntl.h ++++ b/libc/sysdeps/linux/csky/bits/fcntl.h +@@ -232,3 +232,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h +index 02c8ac310..81a1bcd99 100644 +--- a/libc/sysdeps/linux/frv/bits/fcntl.h ++++ b/libc/sysdeps/linux/frv/bits/fcntl.h +@@ -226,3 +226,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h +index 2062f7cda..7cbe04e15 100644 +--- a/libc/sysdeps/linux/h8300/bits/fcntl.h ++++ b/libc/sysdeps/linux/h8300/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h +index 4ce76ce5f..bcd6618b2 100644 +--- a/libc/sysdeps/linux/hppa/bits/fcntl.h ++++ b/libc/sysdeps/linux/hppa/bits/fcntl.h +@@ -234,3 +234,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h +index f3c08bbe5..5caf66114 100644 +--- a/libc/sysdeps/linux/i386/bits/fcntl.h ++++ b/libc/sysdeps/linux/i386/bits/fcntl.h +@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h +index a20f44ff7..53263c3d3 100644 +--- a/libc/sysdeps/linux/ia64/bits/fcntl.h ++++ b/libc/sysdeps/linux/ia64/bits/fcntl.h +@@ -238,3 +238,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/kvx/bits/fcntl.h b/libc/sysdeps/linux/kvx/bits/fcntl.h +index ea0c59d09..79cd3f14e 100644 +--- a/libc/sysdeps/linux/kvx/bits/fcntl.h ++++ b/libc/sysdeps/linux/kvx/bits/fcntl.h +@@ -227,3 +227,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/lm32/bits/fcntl.h b/libc/sysdeps/linux/lm32/bits/fcntl.h +index 0bfea6e7a..049c7fd83 100644 +--- a/libc/sysdeps/linux/lm32/bits/fcntl.h ++++ b/libc/sysdeps/linux/lm32/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h +index 5a56c8781..92c0964d9 100644 +--- a/libc/sysdeps/linux/m68k/bits/fcntl.h ++++ b/libc/sysdeps/linux/m68k/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/metag/bits/fcntl.h b/libc/sysdeps/linux/metag/bits/fcntl.h +index bdd697348..471938b7d 100644 +--- a/libc/sysdeps/linux/metag/bits/fcntl.h ++++ b/libc/sysdeps/linux/metag/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h +index 110927d95..8c9c2ceef 100644 +--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h ++++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h +index 33251c74d..a98b8c2e5 100644 +--- a/libc/sysdeps/linux/mips/bits/fcntl.h ++++ b/libc/sysdeps/linux/mips/bits/fcntl.h +@@ -268,3 +268,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/nds32/bits/fcntl.h b/libc/sysdeps/linux/nds32/bits/fcntl.h +index 2e6a95ec8..cfce8ab27 100644 +--- a/libc/sysdeps/linux/nds32/bits/fcntl.h ++++ b/libc/sysdeps/linux/nds32/bits/fcntl.h +@@ -249,3 +249,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h +index 200a35443..0c11c3aba 100644 +--- a/libc/sysdeps/linux/nios2/bits/fcntl.h ++++ b/libc/sysdeps/linux/nios2/bits/fcntl.h +@@ -244,3 +244,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/or1k/bits/fcntl.h b/libc/sysdeps/linux/or1k/bits/fcntl.h +index c9599ef3a..78eed9d5f 100644 +--- a/libc/sysdeps/linux/or1k/bits/fcntl.h ++++ b/libc/sysdeps/linux/or1k/bits/fcntl.h +@@ -244,3 +244,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h +index ef1beeca0..54e4894ec 100644 +--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h ++++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h +@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/riscv32/bits/fcntl.h b/libc/sysdeps/linux/riscv32/bits/fcntl.h +index a9d7c84e0..fdfb1805d 100644 +--- a/libc/sysdeps/linux/riscv32/bits/fcntl.h ++++ b/libc/sysdeps/linux/riscv32/bits/fcntl.h +@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/riscv64/bits/fcntl.h b/libc/sysdeps/linux/riscv64/bits/fcntl.h +index a9d7c84e0..fdfb1805d 100644 +--- a/libc/sysdeps/linux/riscv64/bits/fcntl.h ++++ b/libc/sysdeps/linux/riscv64/bits/fcntl.h +@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h +index 0d687f04f..4ae682425 100644 +--- a/libc/sysdeps/linux/sh/bits/fcntl.h ++++ b/libc/sysdeps/linux/sh/bits/fcntl.h +@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h +index 935495937..35224cdb3 100644 +--- a/libc/sysdeps/linux/sparc/bits/fcntl.h ++++ b/libc/sysdeps/linux/sparc/bits/fcntl.h +@@ -252,3 +252,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/sparc64/bits/fcntl.h b/libc/sysdeps/linux/sparc64/bits/fcntl.h +index 395c95baf..00e91a671 100644 +--- a/libc/sysdeps/linux/sparc64/bits/fcntl.h ++++ b/libc/sysdeps/linux/sparc64/bits/fcntl.h +@@ -248,3 +248,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/tile/bits/fcntl.h b/libc/sysdeps/linux/tile/bits/fcntl.h +index 818da5c4a..28fda899d 100644 +--- a/libc/sysdeps/linux/tile/bits/fcntl.h ++++ b/libc/sysdeps/linux/tile/bits/fcntl.h +@@ -229,3 +229,6 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + + #endif + __END_DECLS ++ ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h +index 3547a2046..821b2e3cc 100644 +--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h ++++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h +@@ -259,3 +259,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h +index 5af9d2124..9bc5fa893 100644 +--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h ++++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h +@@ -245,3 +245,5 @@ extern ssize_t tee (int __fdin, int __fdout, size_t __len, + #endif + __END_DECLS + ++/* Include generic Linux declarations. */ ++#include +-- +2.30.2 +