fd: change allocation to add a lowest fd option

This commit is contained in:
Matheus
2022-09-23 19:37:25 -03:00
parent ff6999aa81
commit 67c9a04d58
4 changed files with 19 additions and 16 deletions
+3 -3
View File
@@ -417,9 +417,9 @@ void sched_runinit(){
fd_t *stdinfd, *stdoutfd, *stderrfd;
fd_alloc(&proc->fdtable, &stdinfd, &tmp);
fd_alloc(&proc->fdtable, &stdoutfd, &tmp);
fd_alloc(&proc->fdtable, &stderrfd, &tmp);
fd_alloc(&proc->fdtable, &stdinfd, &tmp, 0);
fd_alloc(&proc->fdtable, &stdoutfd, &tmp, 0);
fd_alloc(&proc->fdtable, &stderrfd, &tmp, 0);
#define CONSOLE_PATH "dev/console"
+1 -1
View File
@@ -32,7 +32,7 @@ syscallret syscall_open(const char* pathname, int flags, mode_t mode){
int ifd;
fd_t* fd;
int err = fd_alloc(&proc->fdtable, &fd, &ifd);
int err = fd_alloc(&proc->fdtable, &fd, &ifd, 0);
if(err){
retv.errno = err;