Giovanni's symlinks patches (libs)
This commit is contained in:
parent
4c648c343e
commit
3acb6bf1fe
@ -1,13 +1,16 @@
|
|||||||
/*
|
#include <lib.h>
|
||||||
lstat.c
|
#define lstat _lstat
|
||||||
*/
|
|
||||||
|
|
||||||
#define stat _stat
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
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 */
|
message m;
|
||||||
return stat(path, sb);
|
|
||||||
|
m.m1_i1 = strlen(name) + 1;
|
||||||
|
m.m1_p1 = (char *) name;
|
||||||
|
m.m1_p2 = (char *) buffer;
|
||||||
|
return(_syscall(FS, LSTAT, &m));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
/*
|
#include <lib.h>
|
||||||
readlink.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <string.h>
|
||||||
|
|
||||||
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" */
|
message m;
|
||||||
return -1;
|
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
/*
|
#include <lib.h>
|
||||||
symlink.c
|
#define symlink _symlink
|
||||||
*/
|
#include <string.h>
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int symlink(const char *path1, const char *path2)
|
PUBLIC int symlink(name, name2)
|
||||||
|
_CONST char *name, *name2;
|
||||||
{
|
{
|
||||||
errno= ENOSYS;
|
message m;
|
||||||
return -1;
|
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user