From 72677cc3d8403da4b35c99617352bde347780222 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 22 Jul 2002 17:10:30 +0000 Subject: Rework syscall handling. Rewrite syscall handlers for x86 and ARM. Prepare to kill the UNIFIED_SYSCALL option and instead have it be a per arch thing that is either enabled or not for that arch. -Erik --- libc/sysdeps/linux/common/getcwd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/common/getcwd.c') diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index 1ec00a36e..9cdd84b47 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -8,8 +8,12 @@ #include #ifdef __NR_getcwd -#define __NR___getcwd __NR_getcwd -static inline _syscall2(int, __getcwd, char *, buf, unsigned long, size); + +#ifndef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) __syscall_getcwd (args) +#define __NR___syscall_getcwd __NR_getcwd +static inline _syscall2(int, __syscall_getcwd, char *, buf, unsigned long, size); +#endif char *getcwd(char *buf, int size) { @@ -31,7 +35,7 @@ char *getcwd(char *buf, int size) if (buf == NULL) return NULL; } - ret = __getcwd(buf, size); + ret = INLINE_SYSCALL(getcwd, 2, buf, size); if (ret < 0) { if (allocbuf) { free(allocbuf); -- cgit v1.2.3