mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
parent
8f372b469a
commit
bb33c9f3cf
@ -76,6 +76,7 @@ namespace Libc {
|
||||
virtual int connect(File_descriptor *,
|
||||
const struct ::sockaddr *addr,
|
||||
socklen_t addrlen);
|
||||
virtual File_descriptor *dup(File_descriptor*);
|
||||
virtual int dup2(File_descriptor *, File_descriptor *new_fd);
|
||||
virtual int execve(char const *filename, char *const argv[],
|
||||
char *const envp[]);
|
||||
|
@ -320,6 +320,20 @@ extern "C" int _connect(int libc_fd, const struct sockaddr *addr,
|
||||
}
|
||||
|
||||
|
||||
extern "C" int _dup(int libc_fd)
|
||||
{
|
||||
File_descriptor *fd = libc_fd_to_fd(libc_fd, "dup");
|
||||
File_descriptor *ret_fd = (fd && fd->plugin) ? fd->plugin->dup(fd) : 0;
|
||||
return ret_fd ? ret_fd->libc_fd : INVALID_FD;
|
||||
}
|
||||
|
||||
|
||||
extern "C" int dup(int libc_fd)
|
||||
{
|
||||
return _dup(libc_fd);
|
||||
}
|
||||
|
||||
|
||||
extern "C" int _dup2(int libc_fd, int new_libc_fd)
|
||||
{
|
||||
File_descriptor *fd = libc_fd_to_fd(libc_fd, "dup2");
|
||||
|
@ -144,6 +144,7 @@ ret_type Plugin::name args \
|
||||
/*
|
||||
* Functions returning a 'File_descriptor'
|
||||
*/
|
||||
DUMMY(File_descriptor *, 0, dup, (File_descriptor *));
|
||||
DUMMY(File_descriptor *, 0, open, (const char *, int));
|
||||
DUMMY(File_descriptor *, 0, socket, (int, int, int));
|
||||
DUMMY(File_descriptor *, 0, accept, (File_descriptor *, struct sockaddr *, socklen_t *));
|
||||
|
Loading…
Reference in New Issue
Block a user