1 #ifndef LINUX_USER_SOCKET_H
2 #define LINUX_USER_SOCKET_H
6 #ifndef TARGET_ARCH_HAS_SOCKET_TYPES
7 /** sock_type - Socket types - default values
10 * @SOCK_STREAM - stream (connection) socket
11 * @SOCK_DGRAM - datagram (conn.less) socket
12 * @SOCK_RAW - raw socket
13 * @SOCK_RDM - reliably-delivered message
14 * @SOCK_SEQPACKET - sequential packet socket
15 * @SOCK_DCCP - Datagram Congestion Control Protocol socket
16 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
17 * For writing rarp and other similar things on the user
19 * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
20 * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
23 TARGET_SOCK_STREAM
= 1,
24 TARGET_SOCK_DGRAM
= 2,
27 TARGET_SOCK_SEQPACKET
= 5,
29 TARGET_SOCK_PACKET
= 10,
32 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
33 #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
35 /* Flags for socket, socketpair, accept4 */
36 #define TARGET_SOCK_CLOEXEC TARGET_O_CLOEXEC
37 #ifndef TARGET_SOCK_NONBLOCK
38 #define TARGET_SOCK_NONBLOCK TARGET_O_NONBLOCK
40 #endif /* TARGET_ARCH_HAS_SOCKET_TYPES */