mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-29 15:29:50 +00:00
parent
3cb7476cb7
commit
1fdee7a2cc
@ -17,6 +17,7 @@
|
|||||||
#include <util/misc_math.h>
|
#include <util/misc_math.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/* libc plugin interface */
|
/* libc plugin interface */
|
||||||
@ -95,6 +96,7 @@ namespace {
|
|||||||
struct timeval *timeout);
|
struct timeval *timeout);
|
||||||
|
|
||||||
int close(Libc::File_descriptor *pipefdo);
|
int close(Libc::File_descriptor *pipefdo);
|
||||||
|
int fcntl(Libc::File_descriptor *pipefdo, int cmd, long arg);
|
||||||
int pipe(Libc::File_descriptor *pipefdo[2]);
|
int pipe(Libc::File_descriptor *pipefdo[2]);
|
||||||
ssize_t read(Libc::File_descriptor *pipefdo, void *buf, ::size_t count);
|
ssize_t read(Libc::File_descriptor *pipefdo, void *buf, ::size_t count);
|
||||||
int select(int nfds, fd_set *readfds, fd_set *writefds,
|
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])
|
int Plugin::pipe(Libc::File_descriptor *pipefdo[2])
|
||||||
{
|
{
|
||||||
pipefdo[0] = Libc::file_descriptor_allocator()->alloc(this,
|
pipefdo[0] = Libc::file_descriptor_allocator()->alloc(this,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user