MCPcopy Create free account
hub / github.com/apache/brpc / make_blocking

Function make_blocking

src/butil/fd_utility.cpp:50–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int make_blocking(int fd) {
51 const int flags = fcntl(fd, F_GETFL, 0);
52 if (flags < 0) {
53 return flags;
54 }
55 if (flags & O_NONBLOCK) {
56 return fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
57 }
58 return 0;
59}
60
61int make_close_on_exec(int fd) {
62 return fcntl(fd, F_SETFD, FD_CLOEXEC);

Callers 3

fd.cppFile · 0.85
bthread_timed_connectFunction · 0.85
pthread_timed_connectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected