summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-23 09:54:44 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-08-24 16:37:53 +0200
commited0b10722c880d82e5da2a357122f5ae0e53d4db (patch)
tree67113b2505692b356ed58c8e507dca4546d86fab
parentfa63753f86ccf912d2553934ee6aec787030fa8a (diff)
include: kernel.h: define SSIZE_MAX
Define SSIZE_MAX, the largest value fitting into a variable of type ssize_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r--include/linux/kernel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b88c210065..3e71d61074 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -19,6 +19,9 @@
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
+#ifndef SSIZE_MAX
+#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
+#endif
#define U8_MAX ((u8)~0U)
#define S8_MAX ((s8)(U8_MAX>>1))