static void setup(void) { fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644); SAFE_FTRUNCATE(fd1, getpagesize()); fd2 = SAFE_OPEN("file2", O_RDONLY | O_CREAT, 0644); SAFE_PIPE(fd4); wr_iovec3[0].iov_base = tst_get_bad_addr(NULL); }
/*************************************************************** * setup() - performs all ONE TIME setup for this test. ***************************************************************/ void setup(void) { tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; /* Create a temporary directory and make it current. */ tst_tmpdir(); bad_addr = tst_get_bad_addr(cleanup); }
static void setup(void) { int fildes; char nobody_uid[] = "nobody"; struct passwd *ltpuser; umask(0); SAFE_CREAT(user2_fname, 0600); /* Switch to nobody user for correct error code collection */ ltpuser = getpwnam(nobody_uid); SAFE_SETGID(ltpuser->pw_gid); SAFE_SETUID(ltpuser->pw_uid); fildes = SAFE_CREAT(existing_fname, 0600); close(fildes); unmapped_fname = tst_get_bad_addr(NULL); }