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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
void
|
||||||
|
FileDescriptor::SetBinaryMode() noexcept
|
||||||
|
{
|
||||||
|
_setmode(fd, _O_BINARY);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else // !_WIN32
|
||||||
|
|
||||||
bool
|
bool
|
||||||
FileDescriptor::CreatePipeNonBlock(FileDescriptor &r,
|
FileDescriptor::CreatePipeNonBlock(FileDescriptor &r,
|
||||||
|
@ -148,10 +148,13 @@ public:
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
void EnableCloseOnExec() noexcept {}
|
void EnableCloseOnExec() noexcept {}
|
||||||
void DisableCloseOnExec() noexcept {}
|
void DisableCloseOnExec() noexcept {}
|
||||||
|
void SetBinaryMode() noexcept;
|
||||||
#else
|
#else
|
||||||
static bool CreatePipeNonBlock(FileDescriptor &r,
|
static bool CreatePipeNonBlock(FileDescriptor &r,
|
||||||
FileDescriptor &w) noexcept;
|
FileDescriptor &w) noexcept;
|
||||||
|
|
||||||
|
void SetBinaryMode() noexcept {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable non-blocking mode on this file descriptor.
|
* Enable non-blocking mode on this file descriptor.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user