Lines Matching +full:a +full:- +full:h

1 // SPDX-License-Identifier: GPL-2.0
11 * Heavily inspired by the 32-bit Sparc compat code which is
18 #include <linux/kernel.h>
19 #include <linux/sched.h>
20 #include <linux/fs.h>
21 #include <linux/mm.h>
22 #include <linux/file.h>
23 #include <linux/signal.h>
24 #include <linux/resource.h>
25 #include <linux/times.h>
26 #include <linux/smp.h>
27 #include <linux/sem.h>
28 #include <linux/msg.h>
29 #include <linux/shm.h>
30 #include <linux/uio.h>
31 #include <linux/quota.h>
32 #include <linux/poll.h>
33 #include <linux/personality.h>
34 #include <linux/stat.h>
35 #include <linux/filter.h>
36 #include <linux/highmem.h>
37 #include <linux/mman.h>
38 #include <linux/ipv6.h>
39 #include <linux/in.h>
40 #include <linux/icmpv6.h>
41 #include <linux/syscalls.h>
42 #include <linux/sysctl.h>
43 #include <linux/binfmts.h>
44 #include <linux/capability.h>
45 #include <linux/compat.h>
46 #include <linux/vfs.h>
47 #include <linux/ptrace.h>
48 #include <linux/fadvise.h>
49 #include <linux/ipc.h>
50 #include <linux/slab.h>
52 #include <asm/types.h>
53 #include <linux/uaccess.h>
55 #include <net/scm.h>
56 #include <net/sock.h>
58 #include "compat_linux.h"
65 return -EINVAL; in COMPAT_SYSCALL_DEFINE5()
84 return -EINVAL; in COMPAT_SYSCALL_DEFINE5()
92 return -EINVAL; in COMPAT_SYSCALL_DEFINE5()
116 u32 st_blocks; /* Number 512-byte blocks allocated. */
132 tmp.st_dev = huge_encode_dev(stat->dev); in cp_stat64()
133 tmp.st_ino = stat->ino; in cp_stat64()
134 tmp.__st_ino = (u32)stat->ino; in cp_stat64()
135 tmp.st_mode = stat->mode; in cp_stat64()
136 tmp.st_nlink = (unsigned int)stat->nlink; in cp_stat64()
137 tmp.st_uid = from_kuid_munged(current_user_ns(), stat->uid); in cp_stat64()
138 tmp.st_gid = from_kgid_munged(current_user_ns(), stat->gid); in cp_stat64()
139 tmp.st_rdev = huge_encode_dev(stat->rdev); in cp_stat64()
140 tmp.st_size = stat->size; in cp_stat64()
141 tmp.st_blksize = (u32)stat->blksize; in cp_stat64()
142 tmp.st_blocks = (u32)stat->blocks; in cp_stat64()
143 tmp.st_atime = (u32)stat->atime.tv_sec; in cp_stat64()
144 tmp.st_mtime = (u32)stat->mtime.tv_sec; in cp_stat64()
145 tmp.st_ctime = (u32)stat->ctime.tv_sec; in cp_stat64()
147 return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; in cp_stat64()
191 * 4 system call parameters, so these system calls used a memory
206 struct mmap_arg_struct_emu31 a; in COMPAT_SYSCALL_DEFINE1() local
208 if (copy_from_user(&a, arg, sizeof(a))) in COMPAT_SYSCALL_DEFINE1()
209 return -EFAULT; in COMPAT_SYSCALL_DEFINE1()
210 if (a.offset & ~PAGE_MASK) in COMPAT_SYSCALL_DEFINE1()
211 return -EINVAL; in COMPAT_SYSCALL_DEFINE1()
212 return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, in COMPAT_SYSCALL_DEFINE1()
213 a.offset >> PAGE_SHIFT); in COMPAT_SYSCALL_DEFINE1()
218 struct mmap_arg_struct_emu31 a; in COMPAT_SYSCALL_DEFINE1() local
220 if (copy_from_user(&a, arg, sizeof(a))) in COMPAT_SYSCALL_DEFINE1()
221 return -EFAULT; in COMPAT_SYSCALL_DEFINE1()
222 return ksys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); in COMPAT_SYSCALL_DEFINE1()
228 return -EINVAL; in COMPAT_SYSCALL_DEFINE3()
236 return -EINVAL; in COMPAT_SYSCALL_DEFINE3()
266 struct fadvise64_64_args a; in COMPAT_SYSCALL_DEFINE1() local
268 if ( copy_from_user(&a, args, sizeof(a)) ) in COMPAT_SYSCALL_DEFINE1()
269 return -EFAULT; in COMPAT_SYSCALL_DEFINE1()
270 if (a.advice == 4) in COMPAT_SYSCALL_DEFINE1()
271 a.advice = POSIX_FADV_DONTNEED; in COMPAT_SYSCALL_DEFINE1()
272 else if (a.advice == 5) in COMPAT_SYSCALL_DEFINE1()
273 a.advice = POSIX_FADV_NOREUSE; in COMPAT_SYSCALL_DEFINE1()
274 return ksys_fadvise64_64(a.fd, a.offset, a.len, a.advice); in COMPAT_SYSCALL_DEFINE1()