Fix link errors with GCC 10 and binutils 2.34 on Fedora
[pintos-anon] / src / tests / userprog / child-close.c
index 83e3d06966cc8efabed1696a8ed5fc33f9511036..866e159a87b4293150fc2ee6c9a647f664ef5aa1 100644 (file)
@@ -1,14 +1,23 @@
+/* Child process run by multi-child-fd test.
+
+   Attempts to close the file descriptor passed as the first
+   command-line argument.  This is invalid, because file
+   descriptors are not inherited in Pintos.  Two results are
+   allowed: either the system call should return without taking
+   any action, or the kernel should terminate the process with a
+   -1 exit code. */
+
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <syscall.h>
 #include "tests/lib.h"
 
-const char *test_name = "child-close";
-
 int
 main (int argc UNUSED, char *argv[]) 
 {
+  test_name = "child-close";
+
   msg ("begin");
   if (!isdigit (*argv[1]))
     fail ("bad command-line arguments");