Lines Matching refs:fd
42 int fd[N]; in ZTEST() local
60 fd[0] = shm_open(VALID_SHM_PATH, VALID_FLAGS, VALID_MODE); in ZTEST()
61 zassert_true(fd[0] >= 0, "shm_open(%s, %x, %04o) failed: %d", VALID_SHM_PATH, VALID_FLAGS, in ZTEST()
65 zassert_ok(fstat(fd[0], &st)); in ZTEST()
70 zassert_ok(close(fd[0])); in ZTEST()
77 fd[i] = shm_open(VALID_SHM_PATH, i == 0 ? CREATE_FLAGS : OPEN_FLAGS, VALID_MODE); in ZTEST()
78 zassert_true(fd[i] >= 0, "shm_open(%s, %x, %04o) failed: %d", VALID_SHM_PATH, in ZTEST()
83 zassert_ok(close(fd[i - 1])); in ZTEST()
89 int fd; in ZTEST() local
100 fd = shm_open(VALID_SHM_PATH, VALID_FLAGS, VALID_MODE); in ZTEST()
101 zassert_true(fd >= 0, "shm_open(%s, %x, %04o) failed: %d", VALID_SHM_PATH, VALID_FLAGS, in ZTEST()
104 zassert_ok(close(fd)); in ZTEST()
112 int fd[N]; in ZTEST() local
117 fd[i] = shm_open(VALID_SHM_PATH, i == 0 ? CREATE_FLAGS : OPEN_FLAGS, VALID_MODE); in ZTEST()
118 zassert_true(fd[i] >= 0, "shm_open(%s, %x, %04o) failed: %d", VALID_SHM_PATH, in ZTEST()
122 zassert_equal(write(fd[0], "", 1), 0, in ZTEST()
125 zassert_equal(read(fd[0], &cbuf, 1), 0, in ZTEST()
129 zassert_ok(ftruncate(fd[0], SHM_SIZE)); in ZTEST()
131 zassert_equal(write(fd[0], "\x42", 1), 1, "write() failed on fd %d: %d\n", in ZTEST()
132 fd[0], errno); in ZTEST()
137 zassert_equal(read(fd[i], &cbuf, 1), 1, "read() failed on fd %d: %d\n", fd[i], in ZTEST()
141 fd[i], 0x42, cbuf); in ZTEST()
145 zassert_ok(close(fd[i - 1])); in ZTEST()
153 int fd[N]; in ZTEST() local
161 fd[i] = shm_open(VALID_SHM_PATH, i == 0 ? CREATE_FLAGS : OPEN_FLAGS, VALID_MODE); in ZTEST()
162 zassert_true(fd[i] >= 0, "shm_open(%s, %x, %04o) failed: %d", VALID_SHM_PATH, in ZTEST()
168 fd[0], 0)); in ZTEST()
170 zassert_ok(ftruncate(fd[0], PAGE_SIZE)); in ZTEST()
173 addr[i] = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd[i], 0); in ZTEST()
184 zassert_ok(close(fd[i - 1])); in ZTEST()