public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Move 32-bit compat support for FIODGNAME to the right place.
Date: Mon, 11 Jul 2022 11:50:13 +0000 (GMT)	[thread overview]
Message-ID: <20220711115013.89D2C385C312@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c42aaaea4fd0effa2ad7871045eeb59eb53fa507

commit c42aaaea4fd0effa2ad7871045eeb59eb53fa507
Author: Brooks Davis <brooks@FreeBSD.org>
Date:   Fri Oct 26 17:59:25 2018 +0000

    Move 32-bit compat support for FIODGNAME to the right place.
    
    ioctl(2) commands only have meaning in the context of a file descriptor
    so translating them in the syscall layer is incorrect.
    
    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.
    
    Unlike r339174 this change supports both places FIODGNAME is handled.
    
    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/rtems/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 */
 
+#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_ */


                 reply	other threads:[~2022-07-11 11:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220711115013.89D2C385C312@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).