]>
Commit | Line | Data |
---|---|---|
bcb28e42 PM |
1 | #include <linux/errno.h> |
2 | #include <linux/sched.h> | |
68db0cf1 | 3 | #include <linux/sched/task_stack.h> |
bcb28e42 PM |
4 | #include <linux/mm.h> |
5 | #include <linux/smp.h> | |
6 | #include <linux/sem.h> | |
7 | #include <linux/msg.h> | |
8 | #include <linux/shm.h> | |
9 | #include <linux/stat.h> | |
10 | #include <linux/syscalls.h> | |
11 | #include <linux/mman.h> | |
12 | #include <linux/file.h> | |
bcb28e42 PM |
13 | #include <linux/module.h> |
14 | #include <linux/fs.h> | |
15 | #include <linux/ipc.h> | |
16 | #include <asm/cacheflush.h> | |
7c0f6ba6 | 17 | #include <linux/uaccess.h> |
bcb28e42 | 18 | #include <asm/unistd.h> |
fa43972f | 19 | #include <asm/syscalls.h> |
bcb28e42 PM |
20 | |
21 | /* | |
22 | * sys_pipe() is the normal C calling standard for creating | |
23 | * a pipe. It's not the way Unix traditionally does this, though. | |
24 | */ | |
abafe5d9 | 25 | asmlinkage int sys_sh_pipe(void) |
bcb28e42 | 26 | { |
bcb28e42 PM |
27 | int fd[2]; |
28 | int error; | |
29 | ||
ed8cae8b | 30 | error = do_pipe_flags(fd, 0); |
bcb28e42 | 31 | if (!error) { |
abafe5d9 | 32 | current_pt_regs()->regs[1] = fd[1]; |
bcb28e42 PM |
33 | return fd[0]; |
34 | } | |
35 | return error; | |
36 | } | |
37 | ||
fa43972f | 38 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, |
bcb28e42 PM |
39 | size_t count, long dummy, loff_t pos) |
40 | { | |
41 | return sys_pread64(fd, buf, count, pos); | |
42 | } | |
43 | ||
fa43972f | 44 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, |
bcb28e42 PM |
45 | size_t count, long dummy, loff_t pos) |
46 | { | |
47 | return sys_pwrite64(fd, buf, count, pos); | |
48 | } | |
49 | ||
50 | asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, | |
51 | u32 len0, u32 len1, int advice) | |
52 | { | |
53 | #ifdef __LITTLE_ENDIAN__ | |
54 | return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0, | |
55 | (u64)len1 << 32 | len0, advice); | |
56 | #else | |
57 | return sys_fadvise64_64(fd, (u64)offset0 << 32 | offset1, | |
58 | (u64)len0 << 32 | len1, advice); | |
59 | #endif | |
60 | } |