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
This commit is contained in:
@@ -30,9 +30,10 @@ SRCS+= servxcheck.c
|
||||
# queryparam
|
||||
SRCS+= paramvalue.c
|
||||
|
||||
# Minix servers/drivers syscall.
|
||||
SRCS+= getngid.c getnpid.c getnprocnr.c getnucred.c getnuid.c getprocnr.c \
|
||||
mapdriver.c vm_memctl.c vm_set_priv.c vm_query_exit.c vm_update.c
|
||||
# Minix servers/drivers syscall. FIXME: these should be moved into libsys.
|
||||
SRCS+= dupfrom.c getngid.c getnpid.c getnprocnr.c getnucred.c getnuid.c \
|
||||
getprocnr.c mapdriver.c vm_memctl.c vm_set_priv.c vm_query_exit.c \
|
||||
vm_update.c
|
||||
|
||||
SRCS+= oneC_sum.c
|
||||
|
||||
|
||||
14
lib/libminlib/dupfrom.c
Normal file
14
lib/libminlib/dupfrom.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user