etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / readlink.c
bloba7b80cea18d5f2f76f8f525c96fcf3431fd93a11
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #include <unistd.h>
6 #include <string.h>
8 #ifdef __weak_alias
9 __weak_alias(readlink, _readlink)
10 #endif
12 ssize_t readlink(const char *name, char *buffer, size_t bufsiz)
14 message m;
16 memset(&m, 0, sizeof(m));
17 m.m_lc_vfs_readlink.namelen = strlen(name) + 1;
18 m.m_lc_vfs_readlink.bufsize = bufsiz;
19 m.m_lc_vfs_readlink.name = (vir_bytes)name;
20 m.m_lc_vfs_readlink.buf = (vir_bytes)buffer;
22 return(_syscall(VFS_PROC_NR, VFS_READLINK, &m));