sleep; appl + kappl do smth more or less usefull

This commit is contained in:
2025-12-03 05:37:50 +01:00
parent 63f56ae02c
commit 246a5bc3e6
7 changed files with 44 additions and 44 deletions

View File

@@ -6,17 +6,17 @@ namespace Syscall {
* \note the syscall number must correspond to the values in the syscall stub!
*/
enum class ID : size_t {
TEST = 0,
WRITE = 1,
READ = 2,
//SLEEP =3,
SEM_INIT=4,
SEM_DESTROY=5,
SEM_WAIT=6,
SEM_SIGNAL=7,
//SYS_GETPID=8,
//SYS_EXIT= 9,
//SYS_KILL=10
TEST = 0,
WRITE = 1,
READ = 2,
SLEEP = 3,
SEM_INIT=4,
SEM_DESTROY=5,
SEM_WAIT=6,
SEM_SIGNAL=7,
//SYS_GETPID=8,
//SYS_EXIT= 9,
//SYS_KILL=10
};
} // namespace Syscall
@@ -41,6 +41,10 @@ extern "C" ssize_t sys_safe_call(Syscall::ID id, size_t p1, size_t p2,
return sys_call(Syscall::ID::READ, fd, (size_t)buf, len, 0, 0);
}
[[gnu::always_inline]] static inline int sleep(size_t ms){
return sys_call(Syscall::ID::SLEEP, ms,0,0,0,0);
}
[[gnu::always_inline]] static inline int sem_init(int fd, int semid, int value) {
return sys_call(Syscall::ID::SEM_INIT, fd, semid, value, 0,0);
}