Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: fusl/include/sys/socket.h

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/include/sys/signalfd.h ('k') | fusl/include/sys/soundcard.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef _SYS_SOCKET_H
2 #define _SYS_SOCKET_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #include <features.h>
8
9 #define __NEED_socklen_t
10 #define __NEED_sa_family_t
11 #define __NEED_size_t
12 #define __NEED_ssize_t
13 #define __NEED_uid_t
14 #define __NEED_pid_t
15 #define __NEED_gid_t
16 #define __NEED_struct_iovec
17
18 #include <bits/alltypes.h>
19
20 #include <bits/socket.h>
21
22 #ifdef _GNU_SOURCE
23 struct ucred
24 {
25 pid_t pid;
26 uid_t uid;
27 gid_t gid;
28 };
29
30 struct mmsghdr
31 {
32 struct msghdr msg_hdr;
33 unsigned int msg_len;
34 };
35
36 struct timespec;
37
38 int sendmmsg (int, struct mmsghdr *, unsigned int, unsigned int);
39 int recvmmsg (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *);
40 #endif
41
42 struct linger
43 {
44 int l_onoff;
45 int l_linger;
46 };
47
48 #define SHUT_RD 0
49 #define SHUT_WR 1
50 #define SHUT_RDWR 2
51
52 #ifndef SOCK_STREAM
53 #define SOCK_STREAM 1
54 #define SOCK_DGRAM 2
55 #endif
56
57 #define SOCK_RAW 3
58 #define SOCK_RDM 4
59 #define SOCK_SEQPACKET 5
60 #define SOCK_DCCP 6
61 #define SOCK_PACKET 10
62
63 #ifndef SOCK_CLOEXEC
64 #define SOCK_CLOEXEC 02000000
65 #define SOCK_NONBLOCK 04000
66 #endif
67
68 #define PF_UNSPEC 0
69 #define PF_LOCAL 1
70 #define PF_UNIX PF_LOCAL
71 #define PF_FILE PF_LOCAL
72 #define PF_INET 2
73 #define PF_AX25 3
74 #define PF_IPX 4
75 #define PF_APPLETALK 5
76 #define PF_NETROM 6
77 #define PF_BRIDGE 7
78 #define PF_ATMPVC 8
79 #define PF_X25 9
80 #define PF_INET6 10
81 #define PF_ROSE 11
82 #define PF_DECnet 12
83 #define PF_NETBEUI 13
84 #define PF_SECURITY 14
85 #define PF_KEY 15
86 #define PF_NETLINK 16
87 #define PF_ROUTE PF_NETLINK
88 #define PF_PACKET 17
89 #define PF_ASH 18
90 #define PF_ECONET 19
91 #define PF_ATMSVC 20
92 #define PF_RDS 21
93 #define PF_SNA 22
94 #define PF_IRDA 23
95 #define PF_PPPOX 24
96 #define PF_WANPIPE 25
97 #define PF_LLC 26
98 #define PF_IB 27
99 #define PF_CAN 29
100 #define PF_TIPC 30
101 #define PF_BLUETOOTH 31
102 #define PF_IUCV 32
103 #define PF_RXRPC 33
104 #define PF_ISDN 34
105 #define PF_PHONET 35
106 #define PF_IEEE802154 36
107 #define PF_CAIF 37
108 #define PF_ALG 38
109 #define PF_NFC 39
110 #define PF_VSOCK 40
111 #define PF_MAX 41
112
113 #define AF_UNSPEC PF_UNSPEC
114 #define AF_LOCAL PF_LOCAL
115 #define AF_UNIX AF_LOCAL
116 #define AF_FILE AF_LOCAL
117 #define AF_INET PF_INET
118 #define AF_AX25 PF_AX25
119 #define AF_IPX PF_IPX
120 #define AF_APPLETALK PF_APPLETALK
121 #define AF_NETROM PF_NETROM
122 #define AF_BRIDGE PF_BRIDGE
123 #define AF_ATMPVC PF_ATMPVC
124 #define AF_X25 PF_X25
125 #define AF_INET6 PF_INET6
126 #define AF_ROSE PF_ROSE
127 #define AF_DECnet PF_DECnet
128 #define AF_NETBEUI PF_NETBEUI
129 #define AF_SECURITY PF_SECURITY
130 #define AF_KEY PF_KEY
131 #define AF_NETLINK PF_NETLINK
132 #define AF_ROUTE PF_ROUTE
133 #define AF_PACKET PF_PACKET
134 #define AF_ASH PF_ASH
135 #define AF_ECONET PF_ECONET
136 #define AF_ATMSVC PF_ATMSVC
137 #define AF_RDS PF_RDS
138 #define AF_SNA PF_SNA
139 #define AF_IRDA PF_IRDA
140 #define AF_PPPOX PF_PPPOX
141 #define AF_WANPIPE PF_WANPIPE
142 #define AF_LLC PF_LLC
143 #define AF_IB PF_IB
144 #define AF_CAN PF_CAN
145 #define AF_TIPC PF_TIPC
146 #define AF_BLUETOOTH PF_BLUETOOTH
147 #define AF_IUCV PF_IUCV
148 #define AF_RXRPC PF_RXRPC
149 #define AF_ISDN PF_ISDN
150 #define AF_PHONET PF_PHONET
151 #define AF_IEEE802154 PF_IEEE802154
152 #define AF_CAIF PF_CAIF
153 #define AF_ALG PF_ALG
154 #define AF_NFC PF_NFC
155 #define AF_VSOCK PF_VSOCK
156 #define AF_MAX PF_MAX
157
158 #ifndef SO_DEBUG
159 #define SO_DEBUG 1
160 #define SO_REUSEADDR 2
161 #define SO_TYPE 3
162 #define SO_ERROR 4
163 #define SO_DONTROUTE 5
164 #define SO_BROADCAST 6
165 #define SO_SNDBUF 7
166 #define SO_RCVBUF 8
167 #define SO_KEEPALIVE 9
168 #define SO_OOBINLINE 10
169 #define SO_NO_CHECK 11
170 #define SO_PRIORITY 12
171 #define SO_LINGER 13
172 #define SO_BSDCOMPAT 14
173 #define SO_REUSEPORT 15
174 #define SO_PASSCRED 16
175 #define SO_PEERCRED 17
176 #define SO_RCVLOWAT 18
177 #define SO_SNDLOWAT 19
178 #define SO_RCVTIMEO 20
179 #define SO_SNDTIMEO 21
180 #define SO_ACCEPTCONN 30
181 #define SO_SNDBUFFORCE 32
182 #define SO_RCVBUFFORCE 33
183 #define SO_PROTOCOL 38
184 #define SO_DOMAIN 39
185 #endif
186
187 #define SO_SECURITY_AUTHENTICATION 22
188 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
189 #define SO_SECURITY_ENCRYPTION_NETWORK 24
190
191 #define SO_BINDTODEVICE 25
192
193 #define SO_ATTACH_FILTER 26
194 #define SO_DETACH_FILTER 27
195 #define SO_GET_FILTER SO_ATTACH_FILTER
196
197 #define SO_PEERNAME 28
198 #define SO_TIMESTAMP 29
199 #define SCM_TIMESTAMP SO_TIMESTAMP
200
201 #define SO_PEERSEC 31
202 #define SO_PASSSEC 34
203 #define SO_TIMESTAMPNS 35
204 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS
205 #define SO_MARK 36
206 #define SO_TIMESTAMPING 37
207 #define SCM_TIMESTAMPING SO_TIMESTAMPING
208 #define SO_RXQ_OVFL 40
209 #define SO_WIFI_STATUS 41
210 #define SCM_WIFI_STATUS SO_WIFI_STATUS
211 #define SO_PEEK_OFF 42
212 #define SO_NOFCS 43
213 #define SO_LOCK_FILTER 44
214 #define SO_SELECT_ERR_QUEUE 45
215 #define SO_BUSY_POLL 46
216 #define SO_MAX_PACING_RATE 47
217 #define SO_BPF_EXTENSIONS 48
218 #define SO_INCOMING_CPU 49
219 #define SO_ATTACH_BPF 50
220 #define SO_DETACH_BPF SO_DETACH_FILTER
221
222
223 #ifndef SOL_SOCKET
224 #define SOL_SOCKET 1
225 #endif
226
227 #define SOL_IP 0
228 #define SOL_IPV6 41
229 #define SOL_ICMPV6 58
230
231 #define SOL_RAW 255
232 #define SOL_DECNET 261
233 #define SOL_X25 262
234 #define SOL_PACKET 263
235 #define SOL_ATM 264
236 #define SOL_AAL 265
237 #define SOL_IRDA 266
238
239 #define SOMAXCONN 128
240
241 #define MSG_OOB 0x0001
242 #define MSG_PEEK 0x0002
243 #define MSG_DONTROUTE 0x0004
244 #define MSG_CTRUNC 0x0008
245 #define MSG_PROXY 0x0010
246 #define MSG_TRUNC 0x0020
247 #define MSG_DONTWAIT 0x0040
248 #define MSG_EOR 0x0080
249 #define MSG_WAITALL 0x0100
250 #define MSG_FIN 0x0200
251 #define MSG_SYN 0x0400
252 #define MSG_CONFIRM 0x0800
253 #define MSG_RST 0x1000
254 #define MSG_ERRQUEUE 0x2000
255 #define MSG_NOSIGNAL 0x4000
256 #define MSG_MORE 0x8000
257 #define MSG_WAITFORONE 0x10000
258 #define MSG_CMSG_CLOEXEC 0x40000000
259
260 #define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof (long) - 1))
261 #define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
262 #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_con trollen)
263
264 #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
265 #define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (s truct cmsghdr *)0 : \
266 (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (stru ct cmsghdr *)0 : \
267 ((struct cmsghdr *)__CMSG_NEXT(cmsg))))
268 #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct c msghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
269
270 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size _t) - 1))
271 #define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)) )
272 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
273
274 #define SCM_RIGHTS 0x01
275 #define SCM_CREDENTIALS 0x02
276
277 struct sockaddr
278 {
279 sa_family_t sa_family;
280 char sa_data[14];
281 };
282
283 struct sockaddr_storage
284 {
285 sa_family_t ss_family;
286 unsigned long __ss_align;
287 char __ss_padding[128-2*sizeof(unsigned long)];
288 };
289
290 int socket (int, int, int);
291 int socketpair (int, int, int, int [2]);
292
293 int shutdown (int, int);
294
295 int bind (int, const struct sockaddr *, socklen_t);
296 int connect (int, const struct sockaddr *, socklen_t);
297 int listen (int, int);
298 int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);
299 int accept4(int, struct sockaddr *__restrict, socklen_t *__restrict, int);
300
301 int getsockname (int, struct sockaddr *__restrict, socklen_t *__restrict);
302 int getpeername (int, struct sockaddr *__restrict, socklen_t *__restrict);
303
304 ssize_t send (int, const void *, size_t, int);
305 ssize_t recv (int, void *, size_t, int);
306 ssize_t sendto (int, const void *, size_t, int, const struct sockaddr *, socklen _t);
307 ssize_t recvfrom (int, void *__restrict, size_t, int, struct sockaddr *__restric t, socklen_t *__restrict);
308 ssize_t sendmsg (int, const struct msghdr *, int);
309 ssize_t recvmsg (int, struct msghdr *, int);
310
311 int getsockopt (int, int, int, void *__restrict, socklen_t *__restrict);
312 int setsockopt (int, int, int, const void *, socklen_t);
313
314 int sockatmark (int);
315
316 #ifdef __cplusplus
317 }
318 #endif
319 #endif
OLDNEW
« no previous file with comments | « fusl/include/sys/signalfd.h ('k') | fusl/include/sys/soundcard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698