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:
David van Moolenbroek
2013-09-18 13:55:15 +02:00
committed by Lionel Sambuc
parent 1f8286c377
commit dba2d1f8b4
10 changed files with 85 additions and 6 deletions

View File

@@ -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
View 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);
}