diff options
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/compat/unix/syscall.h | 4 | ||||
-rw-r--r-- | src/sys/include/sys/mount.h | 31 | ||||
-rw-r--r-- | src/sys/include/sys/syscall.h | 1 |
3 files changed, 27 insertions, 9 deletions
diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h index ab464c4..5339d47 100644 --- a/src/sys/include/compat/unix/syscall.h +++ b/src/sys/include/compat/unix/syscall.h @@ -32,6 +32,7 @@ #include <sys/proc.h> #include <sys/param.h> +#include <sys/mount.h> #include <sys/syscall.h> /* @@ -61,7 +62,8 @@ scret_t(*g_unix_sctab[])(struct syscall_args *) = { [SYS_write] = sys_write, [SYS_cross] = sys_cross, [SYS_query] = sys_query, - [SYS_spawn] = sys_spawn + [SYS_spawn] = sys_spawn, + [SYS_mount] = sys_mount }; #endif /* !_NEED_UNIX_SCTAB */ diff --git a/src/sys/include/sys/mount.h b/src/sys/include/sys/mount.h index 4e39279..6d041ee 100644 --- a/src/sys/include/sys/mount.h +++ b/src/sys/include/sys/mount.h @@ -31,22 +31,32 @@ #define _SYS_MOUNT_H_ #include <sys/queue.h> +#include <sys/syscall.h> #include <sys/types.h> +#if defined(_KERNEL) #include <os/vnode.h> +#endif /* defined(_KERNEL) */ -#if defined(_KERNEL) +/* + * Mount filesystem string names + */ +#define MOUNT_INITRD "initrd" /* Initial ramdisk */ +#define MOUNT_DEVFS "devfs" /* Device filesystem */ /* - * Number of bytes allowed in a filesystem - * name including the null termination + * The mount system call */ -#define FSNAME_MAX 16 +int mount( + const char *source, const char *target, const char *fstype, + unsigned long mountflags, void *data +); +#if defined(_KERNEL) /* - * Mount filesystem string names + * Number of bytes allowed in a filesystem + * name including the null termination */ -#define MOUNT_INITRD "initrd" /* Initial ramdisk */ -#define MOUNT_DEVFS "devfs" /* Device filesystem */ +#define FSNAME_MAX 16 /* Forward declarations */ struct fs_info; @@ -155,7 +165,7 @@ int mount_lookup(const char *name, struct mount **mp_res); * Returns zero on success, otherwise a less than zero * failure upon failure. */ -int mount(struct mount_args *margs, uint32_t flags); +int kmount(struct mount_args *margs, uint32_t flags); /* * Initialize a mountpoint to a known state @@ -178,5 +188,10 @@ int mountlist_init(struct mountlist *mlp); */ int mount_alloc(const char *name, struct mount **mp_res); +/* + * Mount system call + */ +scret_t sys_mount(struct syscall_args *scargs); + #endif /* !_KERNEL */ #endif /* !_SYS_MOUNT_H_ */ diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h index c1c06bb..4121d54 100644 --- a/src/sys/include/sys/syscall.h +++ b/src/sys/include/sys/syscall.h @@ -49,6 +49,7 @@ #define SYS_sigaction 0x04 #define SYS_query 0x05 /* query a border (mandatory) */ #define SYS_spawn 0x06 /* spawn a process */ +#define SYS_mount 0x07 /* mount a filesystem */ typedef __ssize_t scret_t; typedef __ssize_t scarg_t; |