aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-27 22:28:31 +0100
committerMattias Andrée <maandree@kth.se>2023-11-27 22:28:31 +0100
commit964ec5397c6f1b08ae5422fdf1da884e64039a35 (patch)
tree9d2669d81491d8d3de04998014e77d93cbab778d
parentAdd system calls and scripts for finding new and extended system calls (diff)
downloadsctrace-964ec5397c6f1b08ae5422fdf1da884e64039a35.tar.gz
sctrace-964ec5397c6f1b08ae5422fdf1da884e64039a35.tar.bz2
sctrace-964ec5397c6f1b08ae5422fdf1da884e64039a35.tar.xz
Linux limits errno values to [1, 4096)
Linux returns errno values negated, as such errno as returned are limited to be inside address range of the bytes within the higest addressable memory page, provided that the page size is 4096 or greater. Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--linux/os.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/os.h b/linux/os.h
index 05253c2..8e2eb5c 100644
--- a/linux/os.h
+++ b/linux/os.h
@@ -23,7 +23,7 @@
#endif
#define RETURN_IS_ERROR(RET)\
- ((RET) > -(unsigned long long int)PAGE_SIZE) /* Don't know the actual limit, but this seems safe */
+ ((RET) > -(unsigned long long int)4096) /* I guess Linux promises to never use a smaller page size */
#if defined(__x86_64__) && !defined(__IPL32__)
# include "x86-64.h"