aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-10-26 17:59:25 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-11 11:52:46 +0200
commitc42aaaea4fd0effa2ad7871045eeb59eb53fa507 (patch)
treea1a688331fcb523994428b4605c3291f2376320a
parenteb4cbf4fd3e4ebcc2db02c488fa0ef88858ab973 (diff)
downloadnewlib-c42aaaea4fd0effa2ad7871045eeb59eb53fa507.zip
newlib-c42aaaea4fd0effa2ad7871045eeb59eb53fa507.tar.gz
newlib-c42aaaea4fd0effa2ad7871045eeb59eb53fa507.tar.bz2
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
-rw-r--r--newlib/libc/sys/rtems/include/sys/filio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/newlib/libc/sys/rtems/include/sys/filio.h b/newlib/libc/sys/rtems/include/sys/filio.h
index 7899791..868fe53 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_ */