mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
More random compat hacking towards getting bash to build.
I'm now at the build stage where it complains about a bajillion missing symbols. This is a good place to be!
This commit is contained in:
parent
e76312ab63
commit
82f84bab11
15 changed files with 306 additions and 8 deletions
|
@ -1174,6 +1174,22 @@ int Process::sys$uname(utsname* buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Process::sys$isatty(int fd)
|
||||
{
|
||||
auto* handle = fileHandleIfExists(fd);
|
||||
if (!handle)
|
||||
return -EBADF;
|
||||
if (!handle->isTTY())
|
||||
return -ENOTTY;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Unix::sighandler_t Process::sys$signal(int signum, Unix::sighandler_t handler)
|
||||
{
|
||||
dbgprintf("sys$signal: %d => L%x\n", signum, handler);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int Process::sys$kill(pid_t pid, int signal)
|
||||
{
|
||||
if (pid == 0) {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include "i386.h"
|
||||
#include <VirtualFileSystem/VirtualFileSystem.h>
|
||||
#include <VirtualFileSystem/UnixTypes.h>
|
||||
#include "TTY.h"
|
||||
|
||||
class FileHandle;
|
||||
|
@ -123,6 +124,8 @@ public:
|
|||
int sys$ttyname_r(int fd, char*, size_t);
|
||||
pid_t sys$fork(RegisterDump&);
|
||||
int sys$execve(const char* filename, const char** argv, const char** envp);
|
||||
Unix::sighandler_t sys$signal(int signum, Unix::sighandler_t);
|
||||
int sys$isatty(int fd);
|
||||
|
||||
static void initialize();
|
||||
|
||||
|
|
|
@ -136,6 +136,10 @@ static DWORD handle(RegisterDump& regs, DWORD function, DWORD arg1, DWORD arg2,
|
|||
return current->sys$geteuid();
|
||||
case Syscall::PosixGetegid:
|
||||
return current->sys$getegid();
|
||||
case Syscall::PosixSignal:
|
||||
return (dword)current->sys$signal((int)arg1, (Unix::sighandler_t)arg2);
|
||||
case Syscall::PosixIsatty:
|
||||
return current->sys$isatty((int)arg1);
|
||||
default:
|
||||
kprintf("<%u> int0x80: Unknown function %x requested {%x, %x, %x}\n", current->pid(), function, arg1, arg2, arg3);
|
||||
break;
|
||||
|
|
|
@ -51,6 +51,8 @@ enum Function {
|
|||
PosixExecve = 0x2019,
|
||||
PosixGeteuid = 0x2020,
|
||||
PosixGetegid = 0x2021,
|
||||
PosixSignal = 0x2022,
|
||||
PosixIsatty = 0x2023,
|
||||
};
|
||||
|
||||
void initialize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue