{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

bad_readlink - report_test(rv errno EISDIR"readlink...

Info icon This 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));
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, "readlink on ."); } static void readlink_empty(void) { char buf[128]; int rv; rv = readlink("", buf, sizeof(buf)); report_test2(rv, errno, EISDIR, EINVAL, "readlink on empty string"); } void test_readlink(void) { test_readlink_path(); test_readlink_buf(); readlink_file(); readlink_dir(); readlink_empty(); }...
View Full Document

{[ snackBarMessage ]}