summaryrefslogtreecommitdiff
path: root/src/unistd/getcwd.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-23 15:22:33 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-23 15:22:33 -0500
commit1221e834f49adb91eb0b7443a57274f2611459c2 (patch)
tree7afb7ed5a203ddefd5559005af7ec61d801b972e /src/unistd/getcwd.c
parentf546f27d1fdb8d2663b2fbb130f53ee32cac90b0 (diff)
compile in current environment
Diffstat (limited to 'src/unistd/getcwd.c')
-rw-r--r--src/unistd/getcwd.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/unistd/getcwd.c b/src/unistd/getcwd.c
index e8e46a60..904e2c7d 100644
--- a/src/unistd/getcwd.c
+++ b/src/unistd/getcwd.c
@@ -1,20 +1,12 @@
-#include "stddef.h"
#include "sys/types.h"
#include <unistd.h>
-#include "errno.h"
#include "nonstd/assert.h"
#include "nonstd/syscall.h"
char * getcwd(char *buf, size_t size)
{
ASSERT_NONNULL(buf);
- SCNO(scno, "getcwd", NULL);
- int r = __libc.syscall(scno, buf, size);
- if (r < 0) {
- errno = -r;
- return NULL;
- }
- return buf;
+ SYSCALL("getcwd", char *, NULL, buf, size, 0, 0, 0, 0);
}
/*
POSIX(1)