compat.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef NET_COMPAT_H
  2. #define NET_COMPAT_H
  3. struct sock;
  4. #if defined(CONFIG_COMPAT)
  5. #include <linux/compat.h>
  6. struct compat_msghdr {
  7. compat_uptr_t msg_name; /* void * */
  8. compat_int_t msg_namelen;
  9. compat_uptr_t msg_iov; /* struct compat_iovec * */
  10. compat_size_t msg_iovlen;
  11. compat_uptr_t msg_control; /* void * */
  12. compat_size_t msg_controllen;
  13. compat_uint_t msg_flags;
  14. };
  15. struct compat_cmsghdr {
  16. compat_size_t cmsg_len;
  17. compat_int_t cmsg_level;
  18. compat_int_t cmsg_type;
  19. };
  20. extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *);
  21. #else /* defined(CONFIG_COMPAT) */
  22. #define compat_msghdr msghdr /* to avoid compiler warnings */
  23. #endif /* defined(CONFIG_COMPAT) */
  24. extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *);
  25. extern int verify_compat_iovec(struct msghdr *, struct iovec *, char *, int);
  26. extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned);
  27. extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
  28. extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
  29. extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
  30. extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int);
  31. #endif /* NET_COMPAT_H */