summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/bits
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2010-02-05 11:10:14 -0800
committerAustin Foxley <austinf@cetoncorp.com>2010-02-05 11:10:32 -0800
commitf7eba78a7464c7b31326abf92dab254608835028 (patch)
tree5558a9e8d2c7c4484387030427701d81bd8b83e5 /libc/sysdeps/linux/common/bits
parent3e808a4c28f214314e8457672fae0f5d17f5450a (diff)
parentdf1580676a48dc3a9faf7e508ad3ec822a8e5a05 (diff)
Merge commit 'origin/master' into nptl
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r--libc/sysdeps/linux/common/bits/syscalls-common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h
index 78bbf6c22..5e4e350c5 100644
--- a/libc/sysdeps/linux/common/bits/syscalls-common.h
+++ b/libc/sysdeps/linux/common/bits/syscalls-common.h
@@ -33,6 +33,9 @@
#ifndef INLINE_SYSCALL
# define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(__NR_##name, nr, args)
#endif
+#ifndef INLINE_SYSCALL_NOERR
+# define INLINE_SYSCALL_NOERR(name, nr, args...) INLINE_SYSCALL_NOERR_NCS(__NR_##name, nr, args)
+#endif
/* Just like INLINE_SYSCALL(), but take a non-constant syscall (NCS) argument */
#ifndef INLINE_SYSCALL_NCS
@@ -47,6 +50,14 @@
__res; \
})
#endif
+#ifndef INLINE_SYSCALL_NOERR_NCS
+# define INLINE_SYSCALL_NOERR_NCS(name, nr, args...) \
+({ \
+ INTERNAL_SYSCALL_DECL(__err); \
+ long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args); \
+ __res; \
+})
+#endif
/* No point in forcing people to implement both when they only need one */
#ifndef INTERNAL_SYSCALL
@@ -80,8 +91,14 @@ type name(C_DECL_ARGS_##nargs(args)) { \
return (type)INLINE_SYSCALL(name, nargs, C_ARGS_##nargs(args)); \
}
+#define SYSCALL_NOERR_FUNC(nargs, type, name, args...) \
+type name(C_DECL_ARGS_##nargs(args)) { \
+ return (type)INLINE_SYSCALL_NOERR(name, nargs, C_ARGS_##nargs(args)); \
+}
+
#define _syscall0(args...) SYSCALL_FUNC(0, args)
#define _syscall1(args...) SYSCALL_FUNC(1, args)
+#define _syscall_noerr1(args...) SYSCALL_NOERR_FUNC(1, args)
#define _syscall2(args...) SYSCALL_FUNC(2, args)
#define _syscall3(args...) SYSCALL_FUNC(3, args)
#define _syscall4(args...) SYSCALL_FUNC(4, args)