MCPcopy Create free account
hub / github.com/3rdparty/libprocess / is_async

Function is_async

src/windows/io.cpp:110–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108
109
110Try<bool> is_async(int_fd fd)
111{
112 if (fd.is_overlapped()) {
113 return fd.get_iocp() != nullptr;
114 }
115
116 // For non-overlapped fds, we only accept disk files, since they are "fast"
117 // devices, similar to how Linux `O_NONBLOCK` no-ops on "fast" file types
118 // like regular files.
119 if (fd.type() == os::WindowsFD::Type::SOCKET) {
120 return false;
121 }
122
123 DWORD type = ::GetFileType(fd);
124 WindowsError error;
125 if (type == FILE_TYPE_UNKNOWN && error.code != NO_ERROR) {
126 return error;
127 }
128
129 return type == FILE_TYPE_DISK;
130}
131
132} // namespace internal {
133} // namespace io {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected