Lines Matching refs:io
109 static bool read_until_char(struct io *io, char e) in read_until_char() argument
114 c = io__get_char(io); in read_until_char()
124 struct io io; in read_stat_field() local
127 io__init(&io, fd, buf, sizeof(buf)); in read_stat_field()
131 if (!read_until_char(&io, '\n')) in read_stat_field()
135 if (io__get_char(&io) != 'c') return -EINVAL; in read_stat_field()
136 if (io__get_char(&io) != 'p') return -EINVAL; in read_stat_field()
137 if (io__get_char(&io) != 'u') return -EINVAL; in read_stat_field()
140 if (!read_until_char(&io, ' ')) in read_stat_field()
145 if (io__get_dec(&io, val) != ' ') in read_stat_field()
157 struct io io; in read_pid_stat_field() local
160 io__init(&io, fd, buf, sizeof(buf)); in read_pid_stat_field()
161 if (io__get_dec(&io, val) != ' ') in read_pid_stat_field()
167 if (io__get_char(&io) != '(' || !read_until_char(&io, ')')) in read_pid_stat_field()
173 if (io__get_char(&io) != ' ' || io__get_char(&io) == -1) in read_pid_stat_field()
179 if (io__get_char(&io) != ' ') in read_pid_stat_field()
184 c = io__get_dec(&io, val); in read_pid_stat_field()
189 c = io__get_dec(&io, val); in read_pid_stat_field()