MCPcopy Create free account
hub / github.com/apache/arrow / SetPipeFileDescriptorNonBlocking

Function SetPipeFileDescriptorNonBlocking

cpp/src/arrow/util/io_util.cc:1215–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213}
1214
1215Status SetPipeFileDescriptorNonBlocking(int fd) {
1216#if defined(_WIN32)
1217 const auto handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
1218 DWORD mode = PIPE_NOWAIT;
1219 if (!SetNamedPipeHandleState(handle, &mode, nullptr, nullptr)) {
1220 return IOErrorFromWinError(GetLastError(), "Error making pipe non-blocking");
1221 }
1222#else
1223 int flags = fcntl(fd, F_GETFL);
1224 if (flags == -1 || fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
1225 return IOErrorFromErrno(errno, "Error making pipe non-blocking");
1226 }
1227#endif
1228 return Status::OK();
1229}
1230
1231namespace {
1232

Callers 2

TEST_FFunction · 0.85
InitMethod · 0.85

Calls 3

IOErrorFromWinErrorFunction · 0.85
IOErrorFromErrnoFunction · 0.85
OKFunction · 0.50

Tested by 1

TEST_FFunction · 0.68