1 #ifndef _TRINITY_COMPAT_H
2 #define _TRINITY_COMPAT_H 1
6 #define AT_EMPTY_PATH 0x1000
10 #define O_PATH 010000000 /* Resolve pathname but do not open file. */
14 #define O_CLOEXEC 02000000
18 #define O_TMPFILE 020000000
21 #ifndef AT_NO_AUTOMOUNT
22 #define AT_NO_AUTOMOUNT 0x800
25 #ifndef F_LINUX_SPECIFIC_BASE
26 #define F_LINUX_SPECIFIC_BASE 1024
30 #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
34 #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
37 #ifndef F_DUPFD_CLOEXEC
38 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
42 #define F_SETOWN_EX 15
46 #define F_GETOWN_EX 16
49 /* linux/hw_breakpoint.h */
51 HW_BREAKPOINT_LEN_1
= 1,
52 HW_BREAKPOINT_LEN_2
= 2,
53 HW_BREAKPOINT_LEN_4
= 4,
54 HW_BREAKPOINT_LEN_8
= 8,
58 HW_BREAKPOINT_EMPTY
= 0,
61 HW_BREAKPOINT_RW
= HW_BREAKPOINT_R
| HW_BREAKPOINT_W
,
63 HW_BREAKPOINT_INVALID
= HW_BREAKPOINT_RW
| HW_BREAKPOINT_X
,
66 /* asm-generic/mman-common.h */
68 #ifndef MAP_UNINITIALIZED
69 #define MAP_UNINITIALIZED 0x4000000
75 #define MAP_HUGETLB 0x40000
78 #define MAP_STACK 0x20000
81 #ifndef MADV_MERGEABLE
82 #define MADV_MERGEABLE 12
84 #ifndef MADV_UNMERGEABLE
85 #define MADV_UNMERGEABLE 13
88 #define MADV_HUGEPAGE 14
90 #ifndef MADV_NOHUGEPAGE
91 #define MADV_NOHUGEPAGE 15
97 #define SOCK_CLOEXEC 02000000
100 #ifndef SOCK_NONBLOCK
101 #define SOCK_NONBLOCK 04000
108 #define AF_RDS PF_RDS
115 #define AF_LLC PF_LLC
129 #define AF_CAN PF_CAN
136 #define AF_TIPC PF_TIPC
143 #define AF_PHONET PF_PHONET
150 #define AF_CAIF PF_CAIF
157 #define AF_ALG PF_ALG
164 #define AF_NFC PF_NFC
171 #define AF_VSOCK PF_VSOCK
174 #ifndef NFC_SOCKPROTO_RAW
175 #define NFC_SOCKPROTO_RAW 0
177 #ifndef NFC_SOCKPROTO_LLCP
178 #define NFC_SOCKPROTO_LLCP 1
181 #ifndef MSG_WAITFORONE
182 #define MSG_WAITFORONE 0x10000
185 #ifndef MSG_CMSG_CLOEXEC
186 #define MSG_CMSG_CLOEXEC 0x40000000
191 #define MSG_PROBE 0x10
194 #define MSG_FASTOPEN 0x20000000
196 #ifndef MSG_CMSG_COMPAT
197 #define MSG_CMSG_COMPAT 0x80000000
202 #define SYS_RECVMMSG 19
205 #define SYS_SENDMMSG 20
208 /* linux/netlink.h */
209 #ifndef NETLINK_CRYPTO
210 #define NETLINK_CRYPTO 21
212 #ifndef NETLINK_RX_RING
213 #define NETLINK_RX_RING 6
214 #define NETLINK_TX_RING 7
218 #ifndef PR_MCE_KILL_GET
219 #define PR_MCE_KILL_GET 34
223 #ifndef RDS_CANCEL_SENT_TO
224 #define RDS_CANCEL_SENT_TO 1
226 #define RDS_FREE_MR 3
227 /* deprecated: RDS_BARRIER 4 */
228 #define RDS_RECVERR 5
229 #define RDS_CONG_MONITOR 6
230 #define RDS_GET_MR_FOR_DEST 7
233 /* asm/ptrace-abi.h */
234 #ifndef PTRACE_SYSEMU
235 #define PTRACE_SYSEMU 31
237 #ifndef PTRACE_SYSEMU_SINGLESTEP
238 #define PTRACE_SYSEMU_SINGLESTEP 32
240 #ifndef PTRACE_GETSIGMASK
241 #define PTRACE_GETSIGMASK 0x420a
242 #define PTRACE_SETSIGMASK 0x420b
247 #define TFD_CLOEXEC 02000000
250 #define TFD_NONBLOCK 04000
254 #ifndef KEYCTL_GET_KEYRING_ID
255 #define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
256 #define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
257 #define KEYCTL_UPDATE 2 /* update a key */
258 #define KEYCTL_REVOKE 3 /* revoke a key */
259 #define KEYCTL_CHOWN 4 /* set ownership of a key */
260 #define KEYCTL_SETPERM 5 /* set perms on a key */
261 #define KEYCTL_DESCRIBE 6 /* describe a key */
262 #define KEYCTL_CLEAR 7 /* clear contents of a keyring */
263 #define KEYCTL_LINK 8 /* link a key into a keyring */
264 #define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
265 #define KEYCTL_SEARCH 10 /* search for a key in a keyring */
266 #define KEYCTL_READ 11 /* read a key or keyring's contents */
267 #define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
268 #define KEYCTL_NEGATE 13 /* negate a partially constructed key */
269 #define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
270 #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
271 #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
272 #define KEYCTL_GET_SECURITY 17 /* get key security label */
273 #define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */
276 #ifndef KEYCTL_REJECT
277 #define KEYCTL_REJECT 19 /* reject a partially constructed key */
280 #ifndef KEYCTL_INSTANTIATE_IOV
281 #define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */
300 #define SO_BSDCOMPAT 14
304 #define SO_REUSEPORT 15
308 #define SO_RXQ_OVFL 40
311 #ifndef SO_WIFI_STATUS
312 #define SO_WIFI_STATUS 41
316 #define SO_PEEK_OFF 42
323 #ifndef SO_LOCK_FILTER
324 #define SO_LOCK_FILTER 44
327 #ifndef SO_SELECT_ERR_QUEUE
328 #define SO_SELECT_ERR_QUEUE 45
332 #define SO_BUSY_POLL 46
335 #ifndef SO_MAX_PACING_RATE
336 #define SO_MAX_PACING_RATE 47
340 #ifndef TCP_COOKIE_TRANSACTIONS
341 #define TCP_COOKIE_TRANSACTIONS 15
344 #ifndef TCP_THIN_LINEAR_TIMEOUTS
345 #define TCP_THIN_LINEAR_TIMEOUTS 16
348 #ifndef TCP_THIN_DUPACK
349 #define TCP_THIN_DUPACK 17
352 #ifndef TCP_USER_TIMEOUT
353 #define TCP_USER_TIMEOUT 18
357 #define TCP_REPAIR 19
360 #ifndef TCP_REPAIR_QUEUE
361 #define TCP_REPAIR_QUEUE 20
364 #ifndef TCP_QUEUE_SEQ
365 #define TCP_QUEUE_SEQ 21
368 #ifndef TCP_REPAIR_OPTIONS
369 #define TCP_REPAIR_OPTIONS 22
373 #define TCP_FASTOPEN 23
376 /* linux/if_packet.h */
377 #ifndef PACKET_VNET_HDR
378 #define PACKET_VNET_HDR 15
381 #ifndef PACKET_TX_TIMESTAMP
382 #define PACKET_TX_TIMESTAMP 16
385 #ifndef PACKET_TIMESTAMP
386 #define PACKET_TIMESTAMP 17
389 #ifndef PACKET_FANOUT
390 #define PACKET_FANOUT 18
394 #ifndef DCCP_SOCKOPT_QPOLICY_ID
395 #define DCCP_SOCKOPT_QPOLICY_ID 16
398 #ifndef DCCP_SOCKOPT_QPOLICY_TXQLEN
399 #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
403 #ifndef UDPLITE_SEND_CSCOV
404 #define UDPLITE_SEND_CSCOV 10 /* sender partial coverage (as sent) */
406 #ifndef UDPLITE_RECV_CSCOV
407 #define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */
415 #define IP_FREEBIND 15
417 #ifndef IP_IPSEC_POLICY
418 #define IP_IPSEC_POLICY 16
420 #ifndef IP_XFRM_POLICY
421 #define IP_XFRM_POLICY 17
424 #define IP_PASSSEC 18
426 #ifndef IP_TRANSPARENT
427 #define IP_TRANSPARENT 19
432 #ifndef IP_ORIGDSTADDR
433 #define IP_ORIGDSTADDR 20
435 #ifndef IP_RECVORIGDSTADDR
436 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
439 #define IP_NODEFRAG 22
441 #ifndef IP_MULTICAST_ALL
442 #define IP_MULTICAST_ALL 49
444 #ifndef IP_UNICAST_IF
445 #define IP_UNICAST_IF 50
449 #ifndef IPV6_FLOWINFO
450 #define IPV6_FLOWINFO 11
454 #ifndef RLIMIT_RTTIME
455 #define RLIMIT_RTTIME 15
460 #define SCTP_RTOINFO 0
461 #define SCTP_ASSOCINFO 1
462 #define SCTP_INITMSG 2
463 #define SCTP_NODELAY 3 /* Get/set nodelay option. */
464 #define SCTP_AUTOCLOSE 4
465 #define SCTP_SET_PEER_PRIMARY_ADDR 5
466 #define SCTP_PRIMARY_ADDR 6
467 #define SCTP_ADAPTATION_LAYER 7
468 #define SCTP_DISABLE_FRAGMENTS 8
469 #define SCTP_PEER_ADDR_PARAMS 9
470 #define SCTP_DEFAULT_SEND_PARAM 10
471 #define SCTP_EVENTS 11
472 #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
473 #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
474 #define SCTP_STATUS 14
475 #define SCTP_GET_PEER_ADDR_INFO 15
476 #define SCTP_DELAYED_ACK_TIME 16
477 #define SCTP_CONTEXT 17
478 #define SCTP_FRAGMENT_INTERLEAVE 18
479 #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
480 #define SCTP_MAX_BURST 20 /* Set/Get max burst */
481 #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
482 #define SCTP_HMAC_IDENT 22
483 #define SCTP_AUTH_KEY 23
484 #define SCTP_AUTH_ACTIVE_KEY 24
485 #define SCTP_AUTH_DELETE_KEY 25
486 #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
487 #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
488 #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
489 #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
490 #define SCTP_AUTO_ASCONF 30
491 #define SCTP_PEER_ADDR_THLDS 31
494 #ifndef SCTP_SOCKOPT_BINDX_ADD
495 #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
496 #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
497 #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
498 #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
499 #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
500 #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
501 #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
502 #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
503 #define SCTP_GET_ASSOC_STATS 112 /* Read only */
507 #ifndef RXRPC_USER_CALL_ID
508 #define RXRPC_USER_CALL_ID 1 /* user call ID specifier */
509 #define RXRPC_ABORT 2 /* abort request / notification [terminal] */
510 #define RXRPC_ACK 3 /* [Server] RPC op final ACK received [terminal] */
511 #define RXRPC_NET_ERROR 5 /* network error received [terminal] */
512 #define RXRPC_BUSY 6 /* server busy received [terminal] */
513 #define RXRPC_LOCAL_ERROR 7 /* local error generated [terminal] */
514 #define RXRPC_NEW_CALL 8 /* [Server] new incoming call notification */
515 #define RXRPC_ACCEPT 9 /* [Server] accept request */
518 /* net/bluetooth/bluetooth.h */
520 #define BT_SECURITY 4
521 #define BT_DEFER_SETUP 7
522 #define BT_FLUSHABLE 8
524 #define BT_CHANNEL_POLICY 10
529 #define SOL_RFCOMM 18
532 /* net/bluetooth/hci.h */
534 #define HCI_DATA_DIR 1
536 #define HCI_TIME_STAMP 3
539 /* net/bluetooth/l2cap.h */
540 #ifndef L2CAP_OPTIONS
541 #define L2CAP_OPTIONS 0x01
542 #define L2CAP_LM 0x03
545 /* net/bluetooth/rfcomm.h */
547 #define RFCOMM_LM 0x03
550 /* net/iucv/af_iucv.h */
551 #ifndef SO_IPRMDATA_MSG
552 #define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
553 #define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
554 #define SO_MSGSIZE 0x0800 /* get maximum msgsize */
559 #include <bits/sockaddr.h>
560 #include <linux/types.h>
562 struct sockaddr_nfc
{
563 sa_family_t sa_family
;
570 /* linux/inotify.h */
571 #ifndef IN_EXCL_UNLINK
572 #define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */
576 #define MSG_COPY 040000
579 #ifndef MS_SNAP_STABLE
580 #define MS_SNAP_STABLE (1<<27)
584 #define MS_NOSEC (1<<28)
588 #define MS_BORN (1<<29)
592 #ifndef KVM_GET_REG_LIST
593 struct kvm_reg_list
{
594 __u64 n
; /* number of regs */
597 #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list)
600 #ifndef KVM_S390_UCAS_MAP
601 struct kvm_s390_ucas_mapping
{
606 #define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
609 #ifndef KVM_S390_UCAS_UNMAP
610 #define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
613 #ifndef KVM_S390_VCPU_FAULT
614 #define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
617 #ifndef KVM_XEN_HVM_CONFIG
618 struct kvm_xen_hvm_config
{
627 #define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config)
630 #ifndef KVM_PPC_GET_PVINFO
631 struct kvm_ppc_pvinfo
{
637 #define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
640 #ifndef KVM_SET_TSC_KHZ
641 #define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
644 #ifndef KVM_GET_TSC_KHZ
645 #define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
648 #ifndef KVM_ASSIGN_SET_INTX_MASK
649 #define KVM_ASSIGN_SET_INTX_MASK _IOW(KVMIO, 0xa4, struct kvm_assigned_pci_dev)
652 #ifndef KVM_GET_DEBUGREGS
653 struct kvm_debugregs
{
660 #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
661 #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
664 #ifndef KVM_ENABLE_CAP
665 struct kvm_enable_cap
{
672 #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
675 #ifndef KVM_GET_XSAVE
679 #define KVM_GET_XSAVE _IOR(KVMIO, 0xa4, struct kvm_xsave)
680 #define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave)
684 #define KVM_MAX_XCRS 16
694 struct kvm_xcr xcrs
[KVM_MAX_XCRS
];
697 #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
698 #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
701 #ifndef KVM_SIGNAL_MSI
709 #define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
712 #ifndef KVM_DIRTY_TLB
713 struct kvm_dirty_tlb
{
717 #define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb)
720 #ifndef KVM_GET_ONE_REG
725 #define KVM_GET_ONE_REG _IOW(KVMIO, 0xab, struct kvm_one_reg)
728 #ifndef KVM_SET_ONE_REG
729 #define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg)
732 #ifndef KVM_KVMCLOCK_CTRL
733 #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad)
736 #ifndef KVM_PPC_GET_SMMU_INFO
737 #define KVM_PPC_PAGE_SIZES_MAX_SZ 8
739 struct kvm_ppc_one_page_size
{
740 __u32 page_shift
; /* Page shift (or 0) */
741 __u32 pte_enc
; /* Encoding in the HPTE (>>12) */
744 struct kvm_ppc_one_seg_page_size
{
745 __u32 page_shift
; /* Base page shift of segment (or 0) */
746 __u32 slb_enc
; /* SLB encoding for BookS */
747 struct kvm_ppc_one_page_size enc
[KVM_PPC_PAGE_SIZES_MAX_SZ
];
750 struct kvm_ppc_smmu_info
{
754 struct kvm_ppc_one_seg_page_size sps
[KVM_PPC_PAGE_SIZES_MAX_SZ
];
756 #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
759 #ifndef KVM_PPC_ALLOCATE_HTAB
760 #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
763 #ifndef KVM_PPC_GET_HTAB_FD
764 struct kvm_get_htab_fd
{
769 #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd)
778 #define MRT_TABLE (MRT_BASE+9)
780 #ifndef MRT_ADD_MFC_PROXY
781 #define MRT_ADD_MFC_PROXY (MRT_BASE+10)
783 #ifndef MRT_DEL_MFC_PROXY
784 #define MRT_DEL_MFC_PROXY (MRT_BASE+11)
796 #ifndef UMOUNT_NOFOLLOW
797 #define UMOUNT_NOFOLLOW 8
802 #define ETH_P_CANFD 0x000D
805 #define ETH_P_CAIF 0x00F7
807 #ifndef ETH_P_802_3_MIN
808 #define ETH_P_802_3_MIN 0x0600
811 #define ETH_P_BATMAN 0x4305
813 #ifndef ETH_P_LINK_CTL
814 #define ETH_P_LINK_CTL 0x886c
817 #define ETH_P_8021AD 0x88A8
819 #ifndef ETH_P_802_EX1
820 #define ETH_P_802_EX1 0x88B5
823 #define ETH_P_8021AH 0x88E7
826 #define ETH_P_MVRP 0x88F5
829 #define ETH_P_PRP 0x88FB
832 #define ETH_P_QINQ1 0x9100
835 #define ETH_P_QINQ2 0x9200
838 #define ETH_P_QINQ3 0x9300
841 #endif /* _TRINITY_COMPAT_H */