1 #ifndef _LINUX_COMPAT_H
2 #define _LINUX_COMPAT_H
10 #include <linux/stat.h>
12 #include <linux/sem.h>
13 #include <linux/socket.h>
18 #include <asm/compat.h>
19 #include <asm/siginfo.h>
20 #include <asm/signal.h>
22 #ifndef COMPAT_USE_64BIT_TIME
23 #define COMPAT_USE_64BIT_TIME 0
26 #define compat_jiffies_to_clock_t(x) \
27 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
35 struct compat_itimerspec {
40 struct compat_utimbuf {
45 struct compat_itimerval {
84 #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
111 struct compat_iovec {
116 struct compat_rlimit {
121 struct compat_rusage {
141 struct compat_rusage __user *);
147 struct compat_rusage __user *);
149 struct compat_dirent {
156 struct compat_ustat {
163 #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
165 typedef struct compat_sigevent {
180 struct compat_ifmap {
183 unsigned short base_addr;
189 struct compat_if_settings {
195 struct compat_ifreq {
208 struct compat_ifmap ifru_map;
212 struct compat_if_settings ifru_settings;
216 struct compat_ifconf {
221 struct compat_robust_list {
225 struct compat_robust_list_head {
226 struct compat_robust_list
list;
239 struct compat_sysctl_args;
240 struct compat_kexec_segment;
253 #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
257 int version,
void __user *uptr);
277 const struct compat_iovec __user *vec,
unsigned long vlen);
279 const struct compat_iovec __user *vec,
unsigned long vlen);
281 const struct compat_iovec __user *vec,
282 unsigned long vlen,
u32 pos_low,
u32 pos_high);
284 const struct compat_iovec __user *vec,
285 unsigned long vlen,
u32 pos_low,
u32 pos_high);
289 #ifdef __ARCH_WANT_SYS_EXECVE
302 struct compat_rusage __user *ru);
304 #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
306 #define BITS_TO_COMPAT_LONGS(bits) \
307 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG)
310 unsigned long bitmap_size);
312 unsigned long bitmap_size);
316 const struct compat_sigevent __user *u_event);
320 static inline int compat_timeval_compare(
struct compat_timeval *lhs,
341 const struct compat_itimerspec __user *
src);
372 #define compat_epoll_event epoll_event
373 asmlinkage long compat_sys_epoll_pwait(
int epfd,
374 struct compat_epoll_event __user *
events,
375 int maxevents,
int timeout,
376 const compat_sigset_t __user *
sigmask,
380 struct compat_utimbuf __user *
t);
389 const compat_sigset_t __user *
sigmask,
392 const struct compat_itimerspec __user *utmr,
393 struct compat_itimerspec __user *otmr);
394 asmlinkage long compat_sys_timerfd_gettime(
int ufd,
395 struct compat_itimerspec __user *otmr);
399 const int __user *nodes,
432 unsigned long min_nr,
439 const char __user *dir_name,
440 const char __user *
type,
unsigned long flags,
441 const void __user *
data);
452 unsigned int nr_segs,
unsigned int flags);
457 asmlinkage long compat_sys_open_by_handle_at(
int mountdirfd,
468 const compat_sigset_t __user *
sigmask,
471 const compat_sigset_t __user *
sigmask,
473 asmlinkage long compat_sys_get_mempolicy(
int __user *policy,
486 char __user *optval,
unsigned int optlen);
490 unsigned vlen,
unsigned int flags);
497 int __user *addrlen);
499 unsigned vlen,
unsigned int flags,
504 struct compat_itimerval __user *it);
506 struct compat_itimerval __user *
in,
507 struct compat_itimerval __user *
out);
510 struct compat_rlimit __user *rlim);
512 struct compat_rlimit __user *rlim);
521 struct compat_sigevent __user *timer_event_spec,
522 timer_t __user *created_timer_id);
524 struct compat_itimerspec __user *
new,
525 struct compat_itimerspec __user *old);
527 struct compat_itimerspec __user *setting);
533 struct compat_timex __user *tp);
542 asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
551 char __user *optval,
int __user *optlen);
554 struct compat_kexec_segment __user *,
555 unsigned long flags);
560 const struct compat_sigevent __user *u_notification);
565 const char __user *u_msg_ptr,
566 size_t msg_len,
unsigned int msg_prio,
569 char __user *u_msg_ptr,
570 size_t msg_len,
unsigned int __user *u_msg_prio,
573 asmlinkage long compat_sys_sysctl(
struct compat_sysctl_args __user *args);
576 const struct compat_iovec __user *uvector,
577 unsigned long nr_segs,
578 unsigned long fast_segs,
struct iovec *fast_pointer,
579 struct iovec **ret_pointer);
584 const struct compat_iovec __user *lvec,
585 unsigned long liovcnt,
const struct compat_iovec __user *rvec,
586 unsigned long riovcnt,
unsigned long flags);
588 const struct compat_iovec __user *lvec,
589 unsigned long liovcnt,
const struct compat_iovec __user *rvec,
590 unsigned long riovcnt,
unsigned long flags);
592 asmlinkage long compat_sys_sendfile(
int out_fd,
int in_fd,
597 #define is_compat_task() (0)