Lines Matching refs:nth_state
93 struct fail_nth_state *nth_state) in fail_nth_first() argument
98 nth_state->proc_fd = open(buf, O_RDWR); in fail_nth_first()
99 ASSERT_NE(-1, nth_state->proc_fd); in fail_nth_first()
103 struct fail_nth_state *nth_state, in fail_nth_next() argument
116 ASSERT_GT(400, nth_state->iteration); in fail_nth_next()
117 if (nth_state->iteration != 0) { in fail_nth_next()
126 res = pread(nth_state->proc_fd, buf, sizeof(buf), 0); in fail_nth_next()
133 res2 = pwrite(nth_state->proc_fd, disable_nth, in fail_nth_next()
136 res2 = pwrite(nth_state->proc_fd, disable_nth, in fail_nth_next()
153 nth_state->iteration++; in fail_nth_next()
163 struct fail_nth_state *nth_state) in __fail_nth_enable() argument
168 if (!nth_state->iteration) in __fail_nth_enable()
171 len = snprintf(buf, sizeof(buf), "%u", nth_state->iteration); in __fail_nth_enable()
172 ASSERT_EQ(len, pwrite(nth_state->proc_fd, buf, len, 0)); in __fail_nth_enable()
184 struct fail_nth_state nth_state = {}; \
190 fail_nth_first(_metadata, &nth_state); \
192 &nth_state)); \
193 while (fail_nth_next(_metadata, &nth_state, test_result)) { \
197 variant, &nth_state); \