00001 /* Child process run by multi-child-fd test. 00002 00003 Attempts to close the file descriptor passed as the first 00004 command-line argument. This is invalid, because file 00005 descriptors are not inherited in Pintos. Two results are 00006 allowed: either the system call should return without taking 00007 any action, or the kernel should terminate the process with a 00008 -1 exit code. */ 00009 00010 #include <ctype.h> 00011 #include <stdio.h> 00012 #include <stdlib.h> 00013 #include <syscall.h> 00014 #include "tests/lib.h" 00015 00016 const char *test_name = "child-close"; 00017 00018 int 00019 main (int argc UNUSED, char *argv[]) 00020 { 00021 msg ("begin"); 00022 if (!isdigit (*argv[1])) 00023 fail ("bad command-line arguments"); 00024 close (atoi (argv[1])); 00025 msg ("end"); 00026 00027 return 0; 00028 }