apio
9b39d618de
This function is a Luna alternative to fork() and exec(). Why? Simply because I can't figure out for the life of me how to implement a working fork(). So meanwhile, we have spawn() as a replacement. exec() still exists, though.
30 lines
656 B
C
30 lines
656 B
C
#ifndef _LUNA_H
|
|
#define _LUNA_H
|
|
|
|
#include <bits/macros.h>
|
|
#include <sys/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/* Returns the current program's thread identifier. */
|
|
pid_t gettid(void);
|
|
|
|
/* Sleeps for ms milliseconds. */
|
|
unsigned int msleep(unsigned int ms);
|
|
|
|
/* Prints a message to standard error and aborts the program. */
|
|
__lc_noreturn void __luna_abort(const char* message);
|
|
|
|
/* Creates a new process from the executable at pathname and returns its PID. */
|
|
pid_t spawn(const char* pathname);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#define NOT_IMPLEMENTED(message) __luna_abort("not implemented: " message "\n")
|
|
|
|
#endif |