bad_readlink

bad_readlink - report_test(rv, errno, EISDIR,...

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

View Full Document Right Arrow Icon
/* * readlink */ #include <unistd.h> #include <errno.h> #include "test.h" static void readlink_file(void) { char buf[128]; int fd, rv; fd = open_testfile("the question contains an invalid assumption"); if (fd<0) { return; } close(fd); rv = readlink(TESTFILE, buf, sizeof(buf)); report_test(rv, errno, EINVAL, "readlink on file"); remove(TESTFILE); } static void readlink_dir(void) { char buf[128]; int rv; rv = readlink(".", buf, sizeof(buf));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: report_test(rv, errno, EISDIR, &quot;readlink on .&quot;); } static void readlink_empty(void) { char buf[128]; int rv; rv = readlink(&quot;&quot;, buf, sizeof(buf)); report_test2(rv, errno, EISDIR, EINVAL, &quot;readlink on empty string&quot;); } void test_readlink(void) { test_readlink_path(); test_readlink_buf(); readlink_file(); readlink_dir(); readlink_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