mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:27:36 +00:00
Add a "sleep" syscall that sleeps for N seconds.
This commit is contained in:
parent
c6f2890d8e
commit
5978185242
11 changed files with 37 additions and 12 deletions
1
Userland/.gitignore
vendored
1
Userland/.gitignore
vendored
|
@ -3,4 +3,5 @@ sh
|
|||
ps
|
||||
ls
|
||||
pwd
|
||||
sleep
|
||||
*.o
|
||||
|
|
|
@ -3,14 +3,16 @@ OBJS = \
|
|||
sh.o \
|
||||
ps.o \
|
||||
ls.o \
|
||||
pwd.o
|
||||
pwd.o \
|
||||
sleep.o
|
||||
|
||||
APPS = \
|
||||
id \
|
||||
sh \
|
||||
ps \
|
||||
ls \
|
||||
pwd
|
||||
pwd \
|
||||
sleep
|
||||
|
||||
ARCH_FLAGS =
|
||||
STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib
|
||||
|
@ -45,6 +47,9 @@ ls: ls.o
|
|||
pwd: pwd.o
|
||||
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
|
||||
|
||||
sleep: sleep.o
|
||||
$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
|
||||
|
||||
.cpp.o:
|
||||
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
|
|
10
Userland/sleep.cpp
Normal file
10
Userland/sleep.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <LibC/unistd.h>
|
||||
#include <LibC/stdio.h>
|
||||
|
||||
int main(int c, char** v)
|
||||
{
|
||||
unsigned secs = 10;
|
||||
sleep(secs);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue