minix/lib/libminlib/dupfrom.c
David van Moolenbroek dba2d1f8b4 VFS: add dupfrom(2) call
This call copies a file descriptor from a remote process into the
calling process. The call is for the VND driver only, and in the
future, ACLs will prevent any other process from using this call.

Change-Id: Ib16fdd1f1a12cb38a70d7e441dad91bc86898f6d
2014-03-01 09:04:54 +01:00

15 lines
219 B
C

#include <lib.h>
#include <string.h>
int
dupfrom(endpoint_t endpt, int fd)
{
message m;
memset(&m, 0, sizeof(m));
m.VFS_DUPFROM_ENDPT = endpt;
m.VFS_DUPFROM_FD = fd;
return _syscall(VFS_PROC_NR, DUPFROM, &m);
}