~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/compat.h

Version: ~ [ linux-5.7 ] ~ [ linux-5.6.15 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.43 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.125 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.182 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.225 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.225 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.84 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp