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));
|
2014-05-12 14:05:17 +02:00
|
|
|
m.m_lc_vfs_readlink.namelen = strlen(name) + 1;
|
|
|
|
m.m_lc_vfs_readlink.bufsize = bufsiz;
|
|
|
|
m.m_lc_vfs_readlink.name = (vir_bytes)name;
|
|
|
|
m.m_lc_vfs_readlink.buf = (vir_bytes)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
|
|
|
}
|