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

Side by Side Diff: fusl/src/network/socket.c

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/src/network/sockatmark.c ('k') | fusl/src/network/socketpair.c » ('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 #include <sys/socket.h>
2 #include <fcntl.h>
3 #include <errno.h>
4 #include "syscall.h"
5
6 int socket(int domain, int type, int protocol)
7 {
8 int s = socketcall(socket, domain, type, protocol, 0, 0, 0);
9 if (s<0 && (errno==EINVAL || errno==EPROTONOSUPPORT)
10 && (type&(SOCK_CLOEXEC|SOCK_NONBLOCK))) {
11 s = socketcall(socket, domain,
12 type & ~(SOCK_CLOEXEC|SOCK_NONBLOCK),
13 protocol, 0, 0, 0);
14 if (s < 0) return s;
15 if (type & SOCK_CLOEXEC)
16 __syscall(SYS_fcntl, s, F_SETFD, FD_CLOEXEC);
17 if (type & SOCK_NONBLOCK)
18 __syscall(SYS_fcntl, s, F_SETFL, O_NONBLOCK);
19 }
20 return s;
21 }
OLDNEW
« no previous file with comments | « fusl/src/network/sockatmark.c ('k') | fusl/src/network/socketpair.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698