
This patch prepares for moving of the creation of socket files on the file system from the libc bind(2) stub into the UDS service. This change is necessary for the socket type agnostic libc implementation. The change is not yet activated - the code that is not yet used is enclosed in "#if NOT_YET" blocks. The activation needs to be atomic with UDS's switch to libsockdriver; otherwise, user applications may break. As part of the change, various UDS bind(2) semantics are changed to match the POSIX standard and other operating systems. In implementation terms, the service-only VFS API checkperms(2) is renamed to socketpath(2), and extended with a new subcall which creates a new socket file. An extension to test56 checks the new bind(2) semantics of UDS, although most new tests are still disabled until activation as well. Finally, as further preparation for a more structural redesign of the UDS service, also return the <device,inode> number pair for the created or checked file name, and make returning the canonized path name optional. Change-Id: I892d04b3301d4b911bdc571632ddde65fb747a8a
83 lines
3.4 KiB
C
83 lines
3.4 KiB
C
/* This file contains the table used to map system call numbers onto the
|
|
* routines that perform them.
|
|
*/
|
|
|
|
#define _TABLE
|
|
|
|
#include "fs.h"
|
|
#include <minix/callnr.h>
|
|
#include <minix/com.h>
|
|
#include "file.h"
|
|
#include "lock.h"
|
|
#include "vnode.h"
|
|
#include "vmnt.h"
|
|
|
|
#define CALL(n) [((n) - VFS_BASE)]
|
|
|
|
int (* const call_vec[NR_VFS_CALLS])(void) = {
|
|
CALL(VFS_READ) = do_read, /* read(2) */
|
|
CALL(VFS_WRITE) = do_write, /* write(2) */
|
|
CALL(VFS_LSEEK) = do_lseek, /* lseek(2) */
|
|
CALL(VFS_OPEN) = do_open, /* open(2) */
|
|
CALL(VFS_CREAT) = do_creat, /* creat(2) */
|
|
CALL(VFS_CLOSE) = do_close, /* close(2) */
|
|
CALL(VFS_LINK) = do_link, /* link(2) */
|
|
CALL(VFS_UNLINK) = do_unlink, /* unlink(2) */
|
|
CALL(VFS_CHDIR) = do_chdir, /* chdir(2) */
|
|
CALL(VFS_MKDIR) = do_mkdir, /* mkdir(2) */
|
|
CALL(VFS_MKNOD) = do_mknod, /* mknod(2) */
|
|
CALL(VFS_CHMOD) = do_chmod, /* chmod(2) */
|
|
CALL(VFS_CHOWN) = do_chown, /* chown(2) */
|
|
CALL(VFS_MOUNT) = do_mount, /* mount(2) */
|
|
CALL(VFS_UMOUNT) = do_umount, /* umount(2) */
|
|
CALL(VFS_ACCESS) = do_access, /* access(2) */
|
|
CALL(VFS_SYNC) = do_sync, /* sync(2) */
|
|
CALL(VFS_RENAME) = do_rename, /* rename(2) */
|
|
CALL(VFS_RMDIR) = do_unlink, /* rmdir(2) */
|
|
CALL(VFS_SYMLINK) = do_slink, /* symlink(2) */
|
|
CALL(VFS_READLINK) = do_rdlink, /* readlink(2) */
|
|
CALL(VFS_STAT) = do_stat, /* stat(2) */
|
|
CALL(VFS_FSTAT) = do_fstat, /* fstat(2) */
|
|
CALL(VFS_LSTAT) = do_lstat, /* lstat(2) */
|
|
CALL(VFS_IOCTL) = do_ioctl, /* ioctl(2) */
|
|
CALL(VFS_FCNTL) = do_fcntl, /* fcntl(2) */
|
|
CALL(VFS_PIPE2) = do_pipe2, /* pipe2(2) */
|
|
CALL(VFS_UMASK) = do_umask, /* umask(2) */
|
|
CALL(VFS_CHROOT) = do_chroot, /* chroot(2) */
|
|
CALL(VFS_GETDENTS) = do_getdents, /* getdents(2) */
|
|
CALL(VFS_SELECT) = do_select, /* select(2) */
|
|
CALL(VFS_FCHDIR) = do_fchdir, /* fchdir(2) */
|
|
CALL(VFS_FSYNC) = do_fsync, /* fsync(2) */
|
|
CALL(VFS_TRUNCATE) = do_truncate, /* truncate(2) */
|
|
CALL(VFS_FTRUNCATE) = do_ftruncate, /* ftruncate(2) */
|
|
CALL(VFS_FCHMOD) = do_chmod, /* fchmod(2) */
|
|
CALL(VFS_FCHOWN) = do_chown, /* fchown(2) */
|
|
CALL(VFS_UTIMENS) = do_utimens, /* [fl]utime[n]s(2) */
|
|
CALL(VFS_VMCALL) = do_vm_call,
|
|
CALL(VFS_GETVFSSTAT) = do_getvfsstat, /* getvfsstat(2) */
|
|
CALL(VFS_STATVFS1) = do_statvfs, /* statvfs(2) */
|
|
CALL(VFS_FSTATVFS1) = do_fstatvfs, /* fstatvfs(2) */
|
|
CALL(VFS_GETRUSAGE) = do_getrusage, /* (obsolete) */
|
|
CALL(VFS_SVRCTL) = do_svrctl, /* svrctl(2) */
|
|
CALL(VFS_GCOV_FLUSH) = do_gcov_flush, /* gcov_flush(2) */
|
|
CALL(VFS_MAPDRIVER) = do_mapdriver, /* mapdriver(2) */
|
|
CALL(VFS_COPYFD) = do_copyfd, /* copyfd(2) */
|
|
CALL(VFS_SOCKETPATH) = do_socketpath, /* socketpath(2) */
|
|
CALL(VFS_GETSYSINFO) = do_getsysinfo, /* getsysinfo(2) */
|
|
CALL(VFS_SOCKET) = do_socket, /* socket(2) */
|
|
CALL(VFS_SOCKETPAIR) = do_socketpair, /* socketpair(2) */
|
|
CALL(VFS_BIND) = do_bind, /* bind(2) */
|
|
CALL(VFS_CONNECT) = do_connect, /* connect(2) */
|
|
CALL(VFS_LISTEN) = do_listen, /* listen(2) */
|
|
CALL(VFS_ACCEPT) = do_accept, /* accept(2) */
|
|
CALL(VFS_SENDTO) = do_sendto, /* sendto(2) */
|
|
CALL(VFS_SENDMSG) = do_sockmsg, /* sendmsg(2) */
|
|
CALL(VFS_RECVFROM) = do_recvfrom, /* recvfrom(2) */
|
|
CALL(VFS_RECVMSG) = do_sockmsg, /* recvmsg(2) */
|
|
CALL(VFS_SETSOCKOPT) = do_setsockopt, /* setsockopt(2) */
|
|
CALL(VFS_GETSOCKOPT) = do_getsockopt, /* getsockopt(2) */
|
|
CALL(VFS_GETSOCKNAME) = do_getsockname, /* getsockname(2) */
|
|
CALL(VFS_GETPEERNAME) = do_getpeername, /* getpeername(2) */
|
|
CALL(VFS_SHUTDOWN) = do_shutdown, /* shutdown(2) */
|
|
};
|