Replace system call array types with pointers.

This commit is contained in:
Jonas 'Sortie' Termansen 2015-01-23 00:29:04 +01:00
parent 88d808bea3
commit bb70eef85b
6 changed files with 15 additions and 17 deletions

View File

@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014. Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015.
This file is part of Sortix. This file is part of Sortix.
@ -65,7 +65,7 @@ int sys_dispmsg_issue(void*, size_t);
int sys_dup(int); int sys_dup(int);
int sys_dup2(int, int); int sys_dup2(int, int);
int sys_dup3(int, int, int); int sys_dup3(int, int, int);
int sys_execve(const char*, char* const [], char* const []); int sys_execve(const char*, char* const*, char* const*);
int sys_exit_thread(int, int, const struct exit_thread*); int sys_exit_thread(int, int, const struct exit_thread*);
int sys_faccessat(int, const char*, int, int); int sys_faccessat(int, const char*, int, int);
int sys_fchdir(int); int sys_fchdir(int);
@ -85,7 +85,7 @@ int sys_fstatvfs(int, struct statvfs*);
int sys_fstatvfsat(int, const char*, struct statvfs*, int); int sys_fstatvfsat(int, const char*, struct statvfs*, int);
int sys_fsync(int); int sys_fsync(int);
int sys_ftruncate(int, off_t); int sys_ftruncate(int, off_t);
int sys_futimens(int, const struct timespec [2]); int sys_futimens(int, const struct timespec*);
gid_t sys_getegid(void); gid_t sys_getegid(void);
int sys_getentropy(void*, size_t); int sys_getentropy(void*, size_t);
uid_t sys_geteuid(void); uid_t sys_geteuid(void);
@ -116,7 +116,7 @@ void* sys_mmap_wrapper(struct mmap_request*);
int sys_mprotect(const void*, size_t, int); int sys_mprotect(const void*, size_t, int);
int sys_munmap(void*, size_t); int sys_munmap(void*, size_t);
int sys_openat(int, const char*, int, mode_t); int sys_openat(int, const char*, int, mode_t);
int sys_pipe2(int [2], int); int sys_pipe2(int*, int);
int sys_ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*); int sys_ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*);
ssize_t sys_pread(int, void*, size_t, off_t); ssize_t sys_pread(int, void*, size_t, off_t);
ssize_t sys_preadv(int, const struct iovec*, int, off_t); ssize_t sys_preadv(int, const struct iovec*, int, off_t);
@ -168,7 +168,7 @@ int sys_truncateat(int, const char*, off_t);
mode_t sys_umask(mode_t); mode_t sys_umask(mode_t);
int sys_unlinkat(int, const char*, int); int sys_unlinkat(int, const char*, int);
int sys_unmountat(int, const char*, int); int sys_unmountat(int, const char*, int);
int sys_utimensat(int, const char*, const struct timespec [2], int); int sys_utimensat(int, const char*, const struct timespec*, int);
pid_t sys_waitpid(pid_t, int*, int); pid_t sys_waitpid(pid_t, int*, int);
ssize_t sys_write(int, const void*, size_t); ssize_t sys_write(int, const void*, size_t);
ssize_t sys_writev(int, const struct iovec*, int); ssize_t sys_writev(int, const struct iovec*, int);

View File

@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014. Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015.
This file is part of Sortix. This file is part of Sortix.
@ -492,7 +492,7 @@ int sys_fchmodat(int dirfd, const char* path, mode_t mode, int flags)
return desc->chmod(&ctx, mode); return desc->chmod(&ctx, mode);
} }
int sys_futimens(int fd, const struct timespec user_times[2]) int sys_futimens(int fd, const struct timespec* user_times)
{ {
struct timespec times[2]; struct timespec times[2];
if ( !CopyFromUser(times, user_times, sizeof(times)) ) if ( !CopyFromUser(times, user_times, sizeof(times)) )
@ -505,7 +505,7 @@ int sys_futimens(int fd, const struct timespec user_times[2])
} }
int sys_utimensat(int dirfd, const char* path, int sys_utimensat(int dirfd, const char* path,
const struct timespec user_times[2], int flags) const struct timespec* user_times, int flags)
{ {
if ( flags & ~(AT_SYMLINK_NOFOLLOW) ) if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
return errno = EINVAL, -1; return errno = EINVAL, -1;

View File

@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014. Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015.
This file is part of Sortix. This file is part of Sortix.
@ -509,7 +509,7 @@ int PipeNode::poll(ioctx_t* ctx, PollNode* node)
return endpoint.poll(ctx, node); return endpoint.poll(ctx, node);
} }
int sys_pipe2(int pipefd[2], int flags) int sys_pipe2(int* pipefd, int flags)
{ {
int fdflags = 0; int fdflags = 0;
if ( flags & O_CLOEXEC ) fdflags |= FD_CLOEXEC; if ( flags & O_CLOEXEC ) fdflags |= FD_CLOEXEC;

View File

@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014. Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014, 2015.
This file is part of Sortix. This file is part of Sortix.
@ -1150,9 +1150,9 @@ static void sys_execve_free(addralloc_t* alloc)
static static
int sys_execve_kernel(const char* filename, int sys_execve_kernel(const char* filename,
int argc, int argc,
char* const argv[], char* const* argv,
int envc, int envc,
char* const envp[], char* const* envp,
struct thread_registers* regs) struct thread_registers* regs)
{ {
Process* process = CurrentProcess(); Process* process = CurrentProcess();
@ -1322,8 +1322,8 @@ int sys_execve_kernel(const char* filename,
} }
int sys_execve(const char* user_filename, int sys_execve(const char* user_filename,
char* const user_argv[], char* const* user_argv,
char* const user_envp[]) char* const* user_envp)
{ {
char* filename; char* filename;
int argc; int argc;

View File

@ -25,7 +25,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syscall.h> #include <sys/syscall.h>
// TODO: You cannot currently pass array types to the DEFN_SYSCALL* family.
DEFN_SYSCALL2(int, sys_futimens, SYSCALL_FUTIMENS, int, const struct timespec*); DEFN_SYSCALL2(int, sys_futimens, SYSCALL_FUTIMENS, int, const struct timespec*);
extern "C" int futimens(int fd, const struct timespec times[2]) extern "C" int futimens(int fd, const struct timespec times[2])

View File

@ -27,7 +27,6 @@
#include <fcntl.h> #include <fcntl.h>
// TODO: You cannot currently pass array types to the DEFN_SYSCALL* family.
DEFN_SYSCALL4(int, sys_utimensat, SYSCALL_UTIMENSAT, int, const char*, DEFN_SYSCALL4(int, sys_utimensat, SYSCALL_UTIMENSAT, int, const char*,
const struct timespec*, int); const struct timespec*, int);