mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
Implement argc/argv support for spawned tasks.
Celebrate the new functionality with a simple /bin/cat implementation. :^)
This commit is contained in:
parent
53abfa7ea1
commit
df87dda63c
13 changed files with 105 additions and 17 deletions
|
@ -8,9 +8,12 @@ extern "C" int _start()
|
|||
{
|
||||
errno = 0;
|
||||
|
||||
// FIXME: Pass appropriate argc/argv.
|
||||
int status = main(0, nullptr);
|
||||
|
||||
int argc;
|
||||
char** argv;
|
||||
int rc = Syscall::invoke(Syscall::GetArguments, (dword)&argc, (dword)&argv);
|
||||
int status = 254;
|
||||
if (rc == 0)
|
||||
status = main(argc, argv);
|
||||
Syscall::invoke(Syscall::PosixExit, status);
|
||||
|
||||
// Birger's birthday <3
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
extern "C" {
|
||||
|
||||
int spawn(const char* path)
|
||||
int spawn(const char* path, const char** args)
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::Spawn, (dword)path);
|
||||
int rc = Syscall::invoke(Syscall::Spawn, (dword)path, (dword)args);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
extern "C" {
|
||||
|
||||
int spawn(const char* path);
|
||||
int spawn(const char* path, const char** args);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue