aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/systm.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-04-01 18:29:38 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-04-01 18:29:38 +0000
commit611fcff994ae57d52fa08275f7b72f00ebb5a073 (patch)
tree532b14e43c8565dd413335579e1cf4ad172e47c8 /sys/sys/systm.h
parent659e74662f6104dcc7a4b022f4eaf0a10221fb87 (diff)
downloadsrc-611fcff994ae57d52fa08275f7b72f00ebb5a073.tar.gz
src-611fcff994ae57d52fa08275f7b72f00ebb5a073.zip
Cap IOSIZE_MAX to INT_MAX for 32-bit processes.
Previously, freebsd32 binaries could submit read/write requests with lengths greater than INT_MAX that a native kernel would have rejected. Reviewed by: kib Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5788
Notes
Notes: svn path=/head/; revision=297493
Diffstat (limited to 'sys/sys/systm.h')
-rw-r--r--sys/sys/systm.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 026a03ccba40..9c6e45082170 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -148,10 +148,14 @@ extern char **kenvp;
extern const void *zero_region; /* address space maps to a zeroed page */
extern int unmapped_buf_allowed;
-extern int iosize_max_clamp;
-extern int devfs_iosize_max_clamp;
-#define IOSIZE_MAX (iosize_max_clamp ? INT_MAX : SSIZE_MAX)
-#define DEVFS_IOSIZE_MAX (devfs_iosize_max_clamp ? INT_MAX : SSIZE_MAX)
+
+#ifdef __LP64__
+#define IOSIZE_MAX iosize_max()
+#define DEVFS_IOSIZE_MAX devfs_iosize_max()
+#else
+#define IOSIZE_MAX SSIZE_MAX
+#define DEVFS_IOSIZE_MAX SSIZE_MAX
+#endif
/*
* General function declarations.
@@ -403,6 +407,11 @@ struct cdev;
dev_t dev2udev(struct cdev *x);
const char *devtoname(struct cdev *cdev);
+#ifdef __LP64__
+size_t devfs_iosize_max(void);
+size_t iosize_max(void);
+#endif
+
int poll_no_poll(int events);
/* XXX: Should be void nanodelay(u_int nsec); */