mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
More work towards getting bash to build.
Implemented some syscalls: dup(), dup2(), getdtablesize(). FileHandle is now a retainable, since that's needed for dup()'ed fd's. I didn't really test any of this beyond a basic smoke check.
This commit is contained in:
parent
82f84bab11
commit
9f2b9c82bf
17 changed files with 114 additions and 23 deletions
|
@ -190,5 +190,22 @@ int isatty(int fd)
|
|||
__RETURN_WITH_ERRNO(rc, 1, 0);
|
||||
}
|
||||
|
||||
int getdtablesize()
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::Getdtablesize);
|
||||
__RETURN_WITH_ERRNO(rc, 1, 0);
|
||||
}
|
||||
|
||||
int dup(int old_fd)
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::Dup, (dword)old_fd);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int dup2(int old_fd, int new_fd)
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::Dup2, (dword)old_fd, (dword)new_fd);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue