summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-12 16:37:20 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-12 16:37:20 -0400
commit158922e3403b664da74821138f3be061e23a5fe8 (patch)
treee91bab565ddb1ba581c898a3eff66515fb3c6e54 /src
parentb83f89d4d95d4387412491d8560a4da0f89df342 (diff)
implement as syscall
Diffstat (limited to 'src')
-rw-r--r--src/sys/stat/stat.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/sys/stat/stat.c b/src/sys/stat/stat.c
index 2c2d02d2..233a0587 100644
--- a/src/sys/stat/stat.c
+++ b/src/sys/stat/stat.c
@@ -2,30 +2,14 @@
#include <sys/stat.h>
#include "stdlib.h"
#include "../../_assert.h"
+#include "../../_syscall.h"
int stat(const char * restrict path, struct stat * restrict buf)
{
ASSERT_NONNULL(path);
ASSERT_NONNULL(buf);
- int ret = 0;
- #if 0
- char *linkbuf = NULL;
-
- do {
- ret = lstat(path, buf);
- if (S_ISLNK(buf->st_mode)) {
- linkbuf = realloc(linkbuf, buf->st_size + 1);
- readlink(path, linkbuf, buf->st_size);
- path = linkbuf;
- } else {
- path = NULL;
- }
- } while (path);
- realloc(linkbuf, 0);
- #endif
-
- return ret;
+ SYSCALL(stat, int, -1, path, buf, 0, 0, 0, 0);
}
/*
POSIX(1)