custom message type for VM_QUERY_EXIT
[minix3.git] / lib / libc / sys-minix / read.c
blobb8eeb72be0f10b99fc503e1d51e41e83703e937e
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #include <string.h>
6 #include <unistd.h>
8 #ifdef __weak_alias
9 __weak_alias(read, _read)
10 #endif
12 ssize_t read(int fd, void *buffer, size_t nbytes)
14 message m;
16 memset(&m, 0, sizeof(m));
17 m.m_lc_vfs_readwrite.fd = fd;
18 m.m_lc_vfs_readwrite.len = nbytes;
19 m.m_lc_vfs_readwrite.buf = (vir_bytes)buffer;
20 return(_syscall(VFS_PROC_NR, VFS_READ, &m));