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

Kernel: Pass process arguments directly on the stack.

Get rid of the convoluted get_arguments and get_environment syscalls.
This patch also adds a simple /bin/env that just prints its environment.
This commit is contained in:
Andreas Kling 2019-02-22 01:55:22 +01:00
parent e969419202
commit 6d3e12899b
9 changed files with 59 additions and 66 deletions

1
Userland/.gitignore vendored
View file

@ -34,3 +34,4 @@ pape
ln
df
su
env

View file

@ -30,6 +30,7 @@ OBJS = \
df.o \
ln.o \
su.o \
env.o \
rm.o
APPS = \
@ -65,6 +66,7 @@ APPS = \
ln \
df \
su \
env \
rm
ARCH_FLAGS =
@ -184,6 +186,9 @@ df: df.o
su: su.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
env: env.o
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<

9
Userland/env.cpp Normal file
View file

@ -0,0 +1,9 @@
#include <unistd.h>
#include <stdio.h>
int main(int, char**)
{
for (size_t i = 0; environ[i]; ++i)
printf("%s\n", environ[i]);
return 0;
}