merge newfstat variants
[trinity.git] / syscalls / read.c
blob126b00618b4a9550a5dd59ba2e1de7c569d2a206
1 /*
2 * SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
3 */
4 #include <stdlib.h>
5 #include <string.h>
6 #include "maps.h"
7 #include "sanitise.h"
8 #include "shm.h"
9 #include "arch.h"
11 static void sanitise_read(int childno)
13 shm->a2[childno] = (unsigned long) get_non_null_address();
14 shm->a3[childno] = rand() % page_size;
17 struct syscallentry syscall_read = {
18 .name = "read",
19 .num_args = 3,
20 .sanitise = sanitise_read,
21 .arg1name = "fd",
22 .arg1type = ARG_FD,
23 .arg2name = "buf",
24 .arg2type = ARG_ADDRESS,
25 .arg3name = "count",
26 .arg3type = ARG_LEN,
27 .flags = NEED_ALARM,