2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <lib.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#ifdef __weak_alias
|
|
|
|
__weak_alias(readlink, _readlink)
|
|
|
|
#endif
|
|
|
|
|
2012-08-10 22:09:43 +02:00
|
|
|
ssize_t readlink(const char *name, char *buffer, size_t bufsiz)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.VFS_READLINK_NAMELEN = strlen(name) + 1;
|
|
|
|
m.VFS_READLINK_BUFSIZE = bufsiz;
|
|
|
|
m.VFS_READLINK_NAME = (char *) __UNCONST(name);
|
|
|
|
m.VFS_READLINK_BUF = (char *) buffer;
|
2011-02-17 18:11:09 +01:00
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
return(_syscall(VFS_PROC_NR, VFS_READLINK, &m));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|