Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7484bc31
Commit
7484bc31
authored
Aug 11, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/FileDescriptor: implement CreatePipe() on Windows
parent
5a495cc1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
FileDescriptor.cxx
src/system/FileDescriptor.cxx
+6
-0
FileDescriptor.hxx
src/system/FileDescriptor.hxx
+2
-0
No files found.
src/system/FileDescriptor.cxx
View file @
7484bc31
...
...
@@ -99,6 +99,8 @@ FileDescriptor::OpenNonBlocking(const char *pathname) noexcept
return
Open
(
pathname
,
O_RDWR
|
O_NONBLOCK
);
}
#endif
bool
FileDescriptor
::
CreatePipe
(
FileDescriptor
&
r
,
FileDescriptor
&
w
)
noexcept
{
...
...
@@ -107,6 +109,8 @@ FileDescriptor::CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept
#ifdef HAVE_PIPE2
const
int
flags
=
O_CLOEXEC
;
const
int
result
=
pipe2
(
fds
,
flags
);
#elif defined(_WIN32)
const
int
result
=
_pipe
(
fds
,
512
,
_O_BINARY
);
#else
const
int
result
=
pipe
(
fds
);
#endif
...
...
@@ -119,6 +123,8 @@ FileDescriptor::CreatePipe(FileDescriptor &r, FileDescriptor &w) noexcept
return
true
;
}
#ifndef _WIN32
void
FileDescriptor
::
SetNonBlocking
()
noexcept
{
...
...
src/system/FileDescriptor.hxx
View file @
7484bc31
...
...
@@ -110,9 +110,11 @@ public:
#ifndef WIN32
bool
OpenNonBlocking
(
const
char
*
pathname
)
noexcept
;
#endif
static
bool
CreatePipe
(
FileDescriptor
&
r
,
FileDescriptor
&
w
)
noexcept
;
#ifndef _WIN32
/**
* Enable non-blocking mode on this file descriptor.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment