CS350 COS
COS
Loading...
Searching...
No Matches
unistd.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STDIN_FILENO   0
 
#define STDOUT_FILENO   1
 
#define STDERR_FILENO   2
 

Functions

int syscall (int number,...)
 
unsigned int sleep (unsigned int seconds)
 
pid_t spawn (const char *path, const char *argv[])
 

Macro Definition Documentation

◆ STDERR_FILENO

#define STDERR_FILENO   2

Definition at line 7 of file unistd.h.

◆ STDIN_FILENO

#define STDIN_FILENO   0

Definition at line 5 of file unistd.h.

◆ STDOUT_FILENO

#define STDOUT_FILENO   1

Definition at line 6 of file unistd.h.

Function Documentation

◆ sleep()

unsigned int sleep ( unsigned int  seconds)

Definition at line 12 of file process.c.

13{
14 OSThreadSleep(seconds);
15
16 // Should return left over time if woke up early
17 return 0;
18}
int OSThreadSleep(uint64_t time)
Definition: syscall.c:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spawn()

pid_t spawn ( const char *  path,
const char *  argv[] 
)

Definition at line 21 of file process.c.

22{
23 uint64_t status = OSSpawn(path, argv);
24
25 if (SYSCALL_ERRCODE(status) != 0) {
26 errno = SYSCALL_ERRCODE(status);
27 return -1;
28 }
29
30 return (pid_t)SYSCALL_VALUE(status);
31}
#define errno
Definition: errno.h:7
uint64_t OSSpawn(const char *path, const char *argv[])
Definition: syscall.c:29
#define SYSCALL_ERRCODE(_result)
Definition: syscall.h:56
#define SYSCALL_VALUE(_result)
Definition: syscall.h:57
unsigned long uint64_t
Definition: types.h:13
uint16_t pid_t
Definition: types.h:28
Here is the call graph for this function:
Here is the caller graph for this function:

◆ syscall()

int syscall ( int  number,
  ... 
)
Here is the caller graph for this function: