static void remove_empty(void) { int rv; rv = remove(""); report_test2(rv, errno, EISDIR, EINVAL, "remove() on empty string"); }
static void remove_dotdot(void) { int rv; rv = remove(".."); report_test2(rv, errno, EISDIR, EINVAL, "remove() on .."); }
static void kill_badpid(int pid, const char *desc) { int rv; rv = kill(pid, 0); report_test2(rv, errno, EINVAL, NOSUCHPID_ERROR, desc); }
static void wait_badpid(int pid, const char *desc) { int rv, x; rv = waitpid(pid, &x, 0); report_test2(rv, errno, EINVAL, NOSUCHPID_ERROR, desc); }
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"); }
static void rmdir_dotdot(void) { int rv; rv = rmdir(".."); report_test2(rv, errno, EINVAL, ENOTEMPTY, "rmdir .."); }
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); } }
static void any_empty(int (*statfunc)(const char *, struct stat *), const char *call) { struct stat sb; char desc[128]; int rv; snprintf(desc, sizeof(desc), "%s on empty string", call); rv = statfunc("", &sb); report_test2(rv, errno, 0, EINVAL, desc); }
static void chdir_empty(void) { int rv; /* * This is actually valid by some interpretations. */ rv = chdir(""); report_test2(rv, errno, EINVAL, 0, "chdir to empty string"); }
static void wait_badpid(pid_t pid, const char *desc) { pid_t rv; int x; rv = waitpid(pid, &x, 0); /* Allow ENOSYS for 0 or negative values of pid only */ if (pid <= 0 && rv == -1 && errno == ENOSYS) { errno = ESRCH; } report_test2(rv, errno, ESRCH, ECHILD, desc); }