26 lines
577 B
C
26 lines
577 B
C
|
#include "io.h"
|
||
|
|
||
|
struct file_descriptor emmafs_stdin {
|
||
|
*inode = NONE;
|
||
|
off_t = NONE;
|
||
|
flags = NONE;
|
||
|
int ref_count = 0;
|
||
|
};
|
||
|
|
||
|
struct Process* initialize_process() {
|
||
|
struct Process* new_proc = (struct Process*) malloc(sizeof(struct Process));
|
||
|
if (new_proc == NULL) {
|
||
|
errno = ENOMEM;
|
||
|
perror("Failed memory allocation for Process");
|
||
|
return NULL;
|
||
|
}
|
||
|
new_proc->fd_table[0] = emmafs_stdin;
|
||
|
}
|
||
|
|
||
|
int allocate_fd(struct Process proc, Inode inode, int flags, ...) {
|
||
|
va_list argptr;
|
||
|
va_start(argptr, flags);
|
||
|
|
||
|
va_end(argptr);
|
||
|
}
|