io/FileDescriptor: add method SetBinaryMode()
This commit is contained in:
parent
eff50b263a
commit
d61341c0e3
|
@ -172,7 +172,15 @@ FileDescriptor::CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
|
||||
void
|
||||
FileDescriptor::SetBinaryMode() noexcept
|
||||
{
|
||||
_setmode(fd, _O_BINARY);
|
||||
}
|
||||
|
||||
#else // !_WIN32
|
||||
|
||||
bool
|
||||
FileDescriptor::CreatePipeNonBlock(FileDescriptor &r,
|
||||
|
|
|
@ -148,10 +148,13 @@ public:
|
|||
#ifdef _WIN32
|
||||
void EnableCloseOnExec() noexcept {}
|
||||
void DisableCloseOnExec() noexcept {}
|
||||
void SetBinaryMode() noexcept;
|
||||
#else
|
||||
static bool CreatePipeNonBlock(FileDescriptor &r,
|
||||
FileDescriptor &w) noexcept;
|
||||
|
||||
void SetBinaryMode() noexcept {}
|
||||
|
||||
/**
|
||||
* Enable non-blocking mode on this file descriptor.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue