aboutsummaryrefslogtreecommitdiffstats
path: root/sys/netbsd
diff options
context:
space:
mode:
authorAyushi Sharma <35501599+ais2397@users.noreply.github.com>2020-06-21 14:11:23 +0530
committerGitHub <noreply@github.com>2020-06-21 01:41:23 -0700
commit4f2acff9390f8567fd9ae6ca1a2fd5a0f9466676 (patch)
treec5868004bc76e05b7f2fa9a351a68efc2bc01a74 /sys/netbsd
parentc655ec77ca937f773ed5905a8972d00eb59581e8 (diff)
sys/netbsd: increase syscall support (#1805)
* sys/netbsd: increase syscall support * sys/netbsd: increase syscall support fixed * sys/netbsd: fixed mknod issue * sys/netbsd: add fix for getdents, futimes and setpriority
Diffstat (limited to 'sys/netbsd')
-rw-r--r--sys/netbsd/fs.txt3
-rw-r--r--sys/netbsd/fs_amd64.const1
-rw-r--r--sys/netbsd/sys.txt71
-rw-r--r--sys/netbsd/sys_amd64.const44
4 files changed, 94 insertions, 25 deletions
diff --git a/sys/netbsd/fs.txt b/sys/netbsd/fs.txt
index f4eb9d7b0..8bc197ac5 100644
--- a/sys/netbsd/fs.txt
+++ b/sys/netbsd/fs.txt
@@ -32,7 +32,8 @@ write(fd fd, buf buffer[in], count len[buf])
writev(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec])
pwrite(fd fd, buf buffer[in], nbyte len[buf], off fileoff)
pwritev(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec], off fileoff)
-lseek(fd fd, offset fileoff, whence flags[seek_whence])
+lseek(fd fd, pad const[0], offset fileoff, whence flags[seek_whence])
+compat_43_olseek(fd fd, offset fileoff[int64], whence flags[seek_whence])
dup(oldfd fd) fd
dup2(oldfd fd, newfd fd) fd
pipe2(pipefd ptr[out, pipefd], flags flags[pipe_flags])
diff --git a/sys/netbsd/fs_amd64.const b/sys/netbsd/fs_amd64.const
index d865ad0dc..45aa092c8 100644
--- a/sys/netbsd/fs_amd64.const
+++ b/sys/netbsd/fs_amd64.const
@@ -26,6 +26,7 @@ SEEK_END = 2
SEEK_SET = 0
SYS_close = 6
SYS_compat_43_ocreat = 8
+SYS_compat_43_olseek = 19
SYS_dup = 41
SYS_dup2 = 90
SYS_lseek = 199
diff --git a/sys/netbsd/sys.txt b/sys/netbsd/sys.txt
index 8434d0411..f89b87d5a 100644
--- a/sys/netbsd/sys.txt
+++ b/sys/netbsd/sys.txt
@@ -50,7 +50,8 @@ fcntl$lock(fd fd, cmd flags[fcntl_lock], lock ptr[in, flock])
fcntl$getown(fd fd, cmd const[F_GETOWN]) pid
fcntl$setown(fd fd, cmd const[F_SETOWN], pid pid)
-mknod(file ptr[in, filename], mode flags[mknod_mode], dev int32)
+compat_50_mknod(file ptr[in, filename], mode flags[mknod_mode], dev int32)
+mknod(file ptr[in, filename], mode flags[mknod_mode], dev dev)
mknod$loop(file ptr[in, filename], mode flags[mknod_mode], dev proc[1792, 2])
mknodat(dirfd fd_dir, file ptr[in, filename], mode flags[mknod_mode], dev int32)
chmod(file ptr[in, filename], mode flags[open_mode])
@@ -66,7 +67,12 @@ chflags(file ptr[in, filename], flags flags[chflags_flags])
fchflags(fd fd, flags flags[chflags_flags])
lchflags(file ptr[in, filename], flags flags[chflags_flags])
faccessat(dirfd fd_dir, pathname ptr[in, filename], mode flags[access_mode], flags flags[faccessat_flags])
-utimes(filename ptr[in, filename], times ptr[in, itimerval])
+compat_50_utimes(filename ptr[in, filename], times ptr[in, timeval50])
+compat_50_futimes(fd fd, times ptr[in, timeval50])
+compat_50_lutimes(link ptr[in, filename], times ptr[in, timeval50])
+__utimes50(filename ptr[in, filename], times ptr[in, timeval])
+__futimes50(fd fd, times ptr[in, timeval])
+__lutimes50(link ptr[in, filename], times ptr[in, timeval])
utimensat(dir fd_dir, pathname ptr[in, filename], times ptr[in, itimerval], flags flags[utimensat_flags])
execve(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]])
@@ -92,6 +98,8 @@ __getlogin(buf buffer[out], size len[buf])
getsid(pid pid) pid
#__setlogin(buf buffer[in]) #Unsure about effects on test process
#setsid() pid #Unsure about effects on test process
+setpriority(which flags[priority_which], who pid, prio int32)
+getpriority(which flags[priority_which], who pid)
link(old ptr[in, filename], new ptr[in, filename])
linkat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename], flags flags[linkat_flags])
@@ -114,25 +122,35 @@ flock(fd fd, op flags[flock_op])
fsync(fd fd)
fdatasync(fd fd)
sync()
-getdents(fd fd_dir, ent buffer[out], count len[ent])
+compat_30_getdents(fd fd_dir, ent buffer[out], count int32)
+__getdents30(fd fd_dir, ent buffer[out], count int32)
chroot(dir ptr[in, filename])
__getcwd(buf buffer[out], size len[buf])
fchroot(fd fd)
chdir(dir ptr[in, filename])
fchdir(fd fd)
+acct(filename ptr[in, filename, opt])
-getrusage(who flags[rusage_who], usage ptr[out, rusage])
+compat_50_getrusage(who flags[rusage_who], usage ptr[out, rusage50])
+__getrusage50(who flags[rusage_who], usage ptr[out, rusage])
getrlimit(res flags[rlimit_type], rlim ptr[out, rlimit])
setrlimit(res flags[rlimit_type], rlim ptr[in, rlimit])
-clock_gettime(id flags[clock_id], tp ptr[out, timespec])
-clock_settime(id flags[clock_id], tp ptr[in, timespec])
-clock_getres(id flags[clock_id], tp ptr[out, timespec])
+compat_50_clock_gettime(id flags[clock_id], tp ptr[out, timespec50])
+compat_50_clock_settime(id flags[clock_id], tp ptr[in, timespec50])
+compat_50_clock_getres(id flags[clock_id], res ptr[out, timespec50, opt])
clock_nanosleep(id flags[clock_id], flags flags[timer_flags], rqtp ptr[in, timespec], rmtp ptr[out, timespec, opt])
-nanosleep(req ptr[in, timespec], rem ptr[out, timespec, opt])
-getitimer(which flags[getitimer_which], cur ptr[out, itimerval])
-setitimer(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, itimerval, opt])
-wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt])
+compat_50_setitimer(which flags[getitimer_which], new ptr[in, itimerval50], old ptr[out, itimerval, opt])
+compat_50_getitimer(which flags[getitimer_which], value ptr[out, itimerval50])
+compat_50_nanosleep(rqtp ptr[in, timespec50], rmtp ptr[out, timespec50, opt])
+__setitimer50(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, itimerval, opt])
+__getitimer50(which flags[getitimer_which], value ptr[out, itimerval])
+__clock_gettime50(id flags[clock_id], tp ptr[out, timespec])
+__clock_settime50(id flags[clock_id], tp ptr[in, timespec])
+__clock_getres50(id flags[clock_id], res ptr[out, timespec, opt])
+__nanosleep50(rqtp ptr[in, timespec], rmtp ptr[out, timespec, opt])
+compat_50_wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage50, opt])
+__wait450(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt])
dup3(oldfd fd, newfd fd, flags flags[dup_flags]) fd
exit(code intptr)
@@ -174,6 +192,11 @@ itimerval {
value timeval
}
+itimerval50 {
+ interv timeval50
+ value timeval50
+}
+
# TODO: fd_set needs to be a separate type
fd_set {
mask0 int64
@@ -205,6 +228,25 @@ rusage {
nivcsw intptr
}
+rusage50 {
+ utime timeval50
+ stime timeval50
+ maxrss intptr
+ ixrss intptr
+ idrss intptr
+ isrss intptr
+ minflt intptr
+ majflt intptr
+ nswap intptr
+ inblock intptr
+ oublock intptr
+ msgsnd intptr
+ msgrcv intptr
+ signals intptr
+ nvcsw intptr
+ nivcsw intptr
+}
+
rlimit {
soft intptr
hard intptr
@@ -275,16 +317,17 @@ mknod_mode = S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO, S_IFSOCK, S_IRUSR, S_IWUSR, S_I
msync_flags = MS_ASYNC, MS_SYNC, MS_INVALIDATE
at_flags = AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW
access_mode = R_OK, W_OK, X_OK, F_OK
+priority_which = PRIO_PROCESS, PRIO_PGRP, PRIO_USER
linkat_flags = AT_SYMLINK_FOLLOW
unlinkat_flags = 0, AT_REMOVEDIR
flock_op = LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB
faccessat_flags = AT_EACCESS, AT_SYMLINK_NOFOLLOW
rusage_who = RUSAGE_SELF, RUSAGE_CHILDREN
rlimit_type = RLIMIT_AS, RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_MEMLOCK, RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_STACK, RLIMIT_NTHR, RLIMIT_STACK
-clock_id = CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID, CLOCK_VIRTUAL, CLOCK_PROF
+timer_flags = TIMER_RELTIME, TIMER_ABSTIME
+clock_id = CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_VIRTUAL, CLOCK_PROF, CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID
getitimer_which = ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, ITIMER_MONOTONIC
-wait_options = WALLSIG, WALTSIG, WCONTINUED, WEXITED, WNOHANG, WNOZOMBIE, WSTOPPED, WTRAPPED, WUNTRACED
-timer_flags = 0, TIMER_ABSTIME
+wait_options = WALLSIG, WALTSIG, WCONTINUED, WEXITED, WNOHANG, WNOZOMBIE, WSTOPPED, WTRAPPED, WUNTRACED, __WALL, __WCLONE
utimensat_flags = 0, AT_SYMLINK_NOFOLLOW
fcntl_dupfd = F_DUPFD, F_DUPFD_CLOEXEC
fcntl_getflags = F_GETFD, F_GETFL
diff --git a/sys/netbsd/sys_amd64.const b/sys/netbsd/sys_amd64.const
index c71335f0a..8a1964671 100644
--- a/sys/netbsd/sys_amd64.const
+++ b/sys/netbsd/sys_amd64.const
@@ -70,6 +70,9 @@ POLLRDBAND = 128
POLLRDNORM = 64
POLLWRBAND = 256
POLLWRNORM = 4
+PRIO_PGRP = 1
+PRIO_PROCESS = 0
+PRIO_USER = 2
RLIMIT_AS = 10
RLIMIT_CORE = 4
RLIMIT_CPU = 0
@@ -96,32 +99,55 @@ SA_SIGINFO = 64
SF_APPEND = 262144
SF_ARCHIVED = 65536
SF_IMMUTABLE = 131072
+SYS___clock_getres50 = 429
+SYS___clock_gettime50 = 427
+SYS___clock_settime50 = 428
SYS___clone = 287
SYS___fstat50 = 440
+SYS___futimes50 = 423
SYS___getcwd = 296
+SYS___getdents30 = 390
+SYS___getitimer50 = 426
SYS___getlogin = 49
+SYS___getrusage50 = 445
SYS___lstat50 = 441
+SYS___lutimes50 = 424
SYS___msync13 = 277
+SYS___nanosleep50 = 430
SYS___select50 = 417
+SYS___setitimer50 = 425
SYS___stat50 = 439
+SYS___utimes50 = 420
SYS___vfork14 = 282
+SYS___wait450 = 449
SYS_access = 33
+SYS_acct = 51
SYS_chdir = 12
SYS_chflags = 34
SYS_chmod = 15
SYS_chown = 16
SYS_chroot = 61
-SYS_clock_getres = 429
-SYS_clock_gettime = 427
SYS_clock_nanosleep = 477
-SYS_clock_settime = 428
SYS_compat_12_msync = 65
+SYS_compat_30_getdents = 272
SYS_compat_43_fstat43 = 62
SYS_compat_43_lstat43 = 40
SYS_compat_43_oftruncate = 130
SYS_compat_43_otruncate = 129
SYS_compat_43_stat43 = 38
+SYS_compat_50_clock_getres = 234
+SYS_compat_50_clock_gettime = 232
+SYS_compat_50_clock_settime = 233
+SYS_compat_50_futimes = 206
+SYS_compat_50_getitimer = 86
+SYS_compat_50_getrusage = 117
+SYS_compat_50_lutimes = 276
+SYS_compat_50_mknod = 14
+SYS_compat_50_nanosleep = 240
SYS_compat_50_select = 93
+SYS_compat_50_setitimer = 83
+SYS_compat_50_utimes = 138
+SYS_compat_50_wait4 = 7
SYS_dup3 = 454
SYS_execve = 59
SYS_exit = 1
@@ -139,18 +165,16 @@ SYS_flock = 131
SYS_fork = 2
SYS_fsync = 95
SYS_ftruncate = 201
-SYS_getdents = 390
SYS_getegid = 43
SYS_geteuid = 25
SYS_getgid = 47
SYS_getgroups = 79
-SYS_getitimer = 426
SYS_getpgid = 207
SYS_getpgrp = 81
SYS_getpid = 20
SYS_getppid = 39
+SYS_getpriority = 100
SYS_getrlimit = 194
-SYS_getrusage = 445
SYS_getsid = 286
SYS_getuid = 24
SYS_lchflags = 304
@@ -164,7 +188,6 @@ SYS_mkdir = 136
SYS_mkdirat = 461
SYS_mknod = 450
SYS_mknodat = 460
-SYS_nanosleep = 430
SYS_pipe = 42
SYS_poll = 209
SYS_posix_spawn = 474
@@ -179,8 +202,8 @@ SYS_setegid = 182
SYS_seteuid = 183
SYS_setgid = 181
SYS_setgroups = 80
-SYS_setitimer = 425
SYS_setpgid = 82
+SYS_setpriority = 96
SYS_setregid = 127
SYS_setreuid = 126
SYS_setrlimit = 195
@@ -192,9 +215,7 @@ SYS_truncate = 200
SYS_unlink = 10
SYS_unlinkat = 471
SYS_utimensat = 467
-SYS_utimes = 420
SYS_vfork = 66
-SYS_wait4 = 449
S_IFBLK = 24576
S_IFCHR = 8192
S_IFIFO = 4096
@@ -210,6 +231,7 @@ S_IXGRP = 8
S_IXOTH = 1
S_IXUSR = 64
TIMER_ABSTIME = 1
+TIMER_RELTIME = 0
UF_APPEND = 4
UF_IMMUTABLE = 2
UF_NODUMP = 1
@@ -225,3 +247,5 @@ WTRAPPED = 64
WUNTRACED = 2
W_OK = 2
X_OK = 1
+__WALL = 8
+__WCLONE = 4