README.txt -- Mark Claypool, claypool@cs.wpi.edu OVERVIEW This code is designed to test whether file descriptors above 0, 1 and 2 are closed after an exec() call. fd.c - opens a file, then execs() fd2. The file descriptor should be 3. fd2.c - writes to file descriptor 3. If it works, it should indicate it has printed a message. Otherwise, it will report an error. HYPOTHESIS It is expected that all file descriptors remain open after an exec(), although it is possible that only the "main" descriptors do so (0, 1, 2) since those are the only open ones upon an initial shell process creation. RESULT claypool 178 carbon=>>ls fd* fd2* fd2.c fd.c Makefile README.txt claypool 179 carbon=>>fd2 write: Bad file descriptor claypool 180 carbon=>>fd Child said: Hello, world! claypool 181 carbon=>>ls fd* fd2* fd2.c fd.c file.txt Makefile README.txt claypool 182 carbon=>>cat file.txt Hello, world! CONCLUSION The success message by the child indicates that file descriptors above 2 are *not* closed after an exec().