1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:47:44 +00:00

More compat work towards porting vim.

It now builds and runs in the small-featureset configuration. :^)
This commit is contained in:
Andreas Kling 2019-02-27 00:02:01 +01:00
parent 424368034b
commit e421c10735
8 changed files with 44 additions and 5 deletions

View file

@ -393,7 +393,13 @@ Region* FileDescriptor::mmap(Process& process, LinearAddress laddr, size_t offse
ASSERT(m_inode);
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
auto region_name = absolute_path();
String region_name;
#if 0
// FIXME: I would like to do this, but it would instantiate all the damn inodes.
region_name = absolute_path();
#else
region_name = "Memory-mapped file";
#endif
InterruptDisabler disabler;
// FIXME: Implement mapping at a client-specified address. Most of the support is already in plcae.
ASSERT(laddr.as_ptr() == nullptr);

View file

@ -313,7 +313,12 @@ int Process::do_exec(String path, Vector<String> arguments, Vector<String> envir
ProcessPagingScope paging_scope(*this);
auto vmo = VMObject::create_file_backed(descriptor->inode());
#if 0
// FIXME: I would like to do this, but it would instantiate all the damn inodes.
vmo->set_name(descriptor->absolute_path());
#else
vmo->set_name("ELF image");
#endif
RetainPtr<Region> region = allocate_region_with_vmo(LinearAddress(), descriptor->metadata().size, vmo.copy_ref(), 0, "executable", true, false);
// FIXME: Should we consider doing on-demand paging here? Is it actually useful?
@ -1547,6 +1552,7 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
return reaped_pid;
} else {
ASSERT(waitee > 0); // FIXME: Implement other PID specs.
InterruptDisabler disabler;
auto* waitee_process = Process::from_pid(waitee);
if (!waitee_process)
return -ECHILD;
@ -1967,9 +1973,7 @@ int Process::sys$select(const Syscall::SC_select_params* params)
auto* timeout = params->timeout;
// FIXME: Implement exceptfds support.
//ASSERT(!exceptfds);
if (exceptfds)
kprintf("%s(%u): FIXME: select() with exceptfds\n", name().characters(), pid());
(void)exceptfds;
if (timeout) {
m_select_timeout = *timeout;
@ -2006,6 +2010,9 @@ int Process::sys$select(const Syscall::SC_select_params* params)
error = transfer_fds(readfds, m_select_read_fds);
if (error)
return error;
error = transfer_fds(readfds, m_select_exceptional_fds);
if (error)
return error;
#ifdef DEBUG_IO
dbgprintf("%s<%u> selecting on (read:%u, write:%u), wakeup_req:%u, timeout=%p\n", name().characters(), pid(), m_select_read_fds.size(), m_select_write_fds.size(), m_wakeup_requested, timeout);
@ -2047,6 +2054,8 @@ int Process::sys$select(const Syscall::SC_select_params* params)
}
}
// FIXME: Check for exceptional conditions.
return markedfds;
}

View file

@ -353,6 +353,7 @@ private:
int m_blocked_fd { -1 };
Vector<int> m_select_read_fds;
Vector<int> m_select_write_fds;
Vector<int> m_select_exceptional_fds;
timeval m_select_timeout;
bool m_select_has_timeout { false };
size_t m_max_open_file_descriptors { 16 };

View file

@ -231,5 +231,7 @@ void syscall_trap_entry(RegisterDump& regs)
dword arg2 = regs.ecx;
dword arg3 = regs.ebx;
regs.eax = Syscall::handle(regs, function, arg1, arg2, arg3);
if (function == Syscall::SC_mkdir)
dbgprintf("->%d\n", regs.eax);
}