Lines Matching defs:out
28 conv=fsync Physically write data out before finishing
99 static struct io in, out;
133 //out to STDERR
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.
164 in.buff = out.buff = xmalloc(in.sz + ((toys.optflags & C_BS)? 0: out.sz));
165 in.bp = out.bp = in.buff;
176 if (!out.name) {
177 out.name = "stdout";
178 out.fd = STDOUT_FILENO;
180 out.fd = xcreate(out.name, O_WRONLY | O_CREAT, 0666);
181 out.fd = xmove_fd(out.fd);
200 if (out.offset) xlseek(out.fd, (off_t)(out.offset * out.sz), SEEK_CUR);
206 out.bp = out.buff;
207 while (out.count) {
208 nw = writeall(out.fd, out.bp, ((all)? out.count : out.sz));
210 if (nw <= 0) perror_exit("%s: write error",out.name);
211 if (nw == out.sz) st.out_full++;
213 out.count -= nw;
214 out.bp += nw;
216 if (out.count < out.sz) break;
218 if (out.count) memmove(out.buff, out.bp, out.count); //move remainder to front
234 ftruncate(out.fd, (off_t)out.offset * out.sz);
264 out.count = in.count;
271 if (in.count >= out.sz) {
273 in.count = out.count;
276 if (out.count) write_out(1); //write any remaining input blocks
277 if (toys.optflags & C_FSYNC && fsync(out.fd) < 0)
278 perror_exit("%s: fsync fail", out.name);
281 close(out.fd);
296 in.sz = out.sz = 512; //default io block size
308 in.sz = out.sz = strsuftoll(arg, 1, LONG_MAX);
316 if (!(toys.optflags & C_BS)) out.sz = sz;
325 out.name = arg;
328 out.offset = strsuftoll(arg, 0, ULLONG_MAX);