summaryrefslogtreecommitdiff
path: root/src/unistd
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-12 10:03:53 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-12 10:03:53 -0400
commita97a1ed57051fc0c4e2f2f803a4d6a734689cbdc (patch)
tree55ebd06aae0741b3e4bfe975f7d91dc63b0c6a24 /src/unistd
parent4f50d3e580761fd3c44fe8ed0db57858c5295f25 (diff)
remove __syscall_lookup()
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/_exit.c2
-rw-r--r--src/unistd/chdir.c2
-rw-r--r--src/unistd/chown.c2
-rw-r--r--src/unistd/close.c2
-rw-r--r--src/unistd/execve.c2
-rw-r--r--src/unistd/fork.c2
-rw-r--r--src/unistd/fsync.c3
-rw-r--r--src/unistd/ftruncate.c3
-rw-r--r--src/unistd/getcwd.c2
-rw-r--r--src/unistd/getegid.c2
-rw-r--r--src/unistd/geteuid.c2
-rw-r--r--src/unistd/getgid.c2
-rw-r--r--src/unistd/getgroups.c2
-rw-r--r--src/unistd/getpgrp.c2
-rw-r--r--src/unistd/getpid.c2
-rw-r--r--src/unistd/getppid.c2
-rw-r--r--src/unistd/getuid.c2
-rw-r--r--src/unistd/link.c2
-rw-r--r--src/unistd/lseek.c2
-rw-r--r--src/unistd/pause.c2
-rw-r--r--src/unistd/pipe.c2
-rw-r--r--src/unistd/read.c2
-rw-r--r--src/unistd/rmdir.c2
-rw-r--r--src/unistd/setgid.c2
-rw-r--r--src/unistd/setpgid.c2
-rw-r--r--src/unistd/setsid.c2
-rw-r--r--src/unistd/setuid.c2
-rw-r--r--src/unistd/unlink.c2
-rw-r--r--src/unistd/write.c2
29 files changed, 31 insertions, 29 deletions
diff --git a/src/unistd/_exit.c b/src/unistd/_exit.c
index 53e7ddba..f892dd59 100644
--- a/src/unistd/_exit.c
+++ b/src/unistd/_exit.c
@@ -5,7 +5,7 @@
void _exit(int status)
{
- long scno = __lookup("exit");
+ long scno = __syscall_lookup(exit);
for (;;) {
__syscall(scno, status);
}
diff --git a/src/unistd/chdir.c b/src/unistd/chdir.c
index 203be533..e4061feb 100644
--- a/src/unistd/chdir.c
+++ b/src/unistd/chdir.c
@@ -5,7 +5,7 @@
int chdir(const char *path)
{
- SYSCALL("chdir", int, -1, path, 0, 0, 0, 0, 0);
+ SYSCALL(chdir, int, -1, path, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/chown.c b/src/unistd/chown.c
index 2036fb28..9f931765 100644
--- a/src/unistd/chown.c
+++ b/src/unistd/chown.c
@@ -5,7 +5,7 @@
int chown(const char *path, uid_t owner, gid_t group)
{
- SYSCALL("chown", int, -1, path, owner, group, 0, 0, 0);
+ SYSCALL(chown, int, -1, path, owner, group, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/close.c b/src/unistd/close.c
index 4c917e27..e3e038cc 100644
--- a/src/unistd/close.c
+++ b/src/unistd/close.c
@@ -5,7 +5,7 @@
int close(int fildes)
{
- SYSCALL("close", int, -1, fildes, 0, 0, 0, 0, 0);
+ SYSCALL(close, int, -1, fildes, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/execve.c b/src/unistd/execve.c
index 96539df2..81e39b93 100644
--- a/src/unistd/execve.c
+++ b/src/unistd/execve.c
@@ -5,7 +5,7 @@
int execve(const char *path, char *const argv[], char *const envp[])
{
- SYSCALL_NUMBER(scno, "execve", -1);
+ SYSCALL_NUMBER(scno, execve, -1);
errno = -__syscall(scno, path, argv, envp);
return -1;
}
diff --git a/src/unistd/fork.c b/src/unistd/fork.c
index 0417a60b..298de865 100644
--- a/src/unistd/fork.c
+++ b/src/unistd/fork.c
@@ -6,7 +6,7 @@
pid_t fork(void)
{
- SYSCALL("fork", pid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(fork, pid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/fsync.c b/src/unistd/fsync.c
index 35d70cbb..b0dd3820 100644
--- a/src/unistd/fsync.c
+++ b/src/unistd/fsync.c
@@ -1,12 +1,13 @@
#include <unistd.h>
-#include "__nonstd.h"
int fsync(int fildes)
{
+ /*
__POSIX_MIN(199309L);
__POSIX_OPTION(_FSYNC);
__XOPEN_MIN(4);
__SC(int, fildes);
+ */
}
/*
diff --git a/src/unistd/ftruncate.c b/src/unistd/ftruncate.c
index 8e6cf27f..6723321f 100644
--- a/src/unistd/ftruncate.c
+++ b/src/unistd/ftruncate.c
@@ -1,12 +1,13 @@
#include <unistd.h>
-#include "__nonstd.h"
int ftruncate(int fildes, off_t length)
{
+ /*
__POSIX_MIN(199309L);
__POSIX_OPTION_OR(_MAPPED_FILES, _SHARED_MEMORY);
__XOPEN_MIN(450);
__SC(int, fildes, length);
+ */
}
/*
diff --git a/src/unistd/getcwd.c b/src/unistd/getcwd.c
index 3ddfa53a..7a37a7c2 100644
--- a/src/unistd/getcwd.c
+++ b/src/unistd/getcwd.c
@@ -6,7 +6,7 @@
char * getcwd(char *buf, size_t size)
{
ASSERT_NONNULL(buf);
- SYSCALL("getcwd", char *, NULL, buf, size, 0, 0, 0, 0);
+ SYSCALL(getcwd, char *, NULL, buf, size, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getegid.c b/src/unistd/getegid.c
index eecc5a06..0c39a84a 100644
--- a/src/unistd/getegid.c
+++ b/src/unistd/getegid.c
@@ -5,7 +5,7 @@
gid_t getegid(void)
{
- SYSCALL("getegid", gid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getegid, gid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/geteuid.c b/src/unistd/geteuid.c
index 8c7aa204..9ccb56de 100644
--- a/src/unistd/geteuid.c
+++ b/src/unistd/geteuid.c
@@ -5,7 +5,7 @@
uid_t geteuid(void)
{
- SYSCALL("geteuid", uid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(geteuid, uid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getgid.c b/src/unistd/getgid.c
index f991f18d..28888be0 100644
--- a/src/unistd/getgid.c
+++ b/src/unistd/getgid.c
@@ -5,7 +5,7 @@
gid_t getgid(void)
{
- SYSCALL("getgid", gid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getgid, gid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getgroups.c b/src/unistd/getgroups.c
index 62a3207e..b7df2896 100644
--- a/src/unistd/getgroups.c
+++ b/src/unistd/getgroups.c
@@ -10,7 +10,7 @@ int getgroups(int gidsetsize, gid_t grouplist[])
if (gidsetsize != 0) {
ASSERT_NONNULL(grouplist);
}
- SYSCALL("getgroups", int, -1, gidsetsize, grouplist, 0, 0, 0, 0);
+ SYSCALL(getgroups, int, -1, gidsetsize, grouplist, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getpgrp.c b/src/unistd/getpgrp.c
index 8f06b9e8..7654afcb 100644
--- a/src/unistd/getpgrp.c
+++ b/src/unistd/getpgrp.c
@@ -5,7 +5,7 @@
pid_t getpgrp(void)
{
- SYSCALL("getpgrp", pid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getpgrp, pid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getpid.c b/src/unistd/getpid.c
index d1255f5d..2c638c3c 100644
--- a/src/unistd/getpid.c
+++ b/src/unistd/getpid.c
@@ -5,7 +5,7 @@
pid_t getpid(void)
{
- SYSCALL("getpid", pid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getpid, pid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getppid.c b/src/unistd/getppid.c
index b39c36bc..642501f0 100644
--- a/src/unistd/getppid.c
+++ b/src/unistd/getppid.c
@@ -5,7 +5,7 @@
pid_t getppid(void)
{
- SYSCALL("getppid", pid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getppid, pid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/getuid.c b/src/unistd/getuid.c
index 4373915a..baccfa34 100644
--- a/src/unistd/getuid.c
+++ b/src/unistd/getuid.c
@@ -5,7 +5,7 @@
uid_t getuid(void)
{
- SYSCALL("getuid", uid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(getuid, uid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/link.c b/src/unistd/link.c
index 1f0b0db9..93726cb3 100644
--- a/src/unistd/link.c
+++ b/src/unistd/link.c
@@ -5,7 +5,7 @@
int link(const char *path1, const char *path2)
{
- SYSCALL("link", int, -1, path1, path2, 0, 0, 0, 0);
+ SYSCALL(link, int, -1, path1, path2, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/lseek.c b/src/unistd/lseek.c
index 52665cd6..a277efbd 100644
--- a/src/unistd/lseek.c
+++ b/src/unistd/lseek.c
@@ -5,7 +5,7 @@
off_t lseek(int fildes, off_t offset, int whence)
{
- SYSCALL("lseek", off_t, -1, fildes, offset, whence, 0, 0, 0);
+ SYSCALL(lseek, off_t, -1, fildes, offset, whence, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/pause.c b/src/unistd/pause.c
index 99e079cd..d69900f9 100644
--- a/src/unistd/pause.c
+++ b/src/unistd/pause.c
@@ -5,7 +5,7 @@
int pause(void)
{
- SYSCALL("pause", int, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(pause, int, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/pipe.c b/src/unistd/pipe.c
index b682f872..26e97dea 100644
--- a/src/unistd/pipe.c
+++ b/src/unistd/pipe.c
@@ -7,7 +7,7 @@
int pipe(int fildes[2])
{
ASSERT_NONNULL(fildes);
- SYSCALL("pipe", int, -1, fildes, 0, 0, 0, 0, 0);
+ SYSCALL(pipe, int, -1, fildes, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/read.c b/src/unistd/read.c
index dcaa5825..f7b91a9b 100644
--- a/src/unistd/read.c
+++ b/src/unistd/read.c
@@ -6,7 +6,7 @@
ssize_t read(int fildes, void *buf, size_t nbyte)
{
- SYSCALL("read", ssize_t, -1, fildes, buf, nbyte, 0, 0, 0);
+ SYSCALL(read, ssize_t, -1, fildes, buf, nbyte, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/rmdir.c b/src/unistd/rmdir.c
index 6e97c005..b1944f80 100644
--- a/src/unistd/rmdir.c
+++ b/src/unistd/rmdir.c
@@ -6,7 +6,7 @@
int rmdir(const char *path)
{
- SYSCALL("rmdir", int, -1, path, 0, 0, 0, 0, 0);
+ SYSCALL(rmdir, int, -1, path, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/setgid.c b/src/unistd/setgid.c
index 478387a4..30aa5223 100644
--- a/src/unistd/setgid.c
+++ b/src/unistd/setgid.c
@@ -5,7 +5,7 @@
int setgid(gid_t gid)
{
- SYSCALL("setgid", int, -1, gid, 0, 0, 0, 0, 0);
+ SYSCALL(setgid, int, -1, gid, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/setpgid.c b/src/unistd/setpgid.c
index 288dc4eb..2206446e 100644
--- a/src/unistd/setpgid.c
+++ b/src/unistd/setpgid.c
@@ -6,7 +6,7 @@
int setpgid(pid_t pid, pid_t pgid)
{
- SYSCALL("setpgid", int, -1, pid, pgid, 0, 0, 0, 0);
+ SYSCALL(setpgid, int, -1, pid, pgid, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/setsid.c b/src/unistd/setsid.c
index 6c24594d..8dbc9d1c 100644
--- a/src/unistd/setsid.c
+++ b/src/unistd/setsid.c
@@ -5,7 +5,7 @@
pid_t setsid(void)
{
- SYSCALL("setsid", pid_t, -1, 0, 0, 0, 0, 0, 0);
+ SYSCALL(setsid, pid_t, -1, 0, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/setuid.c b/src/unistd/setuid.c
index fcb39bcb..4599b083 100644
--- a/src/unistd/setuid.c
+++ b/src/unistd/setuid.c
@@ -5,7 +5,7 @@
int setuid(uid_t uid)
{
- SYSCALL("setuid", int, -1, uid, 0, 0, 0, 0, 0);
+ SYSCALL(setuid, int, -1, uid, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/unlink.c b/src/unistd/unlink.c
index 4e7b040b..f658872d 100644
--- a/src/unistd/unlink.c
+++ b/src/unistd/unlink.c
@@ -7,7 +7,7 @@
int unlink(const char *path)
{
ASSERT_NONNULL(path);
- SYSCALL("unlink", int, -1, path, 0, 0, 0, 0, 0);
+ SYSCALL(unlink, int, -1, path, 0, 0, 0, 0, 0);
}
/*
POSIX(1)
diff --git a/src/unistd/write.c b/src/unistd/write.c
index 584eda9f..6982a359 100644
--- a/src/unistd/write.c
+++ b/src/unistd/write.c
@@ -9,7 +9,7 @@ ssize_t write(int fildes, const void *buf, size_t nbyte)
if (nbyte != 0) {
ASSERT_NONNULL(buf);
}
- SYSCALL("write", ssize_t, -1, fildes, buf, nbyte, 0, 0, 0);
+ SYSCALL(write, ssize_t, -1, fildes, buf, nbyte, 0, 0, 0);
}
/*
POSIX(1)