From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 89D2C385C312; Mon, 11 Jul 2022 11:50:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89D2C385C312 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] Move 32-bit compat support for FIODGNAME to the right place. X-Act-Checkin: newlib-cygwin X-Git-Author: Brooks Davis X-Git-Refname: refs/heads/master X-Git-Oldrev: eb4cbf4fd3e4ebcc2db02c488fa0ef88858ab973 X-Git-Newrev: c42aaaea4fd0effa2ad7871045eeb59eb53fa507 Message-Id: <20220711115013.89D2C385C312@sourceware.org> Date: Mon, 11 Jul 2022 11:50:13 +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:50:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc42aaaea4fd= 0effa2ad7871045eeb59eb53fa507 commit c42aaaea4fd0effa2ad7871045eeb59eb53fa507 Author: Brooks Davis Date: Fri Oct 26 17:59:25 2018 +0000 Move 32-bit compat support for FIODGNAME to the right place. =20 ioctl(2) commands only have meaning in the context of a file descriptor so translating them in the syscall layer is incorrect. =20 The new handler users an accessor to retrieve/construct a pointer from the last member of the passed structure and relies on type punning to access the other member which requires no translation. =20 Unlike r339174 this change supports both places FIODGNAME is handled. =20 Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17475 Diff: --- newlib/libc/sys/rtems/include/sys/filio.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/newlib/libc/sys/rtems/include/sys/filio.h b/newlib/libc/sys/rt= ems/include/sys/filio.h index 7899791f7..868fe53c2 100644 --- a/newlib/libc/sys/rtems/include/sys/filio.h +++ b/newlib/libc/sys/rtems/include/sys/filio.h @@ -63,4 +63,16 @@ struct fiodgname_arg { #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ =20 +#ifdef _KERNEL +#ifdef COMPAT_FREEBSD32 +struct fiodgname_arg32 { + int len; + uint32_t buf; /* (void *) */ +}; +#define FIODGNAME_32 _IOC_NEWTYPE(FIODGNAME, struct fiodgname_arg32) +#endif + +void *fiodgname_buf_get_ptr(void *fgnp, u_long com); +#endif + #endif /* !_SYS_FILIO_H_ */