1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

A bunch of compat work (mostly stubs but some real implementations, too.)

Another pass at getting bash-1.14.7 to build. Not that many symbols remain.
This commit is contained in:
Andreas Kling 2018-11-11 00:20:53 +01:00
parent 6a0a2c9ab4
commit 3b2f172d48
9 changed files with 134 additions and 2 deletions

View file

@ -147,6 +147,12 @@ int stat(const char* path, struct stat* statbuf)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int fstat(int fd, struct stat *statbuf)
{
int rc = Syscall::invoke(Syscall::SC_fstat, (dword)fd, (dword)statbuf);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int chdir(const char* path)
{
int rc = Syscall::invoke(Syscall::SC_chdir, (dword)path);
@ -233,4 +239,33 @@ int getgroups(int size, gid_t list[])
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int pipe(int pipefd[2])
{
int rc = Syscall::invoke(Syscall::SC_pipe, (dword)pipefd);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
unsigned int alarm(unsigned int seconds)
{
return Syscall::invoke(Syscall::SC_alarm, (dword)seconds);
}
int setuid(uid_t uid)
{
int rc = Syscall::invoke(Syscall::SC_setuid, (dword)uid);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int setgid(uid_t gid)
{
int rc = Syscall::invoke(Syscall::SC_setgid, (dword)gid);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int access(const char* pathname, int mode)
{
int rc = Syscall::invoke(Syscall::SC_access, (dword)pathname, (dword)mode);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}