/* * This function closes the file specified by * file descriptor fd. */ #include int close(int fd) { /* * - Check that fd is a valid descriptor */ /* * - Attempt to close the specified file */ /* * - Return 0 for ok or -1 in case of error */ }