From 3acb6bf1fef771b69716f0832092799656c5739b Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 31 Oct 2005 14:28:19 +0000 Subject: [PATCH] Giovanni's symlinks patches (libs) --- lib/posix/lstat.c | 21 ++++++++++++--------- lib/posix/readlink.c | 22 ++++++++++++++-------- lib/posix/symlink.c | 20 ++++++++++++-------- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/lib/posix/lstat.c b/lib/posix/lstat.c index b96fa6fff..bdde67c52 100644 --- a/lib/posix/lstat.c +++ b/lib/posix/lstat.c @@ -1,13 +1,16 @@ -/* -lstat.c -*/ - -#define stat _stat - +#include +#define lstat _lstat #include +#include -int lstat(const char *path, struct stat *sb) +PUBLIC int lstat(name, buffer) +_CONST char *name; +struct stat *buffer; { - /* Without symlinks, lstat is equal to stat */ - return stat(path, sb); + message m; + + m.m1_i1 = strlen(name) + 1; + m.m1_p1 = (char *) name; + m.m1_p2 = (char *) buffer; + return(_syscall(FS, LSTAT, &m)); } diff --git a/lib/posix/readlink.c b/lib/posix/readlink.c index be8350d0c..3243c93bb 100644 --- a/lib/posix/readlink.c +++ b/lib/posix/readlink.c @@ -1,12 +1,18 @@ -/* -readlink.c -*/ - +#include #include -#include +#include -int readlink(const char *path, char *buf, int bufsiz) +PUBLIC int readlink(name, buffer, bufsiz) +_CONST char *name; +char *buffer; +size_t bufsiz; { - errno = EINVAL; /* "The named file is not a symbolic link" */ - return -1; + message m; + + m.m1_i1 = strlen(name) + 1; + m.m1_i2 = bufsiz; + m.m1_p1 = (char *) name; + m.m1_p2 = (char *) buffer; + + return(_syscall(FS, RDLNK, &m)); } diff --git a/lib/posix/symlink.c b/lib/posix/symlink.c index 3e918fe08..9398ca918 100644 --- a/lib/posix/symlink.c +++ b/lib/posix/symlink.c @@ -1,12 +1,16 @@ -/* -symlink.c -*/ - -#include +#include +#define symlink _symlink +#include #include -int symlink(const char *path1, const char *path2) +PUBLIC int symlink(name, name2) +_CONST char *name, *name2; { - errno= ENOSYS; - return -1; + message m; + + m.m1_i1 = strlen(name) + 1; + m.m1_i2 = strlen(name2) + 1; + m.m1_p1 = (char *) name; + m.m1_p2 = (char *) name2; + return(_syscall(FS, SYMLINK, &m)); } -- 2.44.0