Home | History | Annotate | Download | only in pending

Lines Matching defs:in

99 static struct io in, out;
134 fprintf(stderr,"%llu+%llu records in\n%llu+%llu records out\n", st.in_full, st.in_part,
161 /* for C_BS, in/out is done as it is. so only in.sz is enough.
162 * With Single buffer there will be overflow in a read following partial read
164 in.buff = out.buff = xmalloc(in.sz + ((toys.optflags & C_BS)? 0: out.sz));
165 in.bp = out.bp = in.buff;
168 if (!in.name) {
169 in.name = "stdin";
170 in.fd = STDIN_FILENO;
172 in.fd = xopen(in.name, O_RDONLY);
173 in.fd = xmove_fd(in.fd);
184 if (in.offset) {
185 if (lseek(in.fd, (off_t)(in.offset * in.sz), SEEK_CUR) < 0) {
186 while (in.offset--) {
187 if ((n = read(in.fd, in.bp, in.sz)) < 0) {
189 error_msg("%s: read error", in.name);
191 } else perror_exit("%s: read error", in.name);
193 xprintf("%s: Can't skip\n", in.name);
241 in.bp = in.buff + in.count;
242 if (toys.optflags & C_SYNC) memset(in.bp, 0, in.sz);
243 if (!(n = read(in.fd, in.bp, in.sz))) break;
247 perror_msg("%s: read error", in.name);
250 xlseek(in.fd, in.sz, SEEK_CUR);
253 n = in.sz;
255 if (n == in.sz) {
257 in.count += n;
260 if (toys.optflags & C_SYNC) in.count += in.sz;
261 else in.count += n;
264 out.count = in.count;
267 in.count = 0;
271 if (in.count >= out.sz) {
273 in.count = out.count;
280 close(in.fd);
282 if (in.buff) free(in.buff);
296 in.sz = out.sz = 512; //default io block size
308 in.sz = out.sz = strsuftoll(arg, 1, LONG_MAX);
312 if (!(toys.optflags & C_BS)) in.sz = sz;
322 in.name = arg;
331 in.offset = strsuftoll(arg, 0, ULLONG_MAX);