summaryrefslogtreecommitdiffstats
path: root/sys/sys/syscallsubr.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2015-07-09 16:07:01 +0000
committered <ed@FreeBSD.org>2015-07-09 16:07:01 +0000
commit8cbb0879ba9efc6e4b370f1241205968342b2a05 (patch)
tree9fafa92547e60631150e31b687bcd74d918db141 /sys/sys/syscallsubr.h
parentd4c928e3e77b95956aa4d990feb5861421ec3db4 (diff)
downloadFreeBSD-src-8cbb0879ba9efc6e4b370f1241205968342b2a05.zip
FreeBSD-src-8cbb0879ba9efc6e4b370f1241205968342b2a05.tar.gz
Add implementations for some of the CloudABI file descriptor system calls.
All of the CloudABI system calls that operate on file descriptors of an arbitrary type are prefixed with fd_. This change adds wrappers for most of these system calls around their FreeBSD equivalents. The dup2() system call present on CloudABI deviates from POSIX, in the sense that it can only be used to replace existing file descriptor. It cannot be used to create new ones. The reason for this is that this is inherently thread-unsafe. Furthermore, there is no need on CloudABI to use fixed file descriptor numbers. File descriptors 0, 1 and 2 have no special meaning. This change exposes the kern_dup() through <sys/syscallsubr.h> and puts the FDDUP_* flags in <sys/filedesc.h>. It then adds a new flag, FDDUP_MUSTREPLACE to force that file descriptors are replaced -- not allocated. Differential Revision: https://reviews.freebsd.org/D3035 Reviewed by: mjg
Diffstat (limited to 'sys/sys/syscallsubr.h')
-rw-r--r--sys/sys/syscallsubr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h
index 4ff111e..625f834 100644
--- a/sys/sys/syscallsubr.h
+++ b/sys/sys/syscallsubr.h
@@ -85,6 +85,7 @@ int kern_clock_settime(struct thread *td, clockid_t clock_id,
int kern_close(struct thread *td, int fd);
int kern_connectat(struct thread *td, int dirfd, int fd,
struct sockaddr *sa);
+int kern_dup(struct thread *td, int flags, int old, int new);
int kern_execve(struct thread *td, struct image_args *args,
struct mac *mac_p);
int kern_fchmodat(struct thread *td, int fd, char *path,
OpenPOWER on IntegriCloud