aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/filio.h
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-10-26 17:59:25 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-10-26 17:59:25 +0000
commited34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df (patch)
treedc1efd1ecce565e0e8ea9909023209760c09ba9f /sys/sys/filio.h
parent91b528c3b2c97f06cb6024159bdda4ca8544fe2e (diff)
downloadsrc-ed34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df.tar.gz
src-ed34a7fcf26fc1a36cf7b27d1a2d501bfd6b93df.zip
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
Notes
Notes: svn path=/head/; revision=339779
Diffstat (limited to 'sys/sys/filio.h')
-rw-r--r--sys/sys/filio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/sys/filio.h b/sys/sys/filio.h
index 7899791f7bce..868fe53c2585 100644
--- a/sys/sys/filio.h
+++ b/sys/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_ */