compat.h 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_COMPAT_H
  3. #define _LINUX_COMPAT_H
  4. /*
  5. * These are the type definitions for the architecture specific
  6. * syscall compatibility layer.
  7. */
  8. #include <linux/types.h>
  9. #include <linux/compat_time.h>
  10. #include <linux/stat.h>
  11. #include <linux/param.h> /* for HZ */
  12. #include <linux/sem.h>
  13. #include <linux/socket.h>
  14. #include <linux/if.h>
  15. #include <linux/fs.h>
  16. #include <linux/aio_abi.h> /* for aio_context_t */
  17. #include <linux/uaccess.h>
  18. #include <linux/unistd.h>
  19. #include <asm/compat.h>
  20. #ifdef CONFIG_COMPAT
  21. #include <asm/siginfo.h>
  22. #include <asm/signal.h>
  23. #endif
  24. #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  25. /*
  26. * It may be useful for an architecture to override the definitions of the
  27. * COMPAT_SYSCALL_DEFINE0 and COMPAT_SYSCALL_DEFINEx() macros, in particular
  28. * to use a different calling convention for syscalls. To allow for that,
  29. + the prototypes for the compat_sys_*() functions below will *not* be included
  30. * if CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  31. */
  32. #include <asm/syscall_wrapper.h>
  33. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  34. #ifndef COMPAT_USE_64BIT_TIME
  35. #define COMPAT_USE_64BIT_TIME 0
  36. #endif
  37. #ifndef __SC_DELOUSE
  38. #define __SC_DELOUSE(t,v) ((__force t)(unsigned long)(v))
  39. #endif
  40. #ifndef COMPAT_SYSCALL_DEFINE0
  41. #define COMPAT_SYSCALL_DEFINE0(name) \
  42. asmlinkage long compat_sys_##name(void); \
  43. ALLOW_ERROR_INJECTION(compat_sys_##name, ERRNO); \
  44. asmlinkage long compat_sys_##name(void)
  45. #endif /* COMPAT_SYSCALL_DEFINE0 */
  46. #define COMPAT_SYSCALL_DEFINE1(name, ...) \
  47. COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
  48. #define COMPAT_SYSCALL_DEFINE2(name, ...) \
  49. COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
  50. #define COMPAT_SYSCALL_DEFINE3(name, ...) \
  51. COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
  52. #define COMPAT_SYSCALL_DEFINE4(name, ...) \
  53. COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
  54. #define COMPAT_SYSCALL_DEFINE5(name, ...) \
  55. COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
  56. #define COMPAT_SYSCALL_DEFINE6(name, ...) \
  57. COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
  58. /*
  59. * The asmlinkage stub is aliased to a function named __se_compat_sys_*() which
  60. * sign-extends 32-bit ints to longs whenever needed. The actual work is
  61. * done within __do_compat_sys_*().
  62. */
  63. #ifndef COMPAT_SYSCALL_DEFINEx
  64. #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
  65. __diag_push(); \
  66. __diag_ignore(GCC, 8, "-Wattribute-alias", \
  67. "Type aliasing is used to sanitize syscall arguments");\
  68. asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
  69. asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
  70. __attribute__((alias(__stringify(__se_compat_sys##name)))); \
  71. ALLOW_ERROR_INJECTION(compat_sys##name, ERRNO); \
  72. static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
  73. asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
  74. asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
  75. { \
  76. long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
  77. __MAP(x,__SC_TEST,__VA_ARGS__); \
  78. return ret; \
  79. } \
  80. __diag_pop(); \
  81. static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
  82. #endif /* COMPAT_SYSCALL_DEFINEx */
  83. #ifdef CONFIG_COMPAT
  84. #ifndef compat_user_stack_pointer
  85. #define compat_user_stack_pointer() current_user_stack_pointer()
  86. #endif
  87. #ifndef compat_sigaltstack /* we'll need that for MIPS */
  88. typedef struct compat_sigaltstack {
  89. compat_uptr_t ss_sp;
  90. int ss_flags;
  91. compat_size_t ss_size;
  92. } compat_stack_t;
  93. #endif
  94. #ifndef COMPAT_MINSIGSTKSZ
  95. #define COMPAT_MINSIGSTKSZ MINSIGSTKSZ
  96. #endif
  97. #define compat_jiffies_to_clock_t(x) \
  98. (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
  99. typedef __compat_uid32_t compat_uid_t;
  100. typedef __compat_gid32_t compat_gid_t;
  101. typedef compat_ulong_t compat_aio_context_t;
  102. struct compat_sel_arg_struct;
  103. struct rusage;
  104. struct compat_utimbuf {
  105. compat_time_t actime;
  106. compat_time_t modtime;
  107. };
  108. struct compat_itimerval {
  109. struct compat_timeval it_interval;
  110. struct compat_timeval it_value;
  111. };
  112. struct itimerval;
  113. int get_compat_itimerval(struct itimerval *, const struct compat_itimerval __user *);
  114. int put_compat_itimerval(struct compat_itimerval __user *, const struct itimerval *);
  115. struct compat_tms {
  116. compat_clock_t tms_utime;
  117. compat_clock_t tms_stime;
  118. compat_clock_t tms_cutime;
  119. compat_clock_t tms_cstime;
  120. };
  121. struct compat_timex {
  122. compat_uint_t modes;
  123. compat_long_t offset;
  124. compat_long_t freq;
  125. compat_long_t maxerror;
  126. compat_long_t esterror;
  127. compat_int_t status;
  128. compat_long_t constant;
  129. compat_long_t precision;
  130. compat_long_t tolerance;
  131. struct compat_timeval time;
  132. compat_long_t tick;
  133. compat_long_t ppsfreq;
  134. compat_long_t jitter;
  135. compat_int_t shift;
  136. compat_long_t stabil;
  137. compat_long_t jitcnt;
  138. compat_long_t calcnt;
  139. compat_long_t errcnt;
  140. compat_long_t stbcnt;
  141. compat_int_t tai;
  142. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  143. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  144. compat_int_t:32; compat_int_t:32; compat_int_t:32;
  145. };
  146. struct timex;
  147. int compat_get_timex(struct timex *, const struct compat_timex __user *);
  148. int compat_put_timex(struct compat_timex __user *, const struct timex *);
  149. #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
  150. typedef struct {
  151. compat_sigset_word sig[_COMPAT_NSIG_WORDS];
  152. } compat_sigset_t;
  153. struct compat_sigaction {
  154. #ifndef __ARCH_HAS_IRIX_SIGACTION
  155. compat_uptr_t sa_handler;
  156. compat_ulong_t sa_flags;
  157. #else
  158. compat_uint_t sa_flags;
  159. compat_uptr_t sa_handler;
  160. #endif
  161. #ifdef __ARCH_HAS_SA_RESTORER
  162. compat_uptr_t sa_restorer;
  163. #endif
  164. compat_sigset_t sa_mask __packed;
  165. };
  166. typedef union compat_sigval {
  167. compat_int_t sival_int;
  168. compat_uptr_t sival_ptr;
  169. } compat_sigval_t;
  170. typedef struct compat_siginfo {
  171. int si_signo;
  172. #ifndef __ARCH_HAS_SWAPPED_SIGINFO
  173. int si_errno;
  174. int si_code;
  175. #else
  176. int si_code;
  177. int si_errno;
  178. #endif
  179. union {
  180. int _pad[128/sizeof(int) - 3];
  181. /* kill() */
  182. struct {
  183. compat_pid_t _pid; /* sender's pid */
  184. __compat_uid32_t _uid; /* sender's uid */
  185. } _kill;
  186. /* POSIX.1b timers */
  187. struct {
  188. compat_timer_t _tid; /* timer id */
  189. int _overrun; /* overrun count */
  190. compat_sigval_t _sigval; /* same as below */
  191. } _timer;
  192. /* POSIX.1b signals */
  193. struct {
  194. compat_pid_t _pid; /* sender's pid */
  195. __compat_uid32_t _uid; /* sender's uid */
  196. compat_sigval_t _sigval;
  197. } _rt;
  198. /* SIGCHLD */
  199. struct {
  200. compat_pid_t _pid; /* which child */
  201. __compat_uid32_t _uid; /* sender's uid */
  202. int _status; /* exit code */
  203. compat_clock_t _utime;
  204. compat_clock_t _stime;
  205. } _sigchld;
  206. #ifdef CONFIG_X86_X32_ABI
  207. /* SIGCHLD (x32 version) */
  208. struct {
  209. compat_pid_t _pid; /* which child */
  210. __compat_uid32_t _uid; /* sender's uid */
  211. int _status; /* exit code */
  212. compat_s64 _utime;
  213. compat_s64 _stime;
  214. } _sigchld_x32;
  215. #endif
  216. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
  217. struct {
  218. compat_uptr_t _addr; /* faulting insn/memory ref. */
  219. #ifdef __ARCH_SI_TRAPNO
  220. int _trapno; /* TRAP # which caused the signal */
  221. #endif
  222. #define __COMPAT_ADDR_BND_PKEY_PAD (__alignof__(compat_uptr_t) < sizeof(short) ? \
  223. sizeof(short) : __alignof__(compat_uptr_t))
  224. union {
  225. /*
  226. * used when si_code=BUS_MCEERR_AR or
  227. * used when si_code=BUS_MCEERR_AO
  228. */
  229. short int _addr_lsb; /* Valid LSB of the reported address. */
  230. /* used when si_code=SEGV_BNDERR */
  231. struct {
  232. char _dummy_bnd[__COMPAT_ADDR_BND_PKEY_PAD];
  233. compat_uptr_t _lower;
  234. compat_uptr_t _upper;
  235. } _addr_bnd;
  236. /* used when si_code=SEGV_PKUERR */
  237. struct {
  238. char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD];
  239. u32 _pkey;
  240. } _addr_pkey;
  241. };
  242. } _sigfault;
  243. /* SIGPOLL */
  244. struct {
  245. compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  246. int _fd;
  247. } _sigpoll;
  248. struct {
  249. compat_uptr_t _call_addr; /* calling user insn */
  250. int _syscall; /* triggering system call number */
  251. unsigned int _arch; /* AUDIT_ARCH_* of syscall */
  252. } _sigsys;
  253. } _sifields;
  254. } compat_siginfo_t;
  255. /*
  256. * These functions operate on 32- or 64-bit specs depending on
  257. * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments.
  258. */
  259. extern int compat_get_timespec(struct timespec *, const void __user *);
  260. extern int compat_put_timespec(const struct timespec *, void __user *);
  261. extern int compat_get_timeval(struct timeval *, const void __user *);
  262. extern int compat_put_timeval(const struct timeval *, void __user *);
  263. struct compat_iovec {
  264. compat_uptr_t iov_base;
  265. compat_size_t iov_len;
  266. };
  267. struct compat_rlimit {
  268. compat_ulong_t rlim_cur;
  269. compat_ulong_t rlim_max;
  270. };
  271. struct compat_rusage {
  272. struct compat_timeval ru_utime;
  273. struct compat_timeval ru_stime;
  274. compat_long_t ru_maxrss;
  275. compat_long_t ru_ixrss;
  276. compat_long_t ru_idrss;
  277. compat_long_t ru_isrss;
  278. compat_long_t ru_minflt;
  279. compat_long_t ru_majflt;
  280. compat_long_t ru_nswap;
  281. compat_long_t ru_inblock;
  282. compat_long_t ru_oublock;
  283. compat_long_t ru_msgsnd;
  284. compat_long_t ru_msgrcv;
  285. compat_long_t ru_nsignals;
  286. compat_long_t ru_nvcsw;
  287. compat_long_t ru_nivcsw;
  288. };
  289. extern int put_compat_rusage(const struct rusage *,
  290. struct compat_rusage __user *);
  291. struct compat_siginfo;
  292. struct __compat_aio_sigset;
  293. struct compat_dirent {
  294. u32 d_ino;
  295. compat_off_t d_off;
  296. u16 d_reclen;
  297. char d_name[256];
  298. };
  299. struct compat_ustat {
  300. compat_daddr_t f_tfree;
  301. compat_ino_t f_tinode;
  302. char f_fname[6];
  303. char f_fpack[6];
  304. };
  305. #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
  306. typedef struct compat_sigevent {
  307. compat_sigval_t sigev_value;
  308. compat_int_t sigev_signo;
  309. compat_int_t sigev_notify;
  310. union {
  311. compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
  312. compat_int_t _tid;
  313. struct {
  314. compat_uptr_t _function;
  315. compat_uptr_t _attribute;
  316. } _sigev_thread;
  317. } _sigev_un;
  318. } compat_sigevent_t;
  319. struct compat_ifmap {
  320. compat_ulong_t mem_start;
  321. compat_ulong_t mem_end;
  322. unsigned short base_addr;
  323. unsigned char irq;
  324. unsigned char dma;
  325. unsigned char port;
  326. };
  327. struct compat_if_settings {
  328. unsigned int type; /* Type of physical device or protocol */
  329. unsigned int size; /* Size of the data allocated by the caller */
  330. compat_uptr_t ifs_ifsu; /* union of pointers */
  331. };
  332. struct compat_ifreq {
  333. union {
  334. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
  335. } ifr_ifrn;
  336. union {
  337. struct sockaddr ifru_addr;
  338. struct sockaddr ifru_dstaddr;
  339. struct sockaddr ifru_broadaddr;
  340. struct sockaddr ifru_netmask;
  341. struct sockaddr ifru_hwaddr;
  342. short ifru_flags;
  343. compat_int_t ifru_ivalue;
  344. compat_int_t ifru_mtu;
  345. struct compat_ifmap ifru_map;
  346. char ifru_slave[IFNAMSIZ]; /* Just fits the size */
  347. char ifru_newname[IFNAMSIZ];
  348. compat_caddr_t ifru_data;
  349. struct compat_if_settings ifru_settings;
  350. } ifr_ifru;
  351. };
  352. struct compat_ifconf {
  353. compat_int_t ifc_len; /* size of buffer */
  354. compat_caddr_t ifcbuf;
  355. };
  356. struct compat_robust_list {
  357. compat_uptr_t next;
  358. };
  359. struct compat_robust_list_head {
  360. struct compat_robust_list list;
  361. compat_long_t futex_offset;
  362. compat_uptr_t list_op_pending;
  363. };
  364. #ifdef CONFIG_COMPAT_OLD_SIGACTION
  365. struct compat_old_sigaction {
  366. compat_uptr_t sa_handler;
  367. compat_old_sigset_t sa_mask;
  368. compat_ulong_t sa_flags;
  369. compat_uptr_t sa_restorer;
  370. };
  371. #endif
  372. struct compat_keyctl_kdf_params {
  373. compat_uptr_t hashname;
  374. compat_uptr_t otherinfo;
  375. __u32 otherinfolen;
  376. __u32 __spare[8];
  377. };
  378. struct compat_statfs;
  379. struct compat_statfs64;
  380. struct compat_old_linux_dirent;
  381. struct compat_linux_dirent;
  382. struct linux_dirent64;
  383. struct compat_msghdr;
  384. struct compat_mmsghdr;
  385. struct compat_sysinfo;
  386. struct compat_sysctl_args;
  387. struct compat_kexec_segment;
  388. struct compat_mq_attr;
  389. struct compat_msgbuf;
  390. extern void compat_exit_robust_list(struct task_struct *curr);
  391. #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
  392. #define BITS_TO_COMPAT_LONGS(bits) DIV_ROUND_UP(bits, BITS_PER_COMPAT_LONG)
  393. long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
  394. unsigned long bitmap_size);
  395. long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
  396. unsigned long bitmap_size);
  397. int copy_siginfo_from_user32(siginfo_t *to, const struct compat_siginfo __user *from);
  398. int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from);
  399. int get_compat_sigevent(struct sigevent *event,
  400. const struct compat_sigevent __user *u_event);
  401. static inline int compat_timeval_compare(struct compat_timeval *lhs,
  402. struct compat_timeval *rhs)
  403. {
  404. if (lhs->tv_sec < rhs->tv_sec)
  405. return -1;
  406. if (lhs->tv_sec > rhs->tv_sec)
  407. return 1;
  408. return lhs->tv_usec - rhs->tv_usec;
  409. }
  410. static inline int compat_timespec_compare(struct compat_timespec *lhs,
  411. struct compat_timespec *rhs)
  412. {
  413. if (lhs->tv_sec < rhs->tv_sec)
  414. return -1;
  415. if (lhs->tv_sec > rhs->tv_sec)
  416. return 1;
  417. return lhs->tv_nsec - rhs->tv_nsec;
  418. }
  419. extern int get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat);
  420. /*
  421. * Defined inline such that size can be compile time constant, which avoids
  422. * CONFIG_HARDENED_USERCOPY complaining about copies from task_struct
  423. */
  424. static inline int
  425. put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
  426. unsigned int size)
  427. {
  428. /* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */
  429. #ifdef __BIG_ENDIAN
  430. compat_sigset_t v;
  431. switch (_NSIG_WORDS) {
  432. case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
  433. case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
  434. case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
  435. case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
  436. }
  437. return copy_to_user(compat, &v, size) ? -EFAULT : 0;
  438. #else
  439. return copy_to_user(compat, set, size) ? -EFAULT : 0;
  440. #endif
  441. }
  442. extern int compat_ptrace_request(struct task_struct *child,
  443. compat_long_t request,
  444. compat_ulong_t addr, compat_ulong_t data);
  445. extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
  446. compat_ulong_t addr, compat_ulong_t data);
  447. struct epoll_event; /* fortunately, this one is fixed-layout */
  448. extern ssize_t compat_rw_copy_check_uvector(int type,
  449. const struct compat_iovec __user *uvector,
  450. unsigned long nr_segs,
  451. unsigned long fast_segs, struct iovec *fast_pointer,
  452. struct iovec **ret_pointer);
  453. extern void __user *compat_alloc_user_space(unsigned long len);
  454. int compat_restore_altstack(const compat_stack_t __user *uss);
  455. int __compat_save_altstack(compat_stack_t __user *, unsigned long);
  456. #define compat_save_altstack_ex(uss, sp) do { \
  457. compat_stack_t __user *__uss = uss; \
  458. struct task_struct *t = current; \
  459. put_user_ex(ptr_to_compat((void __user *)t->sas_ss_sp), &__uss->ss_sp); \
  460. put_user_ex(t->sas_ss_flags, &__uss->ss_flags); \
  461. put_user_ex(t->sas_ss_size, &__uss->ss_size); \
  462. if (t->sas_ss_flags & SS_AUTODISARM) \
  463. sas_ss_reset(t); \
  464. } while (0);
  465. /*
  466. * These syscall function prototypes are kept in the same order as
  467. * include/uapi/asm-generic/unistd.h. Deprecated or obsolete system calls
  468. * go below.
  469. *
  470. * Please note that these prototypes here are only provided for information
  471. * purposes, for static analysis, and for linking from the syscall table.
  472. * These functions should not be called elsewhere from kernel code.
  473. *
  474. * As the syscall calling convention may be different from the default
  475. * for architectures overriding the syscall calling convention, do not
  476. * include the prototypes if CONFIG_ARCH_HAS_SYSCALL_WRAPPER is enabled.
  477. */
  478. #ifndef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  479. asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p);
  480. asmlinkage long compat_sys_io_submit(compat_aio_context_t ctx_id, int nr,
  481. u32 __user *iocb);
  482. asmlinkage long compat_sys_io_getevents(compat_aio_context_t ctx_id,
  483. compat_long_t min_nr,
  484. compat_long_t nr,
  485. struct io_event __user *events,
  486. struct compat_timespec __user *timeout);
  487. asmlinkage long compat_sys_io_pgetevents(compat_aio_context_t ctx_id,
  488. compat_long_t min_nr,
  489. compat_long_t nr,
  490. struct io_event __user *events,
  491. struct compat_timespec __user *timeout,
  492. const struct __compat_aio_sigset __user *usig);
  493. /* fs/cookies.c */
  494. asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
  495. /* fs/eventpoll.c */
  496. asmlinkage long compat_sys_epoll_pwait(int epfd,
  497. struct epoll_event __user *events,
  498. int maxevents, int timeout,
  499. const compat_sigset_t __user *sigmask,
  500. compat_size_t sigsetsize);
  501. /* fs/fcntl.c */
  502. asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
  503. compat_ulong_t arg);
  504. asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
  505. compat_ulong_t arg);
  506. /* fs/ioctl.c */
  507. asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
  508. compat_ulong_t arg);
  509. /* fs/namespace.c */
  510. asmlinkage long compat_sys_mount(const char __user *dev_name,
  511. const char __user *dir_name,
  512. const char __user *type, compat_ulong_t flags,
  513. const void __user *data);
  514. /* fs/open.c */
  515. asmlinkage long compat_sys_statfs(const char __user *pathname,
  516. struct compat_statfs __user *buf);
  517. asmlinkage long compat_sys_statfs64(const char __user *pathname,
  518. compat_size_t sz,
  519. struct compat_statfs64 __user *buf);
  520. asmlinkage long compat_sys_fstatfs(unsigned int fd,
  521. struct compat_statfs __user *buf);
  522. asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
  523. struct compat_statfs64 __user *buf);
  524. asmlinkage long compat_sys_truncate(const char __user *, compat_off_t);
  525. asmlinkage long compat_sys_ftruncate(unsigned int, compat_ulong_t);
  526. /* No generic prototype for truncate64, ftruncate64, fallocate */
  527. asmlinkage long compat_sys_openat(int dfd, const char __user *filename,
  528. int flags, umode_t mode);
  529. /* fs/readdir.c */
  530. asmlinkage long compat_sys_getdents(unsigned int fd,
  531. struct compat_linux_dirent __user *dirent,
  532. unsigned int count);
  533. /* fs/read_write.c */
  534. asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int);
  535. asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
  536. const struct compat_iovec __user *vec, compat_ulong_t vlen);
  537. asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
  538. const struct compat_iovec __user *vec, compat_ulong_t vlen);
  539. /* No generic prototype for pread64 and pwrite64 */
  540. asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
  541. const struct compat_iovec __user *vec,
  542. compat_ulong_t vlen, u32 pos_low, u32 pos_high);
  543. asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
  544. const struct compat_iovec __user *vec,
  545. compat_ulong_t vlen, u32 pos_low, u32 pos_high);
  546. #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64
  547. asmlinkage long compat_sys_preadv64(unsigned long fd,
  548. const struct compat_iovec __user *vec,
  549. unsigned long vlen, loff_t pos);
  550. #endif
  551. #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64
  552. asmlinkage long compat_sys_pwritev64(unsigned long fd,
  553. const struct compat_iovec __user *vec,
  554. unsigned long vlen, loff_t pos);
  555. #endif
  556. /* fs/sendfile.c */
  557. asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
  558. compat_off_t __user *offset, compat_size_t count);
  559. asmlinkage long compat_sys_sendfile64(int out_fd, int in_fd,
  560. compat_loff_t __user *offset, compat_size_t count);
  561. /* fs/select.c */
  562. asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
  563. compat_ulong_t __user *outp,
  564. compat_ulong_t __user *exp,
  565. struct compat_timespec __user *tsp,
  566. void __user *sig);
  567. asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
  568. unsigned int nfds,
  569. struct compat_timespec __user *tsp,
  570. const compat_sigset_t __user *sigmask,
  571. compat_size_t sigsetsize);
  572. /* fs/signalfd.c */
  573. asmlinkage long compat_sys_signalfd4(int ufd,
  574. const compat_sigset_t __user *sigmask,
  575. compat_size_t sigsetsize, int flags);
  576. /* fs/splice.c */
  577. asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
  578. unsigned int nr_segs, unsigned int flags);
  579. /* fs/stat.c */
  580. asmlinkage long compat_sys_newfstatat(unsigned int dfd,
  581. const char __user *filename,
  582. struct compat_stat __user *statbuf,
  583. int flag);
  584. asmlinkage long compat_sys_newfstat(unsigned int fd,
  585. struct compat_stat __user *statbuf);
  586. /* fs/sync.c: No generic prototype for sync_file_range and sync_file_range2 */
  587. /* fs/timerfd.c */
  588. asmlinkage long compat_sys_timerfd_gettime(int ufd,
  589. struct compat_itimerspec __user *otmr);
  590. asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
  591. const struct compat_itimerspec __user *utmr,
  592. struct compat_itimerspec __user *otmr);
  593. /* fs/utimes.c */
  594. asmlinkage long compat_sys_utimensat(unsigned int dfd,
  595. const char __user *filename,
  596. struct compat_timespec __user *t,
  597. int flags);
  598. /* kernel/exit.c */
  599. asmlinkage long compat_sys_waitid(int, compat_pid_t,
  600. struct compat_siginfo __user *, int,
  601. struct compat_rusage __user *);
  602. /* kernel/futex.c */
  603. asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
  604. struct compat_timespec __user *utime, u32 __user *uaddr2,
  605. u32 val3);
  606. asmlinkage long
  607. compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
  608. compat_size_t len);
  609. asmlinkage long
  610. compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
  611. compat_size_t __user *len_ptr);
  612. /* kernel/hrtimer.c */
  613. asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
  614. struct compat_timespec __user *rmtp);
  615. /* kernel/itimer.c */
  616. asmlinkage long compat_sys_getitimer(int which,
  617. struct compat_itimerval __user *it);
  618. asmlinkage long compat_sys_setitimer(int which,
  619. struct compat_itimerval __user *in,
  620. struct compat_itimerval __user *out);
  621. /* kernel/kexec.c */
  622. asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
  623. compat_ulong_t nr_segments,
  624. struct compat_kexec_segment __user *,
  625. compat_ulong_t flags);
  626. /* kernel/posix-timers.c */
  627. asmlinkage long compat_sys_timer_create(clockid_t which_clock,
  628. struct compat_sigevent __user *timer_event_spec,
  629. timer_t __user *created_timer_id);
  630. asmlinkage long compat_sys_timer_gettime(timer_t timer_id,
  631. struct compat_itimerspec __user *setting);
  632. asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags,
  633. struct compat_itimerspec __user *new,
  634. struct compat_itimerspec __user *old);
  635. asmlinkage long compat_sys_clock_settime(clockid_t which_clock,
  636. struct compat_timespec __user *tp);
  637. asmlinkage long compat_sys_clock_gettime(clockid_t which_clock,
  638. struct compat_timespec __user *tp);
  639. asmlinkage long compat_sys_clock_getres(clockid_t which_clock,
  640. struct compat_timespec __user *tp);
  641. asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
  642. struct compat_timespec __user *rqtp,
  643. struct compat_timespec __user *rmtp);
  644. /* kernel/ptrace.c */
  645. asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
  646. compat_long_t addr, compat_long_t data);
  647. /* kernel/sched/core.c */
  648. asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
  649. unsigned int len,
  650. compat_ulong_t __user *user_mask_ptr);
  651. asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
  652. unsigned int len,
  653. compat_ulong_t __user *user_mask_ptr);
  654. asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
  655. struct compat_timespec __user *interval);
  656. /* kernel/signal.c */
  657. asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
  658. compat_stack_t __user *uoss_ptr);
  659. asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
  660. compat_size_t sigsetsize);
  661. #ifndef CONFIG_ODD_RT_SIGACTION
  662. asmlinkage long compat_sys_rt_sigaction(int,
  663. const struct compat_sigaction __user *,
  664. struct compat_sigaction __user *,
  665. compat_size_t);
  666. #endif
  667. asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set,
  668. compat_sigset_t __user *oset,
  669. compat_size_t sigsetsize);
  670. asmlinkage long compat_sys_rt_sigpending(compat_sigset_t __user *uset,
  671. compat_size_t sigsetsize);
  672. asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese,
  673. struct compat_siginfo __user *uinfo,
  674. struct compat_timespec __user *uts, compat_size_t sigsetsize);
  675. asmlinkage long compat_sys_rt_sigqueueinfo(compat_pid_t pid, int sig,
  676. struct compat_siginfo __user *uinfo);
  677. /* No generic prototype for rt_sigreturn */
  678. /* kernel/sys.c */
  679. asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
  680. asmlinkage long compat_sys_getrlimit(unsigned int resource,
  681. struct compat_rlimit __user *rlim);
  682. asmlinkage long compat_sys_setrlimit(unsigned int resource,
  683. struct compat_rlimit __user *rlim);
  684. asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
  685. /* kernel/time.c */
  686. asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
  687. struct timezone __user *tz);
  688. asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
  689. struct timezone __user *tz);
  690. asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
  691. /* kernel/timer.c */
  692. asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
  693. /* ipc/mqueue.c */
  694. asmlinkage long compat_sys_mq_open(const char __user *u_name,
  695. int oflag, compat_mode_t mode,
  696. struct compat_mq_attr __user *u_attr);
  697. asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
  698. const char __user *u_msg_ptr,
  699. compat_size_t msg_len, unsigned int msg_prio,
  700. const struct compat_timespec __user *u_abs_timeout);
  701. asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
  702. char __user *u_msg_ptr,
  703. compat_size_t msg_len, unsigned int __user *u_msg_prio,
  704. const struct compat_timespec __user *u_abs_timeout);
  705. asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
  706. const struct compat_sigevent __user *u_notification);
  707. asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
  708. const struct compat_mq_attr __user *u_mqstat,
  709. struct compat_mq_attr __user *u_omqstat);
  710. /* ipc/msg.c */
  711. asmlinkage long compat_sys_msgctl(int first, int second, void __user *uptr);
  712. asmlinkage long compat_sys_msgrcv(int msqid, compat_uptr_t msgp,
  713. compat_ssize_t msgsz, compat_long_t msgtyp, int msgflg);
  714. asmlinkage long compat_sys_msgsnd(int msqid, compat_uptr_t msgp,
  715. compat_ssize_t msgsz, int msgflg);
  716. /* ipc/sem.c */
  717. asmlinkage long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
  718. asmlinkage long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
  719. unsigned nsems, const struct compat_timespec __user *timeout);
  720. /* ipc/shm.c */
  721. asmlinkage long compat_sys_shmctl(int first, int second, void __user *uptr);
  722. asmlinkage long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
  723. /* net/socket.c */
  724. asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, compat_size_t len,
  725. unsigned flags, struct sockaddr __user *addr,
  726. int __user *addrlen);
  727. asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
  728. char __user *optval, unsigned int optlen);
  729. asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
  730. char __user *optval, int __user *optlen);
  731. asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
  732. unsigned flags);
  733. asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
  734. unsigned int flags);
  735. /* mm/filemap.c: No generic prototype for readahead */
  736. /* security/keys/keyctl.c */
  737. asmlinkage long compat_sys_keyctl(u32 option,
  738. u32 arg2, u32 arg3, u32 arg4, u32 arg5);
  739. /* arch/example/kernel/sys_example.c */
  740. asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
  741. const compat_uptr_t __user *envp);
  742. /* mm/fadvise.c: No generic prototype for fadvise64_64 */
  743. /* mm/, CONFIG_MMU only */
  744. asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
  745. compat_ulong_t mode,
  746. compat_ulong_t __user *nmask,
  747. compat_ulong_t maxnode, compat_ulong_t flags);
  748. asmlinkage long compat_sys_get_mempolicy(int __user *policy,
  749. compat_ulong_t __user *nmask,
  750. compat_ulong_t maxnode,
  751. compat_ulong_t addr,
  752. compat_ulong_t flags);
  753. asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
  754. compat_ulong_t maxnode);
  755. asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
  756. compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
  757. const compat_ulong_t __user *new_nodes);
  758. asmlinkage long compat_sys_move_pages(pid_t pid, compat_ulong_t nr_pages,
  759. __u32 __user *pages,
  760. const int __user *nodes,
  761. int __user *status,
  762. int flags);
  763. asmlinkage long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid,
  764. compat_pid_t pid, int sig,
  765. struct compat_siginfo __user *uinfo);
  766. asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  767. unsigned vlen, unsigned int flags,
  768. struct compat_timespec __user *timeout);
  769. asmlinkage long compat_sys_wait4(compat_pid_t pid,
  770. compat_uint_t __user *stat_addr, int options,
  771. struct compat_rusage __user *ru);
  772. asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
  773. int, const char __user *);
  774. asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
  775. struct file_handle __user *handle,
  776. int flags);
  777. asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock,
  778. struct compat_timex __user *tp);
  779. asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  780. unsigned vlen, unsigned int flags);
  781. asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
  782. const struct compat_iovec __user *lvec,
  783. compat_ulong_t liovcnt, const struct compat_iovec __user *rvec,
  784. compat_ulong_t riovcnt, compat_ulong_t flags);
  785. asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
  786. const struct compat_iovec __user *lvec,
  787. compat_ulong_t liovcnt, const struct compat_iovec __user *rvec,
  788. compat_ulong_t riovcnt, compat_ulong_t flags);
  789. asmlinkage long compat_sys_execveat(int dfd, const char __user *filename,
  790. const compat_uptr_t __user *argv,
  791. const compat_uptr_t __user *envp, int flags);
  792. asmlinkage ssize_t compat_sys_preadv2(compat_ulong_t fd,
  793. const struct compat_iovec __user *vec,
  794. compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags);
  795. asmlinkage ssize_t compat_sys_pwritev2(compat_ulong_t fd,
  796. const struct compat_iovec __user *vec,
  797. compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags);
  798. #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64V2
  799. asmlinkage long compat_sys_readv64v2(unsigned long fd,
  800. const struct compat_iovec __user *vec,
  801. unsigned long vlen, loff_t pos, rwf_t flags);
  802. #endif
  803. #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64V2
  804. asmlinkage long compat_sys_pwritev64v2(unsigned long fd,
  805. const struct compat_iovec __user *vec,
  806. unsigned long vlen, loff_t pos, rwf_t flags);
  807. #endif
  808. /*
  809. * Deprecated system calls which are still defined in
  810. * include/uapi/asm-generic/unistd.h and wanted by >= 1 arch
  811. */
  812. /* __ARCH_WANT_SYSCALL_NO_AT */
  813. asmlinkage long compat_sys_open(const char __user *filename, int flags,
  814. umode_t mode);
  815. asmlinkage long compat_sys_utimes(const char __user *filename,
  816. struct compat_timeval __user *t);
  817. /* __ARCH_WANT_SYSCALL_NO_FLAGS */
  818. asmlinkage long compat_sys_signalfd(int ufd,
  819. const compat_sigset_t __user *sigmask,
  820. compat_size_t sigsetsize);
  821. /* __ARCH_WANT_SYSCALL_OFF_T */
  822. asmlinkage long compat_sys_newstat(const char __user *filename,
  823. struct compat_stat __user *statbuf);
  824. asmlinkage long compat_sys_newlstat(const char __user *filename,
  825. struct compat_stat __user *statbuf);
  826. /* __ARCH_WANT_SYSCALL_DEPRECATED */
  827. asmlinkage long compat_sys_time(compat_time_t __user *tloc);
  828. asmlinkage long compat_sys_utime(const char __user *filename,
  829. struct compat_utimbuf __user *t);
  830. asmlinkage long compat_sys_futimesat(unsigned int dfd,
  831. const char __user *filename,
  832. struct compat_timeval __user *t);
  833. asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
  834. compat_ulong_t __user *outp, compat_ulong_t __user *exp,
  835. struct compat_timeval __user *tvp);
  836. asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
  837. asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len,
  838. unsigned flags);
  839. asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
  840. /* obsolete: fs/readdir.c */
  841. asmlinkage long compat_sys_old_readdir(unsigned int fd,
  842. struct compat_old_linux_dirent __user *,
  843. unsigned int count);
  844. /* obsolete: fs/select.c */
  845. asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
  846. /* obsolete: ipc */
  847. asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
  848. /* obsolete: kernel/signal.c */
  849. #ifdef __ARCH_WANT_SYS_SIGPENDING
  850. asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set);
  851. #endif
  852. #ifdef __ARCH_WANT_SYS_SIGPROCMASK
  853. asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *nset,
  854. compat_old_sigset_t __user *oset);
  855. #endif
  856. #ifdef CONFIG_COMPAT_OLD_SIGACTION
  857. asmlinkage long compat_sys_sigaction(int sig,
  858. const struct compat_old_sigaction __user *act,
  859. struct compat_old_sigaction __user *oact);
  860. #endif
  861. /* obsolete: kernel/time/time.c */
  862. asmlinkage long compat_sys_stime(compat_time_t __user *tptr);
  863. /* obsolete: net/socket.c */
  864. asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
  865. #endif /* CONFIG_ARCH_HAS_SYSCALL_WRAPPER */
  866. /*
  867. * For most but not all architectures, "am I in a compat syscall?" and
  868. * "am I a compat task?" are the same question. For architectures on which
  869. * they aren't the same question, arch code can override in_compat_syscall.
  870. */
  871. #ifndef in_compat_syscall
  872. static inline bool in_compat_syscall(void) { return is_compat_task(); }
  873. #endif
  874. /**
  875. * ns_to_compat_timeval - Compat version of ns_to_timeval
  876. * @nsec: the nanoseconds value to be converted
  877. *
  878. * Returns the compat_timeval representation of the nsec parameter.
  879. */
  880. static inline struct compat_timeval ns_to_compat_timeval(s64 nsec)
  881. {
  882. struct timeval tv;
  883. struct compat_timeval ctv;
  884. tv = ns_to_timeval(nsec);
  885. ctv.tv_sec = tv.tv_sec;
  886. ctv.tv_usec = tv.tv_usec;
  887. return ctv;
  888. }
  889. /*
  890. * Kernel code should not call compat syscalls (i.e., compat_sys_xyzyyz())
  891. * directly. Instead, use one of the functions which work equivalently, such
  892. * as the kcompat_sys_xyzyyz() functions prototyped below.
  893. */
  894. int kcompat_sys_statfs64(const char __user * pathname, compat_size_t sz,
  895. struct compat_statfs64 __user * buf);
  896. int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
  897. struct compat_statfs64 __user * buf);
  898. #else /* !CONFIG_COMPAT */
  899. #define is_compat_task() (0)
  900. #ifndef in_compat_syscall
  901. static inline bool in_compat_syscall(void) { return false; }
  902. #endif
  903. #endif /* CONFIG_COMPAT */
  904. #endif /* _LINUX_COMPAT_H */