Example #1
0
static
void
remove_empty(void)
{
	int rv;
	rv = remove("");
	report_test2(rv, errno, EISDIR, EINVAL, "remove() on empty string");
}
Example #2
0
static
void
remove_dotdot(void)
{
	int rv;
	rv = remove("..");
	report_test2(rv, errno, EISDIR, EINVAL, "remove() on ..");
}
Example #3
0
static
void
kill_badpid(int pid, const char *desc)
{
	int rv;
	rv = kill(pid, 0);
	report_test2(rv, errno, EINVAL, NOSUCHPID_ERROR, desc);
}
Example #4
0
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);
}
Example #5
0
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");
}
Example #6
0
static
void
rmdir_dotdot(void)
{
	int rv;

	rv = rmdir("..");
	report_test2(rv, errno, EINVAL, ENOTEMPTY, "rmdir ..");
}
Example #7
0
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);
	}
}
Example #8
0
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);
}
Example #9
0
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");
}
Example #10
0
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);
}