note a leak that needs fixing eventually
[trinity.git] / syscalls / read.c
blobcbbf998c536d8d24f5abc4213c315a5a36c71eb6
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->syscall[childno].a2 = (unsigned long) get_non_null_address();
14 shm->syscall[childno].a3 = 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,