compat.h 1.3 KB

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