bad_open - } static void open_empty(void) { int rv; rv =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * invalid calls to open() */ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <err.h> #include "config.h" #include "test.h" static void open_badflags(void) { int fd; fd = open("null:", 309842); report_test(fd, errno, EINVAL, "open null: with bad flags");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } static void open_empty(void) { int rv; rv = open("", O_RDONLY); report_test2(rv, errno, 0, EINVAL, "open empty string"); if (rv>=0) { close(rv); } } void test_open(void) { test_open_path(); open_badflags(); open_empty(); }...
View Full Document

This note was uploaded on 11/10/2009 for the course CS 536 taught by Professor Lums during the Spring '09 term at Indiana.

Ask a homework question - tutors are online