Lines Matching +full:tv +full:- +full:set

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
86 .buflen = (cur != -1) ? READ_BUFLEN : 1, in fdctx_init()
87 .ep = &fdc->buf[0], /* No data */ in fdctx_init()
96 if (&fdc->buf[fdc->off] == fdc->ep) { in fdgetc()
97 nread = read(fdc->fd, fdc->buf, fdc->buflen); in fdgetc()
99 fdc->off = 0; in fdgetc()
100 fdc->ep = fdc->buf + nread; in fdgetc()
104 *c = fdc->buf[fdc->off++]; in fdgetc()
114 if (fdc->buflen > 1) { in fdctx_destroy()
120 * |*****************|-------| in fdctx_destroy()
122 * |<- residue ->| in fdctx_destroy()
128 residue = (fdc->ep - fdc->buf) - fdc->off; in fdctx_destroy()
130 (void) lseek(fdc->fd, -residue, SEEK_CUR); in fdctx_destroy()
135 * The read builtin. The -r option causes backslashes to be treated like
165 struct timeval tv; in readcmd() local
174 tv.tv_sec = -1; in readcmd()
175 tv.tv_usec = 0; in readcmd()
187 tv.tv_sec = strtol(shoptarg, &tvptr, 0); in readcmd()
195 tv.tv_sec *= 60; in readcmd()
198 tv.tv_sec *= 60; in readcmd()
215 if (tv.tv_sec >= 0) { in readcmd()
221 status = select(1, &ifds, NULL, NULL, &tv); in readcmd()
237 lastnonifs = lastnonifsws = -1; in readcmd()
242 if (nread == -1) { in readcmd()
264 lastnonifs = lastnonifsws = p - stackblock(); in readcmd()
288 /* Only one non-whitespace IFS per word */ in readcmd()
291 lastnonifsws = p - stackblock(); in readcmd()
304 lastnonifs = lastnonifsws = p - stackblock(); in readcmd()
316 lastnonifsws = p - stackblock(); in readcmd()
325 lastnonifs = lastnonifsws = -1; in readcmd()
332 * non-whitespace unless it was naked in readcmd()
339 /* Set any remaining args to "" */ in readcmd()
405 mask = (mask << 3) + (*ap - '0'); in umaskcmd()
409 void *set; in umaskcmd() local
411 if ((set = setmode (ap)) == NULL) in umaskcmd()
414 mask = getmode (set, ~mask & 0777); in umaskcmd()
416 free(set); in umaskcmd()
446 { "file size", "512-blocks", RLIMIT_FSIZE, 512, 'f' },
455 { "core file size", "512-blocks", RLIMIT_CORE, 512, 'c' },
479 { "pseudo-terminals", (char *)0, RLIMIT_NPTS, 1, 'p' },
502 val = limit->rlim_cur; in printlimit()
504 val = limit->rlim_max; in printlimit()
509 val /= l->factor; in printlimit()
520 int set, all = 0; in ulimitcmd() local
540 for (l = limits; l->name && l->option != what; l++) in ulimitcmd()
542 if (!l->name) in ulimitcmd()
545 set = *argptr ? 1 : 0; in ulimitcmd()
546 if (set) { in ulimitcmd()
563 if (uval > UINTMAX_MAX / l->factor) in ulimitcmd()
565 uval *= l->factor; in ulimitcmd()
573 for (l = limits; l->name; l++) { in ulimitcmd()
575 if (getrlimit(l->cmd, &limit) < 0) in ulimitcmd()
578 if (l->units) in ulimitcmd()
580 "(%s, -%c) ", l->units, l->option); in ulimitcmd()
583 "(-%c) ", l->option); in ulimitcmd()
584 out1fmt("%-18s %18s ", l->name, optbuf); in ulimitcmd()
590 if (getrlimit(l->cmd, &limit) < 0) in ulimitcmd()
592 if (set) { in ulimitcmd()
597 if (setrlimit(l->cmd, &limit) < 0) in ulimitcmd()