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.
@ -65,7 +65,7 @@ int sys_dispmsg_issue(void*, size_t);
int sys_dup(int);
int sys_dup2(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_faccessat(int, const char*, int, 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_fsync(int);
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);
int sys_getentropy(void*, size_t);
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_munmap(void*, size_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*);
ssize_t sys_pread(int, void*, size_t, 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);
int sys_unlinkat(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);
ssize_t sys_write(int, const void*, size_t);
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.
@ -492,7 +492,7 @@ int sys_fchmodat(int dirfd, const char* path, mode_t mode, int flags)
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];
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,
const struct timespec user_times[2], int flags)
const struct timespec* user_times, int flags)
{
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
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.
@ -509,7 +509,7 @@ int PipeNode::poll(ioctx_t* ctx, PollNode* node)
return endpoint.poll(ctx, node);
}
int sys_pipe2(int pipefd[2], int flags)
int sys_pipe2(int* pipefd, int flags)
{
int fdflags = 0;
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.
@ -1150,9 +1150,9 @@ static void sys_execve_free(addralloc_t* alloc)
static
int sys_execve_kernel(const char* filename,
int argc,
char* const argv[],
char* const* argv,
int envc,
char* const envp[],
char* const* envp,
struct thread_registers* regs)
{
Process* process = CurrentProcess();
@ -1322,8 +1322,8 @@ int sys_execve_kernel(const char* filename,
}
int sys_execve(const char* user_filename,
char* const user_argv[],
char* const user_envp[])
char* const* user_argv,
char* const* user_envp)
{
char* filename;
int argc;

View File

@ -25,7 +25,6 @@
#include <sys/stat.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*);
extern "C" int futimens(int fd, const struct timespec times[2])

View File

@ -27,7 +27,6 @@
#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*,
const struct timespec*, int);