Implement the basic system calls that operate on pathnames.
authored <ed@FreeBSD.org>
Fri, 24 Jul 2015 07:46:02 +0000 (07:46 +0000)
committered <ed@FreeBSD.org>
Fri, 24 Jul 2015 07:46:02 +0000 (07:46 +0000)
commitdf41ed0ac80b22c41e5194a9baa82d4f5f96acd1
tree6eb7de3f2b482b12698df26ca2191dff12678987
parent94c7edbe12b1b8eee1ef3b11a942424f2f5512a0
Implement the basic system calls that operate on pathnames.

Summary:
Unlike FreeBSD, CloudABI does not use null terminated strings for its
pathnames. Introduce a function called copyin_path() that can be used by
all of the filesystem system calls that use pathnames. This change
already implements the system calls that don't depend on any additional
functionality (e.g., conversion of struct stat).

Also implement the socket system calls that operate on pathnames, namely
the ones used by the C library functions bindat() and connectat(). These
don't receive a 'struct sockaddr_un', but just the pathname, meaning
they could be implemented in such a way that they don't depend on the
size of sun_path. For now, just use the existing interfaces.

Add a missing #include to cloudabi_syscalldefs.h to get this code to
build, as one of its macros depends on UINT64_C().

Test Plan:
These implementations have already been tested in the CloudABI branch on
GitHub. They pass all of the tests.

Reviewers: kib, pjd

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D3097
sys/compat/cloudabi/cloudabi_file.c
sys/compat/cloudabi/cloudabi_sock.c
sys/compat/cloudabi/cloudabi_syscalldefs.h