diff --git a/libports/src/lib/libc_lock_pipe/plugin.cc b/libports/src/lib/libc_lock_pipe/plugin.cc index 34f1527f8..93bbe351e 100644 --- a/libports/src/lib/libc_lock_pipe/plugin.cc +++ b/libports/src/lib/libc_lock_pipe/plugin.cc @@ -17,6 +17,7 @@ #include /* libc includes */ +#include #include /* libc plugin interface */ @@ -95,6 +96,7 @@ namespace { struct timeval *timeout); int close(Libc::File_descriptor *pipefdo); + int fcntl(Libc::File_descriptor *pipefdo, int cmd, long arg); int pipe(Libc::File_descriptor *pipefdo[2]); ssize_t read(Libc::File_descriptor *pipefdo, void *buf, ::size_t count); int select(int nfds, fd_set *readfds, fd_set *writefds, @@ -227,6 +229,19 @@ namespace { } + int Plugin::fcntl(Libc::File_descriptor *pipefdo, int cmd, long arg) + { + switch (cmd) { + case F_GETFL: + if (is_write_end(pipefdo)) + return O_WRONLY; + else + return O_RDONLY; + default: PERR("fcntl(): command %d not supported", cmd); return -1; + } + } + + int Plugin::pipe(Libc::File_descriptor *pipefdo[2]) { pipefdo[0] = Libc::file_descriptor_allocator()->alloc(this,