From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id D1443385354C; Mon, 11 Jul 2022 11:51:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1443385354C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Jail and capability mode for shm_rename; X-Act-Checkin: newlib-cygwin X-Git-Author: David Bright X-Git-Refname: refs/heads/master X-Git-Oldrev: 12fb531a70a1b2db10e5a50bcc071b18021594c6 X-Git-Newrev: 0c854dd6d15774e12323110b699e2d0c90b7635a Message-Id: <20220711115103.D1443385354C@sourceware.org> Date: Mon, 11 Jul 2022 11:51:03 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:51:03 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D0c854dd6d15= 774e12323110b699e2d0c90b7635a commit 0c854dd6d15774e12323110b699e2d0c90b7635a Author: David Bright Date: Mon Nov 18 13:31:16 2019 +0000 Jail and capability mode for shm_rename; =20 add audit support for shm_rename =20 Co-mingling two things here: =20 * Addressing some feedback from Konstantin and Kyle re: jail, capability mode, and a few other things * Adding audit support as promised. =20 The audit support change includes a partial refresh of OpenBSM from upstream, where the change to add shm_rename has already been accepted. Matthew doesn't plan to work on refreshing anything else to support audit for those new event types. =20 Submitted by: Matthew Bryan Reviewed by: kib Relnotes: Yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22083 Diff: --- newlib/libc/sys/rtems/include/sys/mman.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/newlib/libc/sys/rtems/include/sys/mman.h b/newlib/libc/sys/rte= ms/include/sys/mman.h index c68efcc15..7a9b49429 100644 --- a/newlib/libc/sys/rtems/include/sys/mman.h +++ b/newlib/libc/sys/rtems/include/sys/mman.h @@ -118,6 +118,15 @@ #define MAP_ALIGNMENT_SHIFT 24 #define MAP_ALIGNMENT_MASK MAP_ALIGNED(0xff) #define MAP_ALIGNED_SUPER MAP_ALIGNED(1) /* align on a superpage */ + +/* + * Flags provided to shm_rename + */ +/* Don't overwrite dest, if it exists */ +#define SHM_RENAME_NOREPLACE (1 << 0) +/* Atomically swap src and dest */ +#define SHM_RENAME_EXCHANGE (1 << 1) + #endif /* __BSD_VISIBLE */ =20 #if __POSIX_VISIBLE >=3D 199309 @@ -133,14 +142,6 @@ */ #define MAP_FAILED ((void *)-1) =20 -/* - * Flags provided to shm_rename - */ -/* Don't overwrite dest, if it exists */ -#define SHM_RENAME_NOREPLACE (1 << 0) -/* Atomically swap src and dest */ -#define SHM_RENAME_EXCHANGE (1 << 1) - /* * msync() flags */ @@ -272,11 +273,11 @@ int posix_madvise(void *, size_t, int); int mlockall(int); int munlockall(void); int shm_open(const char *, int, mode_t); -int shm_rename(const char *, const char *, int); int shm_unlink(const char *); #endif #if __BSD_VISIBLE int memfd_create(const char *, unsigned int); +int shm_rename(const char *, const char *, int); #endif __END_DECLS