From: Ben Pfaff Date: Wed, 5 Apr 2006 19:29:30 +0000 (+0000) Subject: Make explicit that open doesn't return fd 0 or 1. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b113b06bfd2092b03d46299ca881c711dc576e0d;p=pintos-anon Make explicit that open doesn't return fd 0 or 1. Make independence of fds across processes explicit. Thanks to Ryan Seth Propper for question. --- diff --git a/doc/userprog.texi b/doc/userprog.texi index ff98074..59b198a 100644 --- a/doc/userprog.texi +++ b/doc/userprog.texi @@ -661,8 +661,12 @@ when the process exits or is terminated. File descriptors numbered 0 and 1 are reserved for the console: fd 0 is standard input (@code{stdin}), fd 1 is standard output -(@code{stdout}). These special file descriptors are valid as system -call arguments only as explicitly described below. +(@code{stdout}). The @code{open} system call will never return either +of these file descriptors, which are valid as system call arguments only +as explicitly described below. + +Each process has an independent set of file descriptors. File +descriptors are not inherited by child processes. Consider implementing this function in terms of @func{filesys_open}. @end deftypefn