Lines Matching +full:r +full:- +full:xp

6 /*-
14 * is granted to deal in this work without restriction, including un-
46 * use killpg if < -1 since -1 does special things
47 * for some non-killpg-endowed kills
49 #define mksh_kill(p,s) ((p) < -1 ? killpg(-(p), (s)) : kill((p), (s)))
51 /* cross fingers and hope kill is killpg-endowed */
96 * A leading ^ means declaration utility, - forwarder.
186 /* 0*/ {"-a", TO_FILAXST },
187 {"-b", TO_FILBDEV },
188 {"-c", TO_FILCDEV },
189 {"-d", TO_FILID },
190 {"-e", TO_FILEXST },
191 {"-f", TO_FILREG },
192 {"-G", TO_FILGID },
193 {"-g", TO_FILSETG },
194 {"-H", TO_FILCDF },
195 {"-h", TO_FILSYM },
196 {"-k", TO_FILSTCK },
197 {"-L", TO_FILSYM },
198 /*12*/ {"-n", TO_STNZE },
199 {"-O", TO_FILUID },
200 /*14*/ {"-o", TO_OPTION },
201 {"-p", TO_FILFIFO },
202 /*16*/ {"-r", TO_FILRD },
203 {"-S", TO_FILSOCK },
204 {"-s", TO_FILGZ },
205 {"-t", TO_FILTT },
206 /*20*/ {"-u", TO_FILSETU },
207 {"-v", TO_ISSET },
208 {"-w", TO_FILWR },
209 /*23*/ {"-x", TO_FILEX },
210 {"-z", TO_STZER },
220 {"-eq", TO_INTEQ },
221 {"-ne", TO_INTNE },
222 {"-gt", TO_INTGT },
223 {"-ge", TO_INTGE },
224 {"-lt", TO_INTLT },
225 {"-le", TO_INTLE },
226 {"-ef", TO_FILEQ },
227 {"-nt", TO_FILNT },
228 {"-ot", TO_FILOT },
250 while ((optc = ksh_getopt(wp, &builtin_opt, "LP")) != -1) in c_pwd()
291 char *xp; in c_print() local
345 /*- in c_print()
347 * recognise -Een if they appear in arguments with in c_print()
348 * no illegal options; e.g. echo -nq outputs '-nq' in c_print()
351 /* MidnightBSD /bin/sh needs -e supported but off */ in c_print()
356 /* otherwise compromise on -e enabled by default */ in c_print()
361 if ((s = *wp) && *s++ == '-' && *s) { in c_print()
389 while ((c = ksh_getopt(wp, &builtin_opt, opts)) != -1) in c_print()
416 case 'R': in c_print()
420 case 'r': in c_print()
430 bi_errorf("-u%s: %s", s, emsg); in c_print()
439 /* treat a lone "-" like "--" */ in c_print()
454 Xinit(xs, xp, 128, ATEMP); in c_print()
466 Xcheck(xs, xp); in c_print()
471 Xput(xs, xp, po.ts[c]); in c_print()
474 Xput(xs, xp, po.wc & 0xFF); in c_print()
479 Xcheck(xs, xp); in c_print()
484 if (c == -1) { in c_print()
492 --s; in c_print()
496 Xput(xs, xp, '\\'); in c_print()
500 po.ts[utf_wctomb(po.ts, c - 0x100)] = 0; in c_print()
503 Xput(xs, xp, po.ts[c]); in c_print()
508 Xput(xs, xp, c); in c_print()
512 Xput(xs, xp, '\0'); in c_print()
513 XPput(po.words, Xclose(xs, xp)); in c_print()
514 Xinit(xs, xp, 128, ATEMP); in c_print()
518 Xput(xs, xp, po.ws); in c_print()
530 while (w--) in c_print()
533 w = co.shf->wp - co.shf->buf; in c_print()
534 XcheckN(xs, xp, w); in c_print()
535 memcpy(xp, co.shf->buf, w); in c_print()
536 xp += w; in c_print()
541 Xput(xs, xp, po.ls); in c_print()
545 Xput(xs, xp, '\0'); in c_print()
546 histsave(&source->line, Xstring(xs, xp), HIST_STORE, false); in c_print()
548 size_t len = Xlength(xs, xp); in c_print()
553 * to just check that the co-process is alive which is in c_print()
562 s = Xstring(xs, xp); in c_print()
581 len -= nwritten; in c_print()
586 Xfree(xs, xp); in c_print()
600 --s_ptr; in s_put()
609 while ((optc = ksh_getopt(wp, &builtin_opt, Tpv)) != -1) in c_whence()
626 /* note: command without -vV is dealt with in comexec() */
633 while ((optc = ksh_getopt(wp, &builtin_opt, TpVv)) != -1) in c_command()
668 if (tp && !(tp->flag & ISSET)) in do_whence()
674 switch (tp->type) { in do_whence()
682 switch (tp->type) { in do_whence()
686 (tp->flag & SPEC_BI) ? "special " : "", in do_whence()
692 if (tp->flag & EXPORT) in do_whence()
694 if (tp->flag & TRACE) in do_whence()
696 if (!(tp->flag & ISSET)) { in do_whence()
698 if (tp->u.fpath) in do_whence()
700 tp->u.fpath); in do_whence()
707 if (tp->flag & ISSET) { in do_whence()
710 if (tp->type == CTALIAS) in do_whence()
712 (tp->flag & EXPORT) ? in do_whence()
716 shf_puts(tp->val.s, shl_stdout); in do_whence()
730 (tp->flag & EXPORT) ? "exported " : "", in do_whence()
734 print_value_quoted(shl_stdout, tp->val.s); in do_whence()
742 bi_errorf(Tunexpected_type, id, Tcommand, tp->type); in do_whence()
757 case ORD('-'): in valid_alias_name()
782 while ((optc = ksh_getopt(wp, &builtin_opt, "dprtUx")) != -1) { in c_alias()
783 prefix = builtin_opt.info & GI_PLUS ? '+' : '-'; in c_alias()
787 t = NULL; /* fix "alias -dt" */ in c_alias()
795 case 'r': in c_alias()
830 /* "hash -r" means reset all the tracked aliases.. */ in c_alias()
833 Tunalias, "-ta", NULL in c_alias()
837 shprintf("%s: -r flag can only be used with -t" in c_alias()
849 if ((ap->flag & (ISSET|xflag)) == (ISSET|xflag)) { in c_alias()
852 print_value_quoted(shl_stdout, ap->name); in c_alias()
855 print_value_quoted(shl_stdout, ap->val.s); in c_alias()
868 strndupx(xalias, alias, val++ - alias, ATEMP); in c_alias()
879 if (ap != NULL && (ap->flag&ISSET)) { in c_alias()
882 print_value_quoted(shl_stdout, ap->name); in c_alias()
885 print_value_quoted(shl_stdout, ap->val.s); in c_alias()
895 ap->type = tflag ? CTALIAS : CALIAS; in c_alias()
898 if (ap->flag&ALLOC) { in c_alias()
899 ap->flag &= ~(ALLOC|ISSET); in c_alias()
900 afree(ap->val.s, APERM); in c_alias()
902 /* ignore values for -t (AT&T ksh does this) */ in c_alias()
907 strdupx(ap->val.s, newval, APERM); in c_alias()
908 ap->flag |= ALLOC|ISSET; in c_alias()
910 ap->flag &= ~ISSET; in c_alias()
912 ap->flag |= DEFINED; in c_alias()
914 ap->flag &= ~xflag; in c_alias()
916 ap->flag |= xflag; in c_alias()
931 while ((optc = ksh_getopt(wp, &builtin_opt, "adt")) != -1) in c_unalias()
938 /* fix "unalias -dt" */ in c_unalias()
963 if (ap->flag&ALLOC) { in c_unalias()
964 ap->flag &= ~(ALLOC|ISSET); in c_unalias()
965 afree(ap->val.s, APERM); in c_unalias()
967 ap->flag &= ~(DEFINED|ISSET|EXPORT); in c_unalias()
974 if (ap->flag&ALLOC) { in c_unalias()
975 ap->flag &= ~(ALLOC|ISSET); in c_unalias()
976 afree(ap->val.s, APERM); in c_unalias()
978 ap->flag &= ~(DEFINED|ISSET|EXPORT); in c_unalias()
1010 while ((optc = ksh_getopt(wp, &builtin_opt, "lpnz")) != -1) in c_jobs()
1023 nflag = -1; in c_jobs()
1072 ki->num_width, i, in kill_fmt_entry()
1073 ki->name_width, sigtraps[i].name, in kill_fmt_entry()
1085 /* assume old style options if -digits or -UPPERCASE */ in c_kill()
1086 if ((p = wp[1]) && *p == '-' && ctype(p[1], C_DIGIT | C_UPPER)) { in c_kill()
1091 i = (wp[2] && strcmp(wp[2], "--") == 0) ? 3 : 2; in c_kill()
1095 while ((optc = ksh_getopt(wp, &builtin_opt, "ls:")) != -1) in c_kill()
1115 shf_puts("usage:\tkill [-s signame | -signum | -signame]" in c_kill()
1117 "\tkill -l [exit_status ...]\n", shl_out); in c_kill()
1130 n -= 128; in c_kill()
1146 int j = ksh_NSIG - 1; in c_kill()
1170 print_columns(&co, (unsigned int)(ksh_NSIG - 1), in c_kill()
1178 sig = t ? t->signal : SIGTERM; in c_kill()
1235 if (e->loc->next == NULL) { in c_getopts()
1241 wp = e->loc->next->argv; in c_getopts()
1243 *--wp = e->loc->next->argv[0]; in c_getopts()
1250 user_opt.p > strlen(wp[user_opt.optind - 1]))) { in c_getopts()
1264 * POSIX says var is set to ? at end-of-options, AT&T ksh in c_getopts()
1265 * sets it to null - we go with POSIX... in c_getopts()
1276 voptarg->flag &= ~RDONLY; in c_getopts()
1278 if (voptarg->flag & INTEGER) in c_getopts()
1312 while ((optc = ksh_getopt(wp, &builtin_opt, "lm")) != -1) in c_bind()
1343 struct block *l = e->loc; in c_shift()
1345 if ((l->flags & BF_RESETSPEC)) { in c_shift()
1347 l->flags &= ~BF_RESETSPEC; in c_shift()
1349 l = l->next; in c_shift()
1370 if (l->argc < n) { in c_shift()
1374 l->argv[n] = l->argv[0]; in c_shift()
1375 l->argv += n; in c_shift()
1376 l->argc -= n; in c_shift()
1388 while ((optc = ksh_getopt(wp, &builtin_opt, "S")) != -1) in c_umask()
1410 if (old_umask & (1 << (8 - (3*i + j)))) in c_umask()
1414 p[-1] = '\0'; in c_umask()
1467 case 'r': new_val |= 04; break; in c_umask()
1489 case '-': in c_umask()
1542 argv[0] = e->loc->argv[0]; in c_dot()
1578 /* magic exit code: bad job-id */ in c_wait()
1596 char *cp, *allocd = NULL, *xp; in c_read() local
1602 /* to catch read -aN2 foo[i] */ in c_read()
1616 while ((c = ksh_getopt(wp, &builtin_opt, c_read_opts)) != -1) in c_read()
1632 if (c == -1) { in c_read()
1644 case 'r': in c_read()
1673 *--wp = TREPLY; in c_read()
1682 allocd[ccp - *wp] = '\0'; in c_read()
1696 Xinit(xs, xp, bytesleft, ATEMP); in c_read()
1746 if ((bytesread = blocking_read(fd, xp, bytesleft)) == (size_t)-1) { in c_read()
1777 xp += bytesread; in c_read()
1778 XcheckN(xs, xp, bytesleft); in c_read()
1785 xp += bytesread; in c_read()
1795 xp += bytesread; in c_read()
1796 if ((bytesleft -= bytesread) == 0) in c_read()
1805 if ((c = *xp) == '\0' && !aschars && delim != '\0') { in c_read()
1821 --xp; in c_read()
1830 Xcheck(xs, xp); in c_read()
1831 ++xp; in c_read()
1837 bytesread = Xlength(xs, xp); in c_read()
1838 Xput(xs, xp, '\0'); in c_read()
1840 /*- in c_read()
1842 * Xstring(xs, xp) -> xp-1 = input string without trailing delim in c_read()
1855 histsave(&source->line, Xstring(xs, xp), HIST_STORE, false); in c_read()
1857 ccp = cp = Xclose(xs, xp); in c_read()
1863 if (vp->flag & RDONLY) { in c_read()
1880 --bytesread; in c_read()
1883 while (bytesread && is_ifsws(ccp[bytesread - 1])) { in c_read()
1884 --bytesread; in c_read()
1888 xp = Xstring(xs, xp); in c_read()
1898 Xput(xs, xp, '1'); in c_read()
1899 Xput(xs, xp, '#'); in c_read()
1902 *xp++ = *ccp++; in c_read()
1903 --bytesleft; in c_read()
1904 --bytesread; in c_read()
1906 if (xp[-1] == '\0') { in c_read()
1907 xp[-1] = '0'; in c_read()
1908 xp[-3] = '2'; in c_read()
1931 Xcheck(xs, xp); in c_read()
1932 Xput(xs, xp, ch); in c_read()
1935 --bytesread; in c_read()
1937 xsave = Xsavepos(xs, xp); in c_read()
1949 Xcheck(xs, xp); in c_read()
1950 Xput(xs, xp, ch); in c_read()
1953 --bytesread; in c_read()
1960 Xcheck(xs, xp); in c_read()
1961 Xput(xs, xp, *ccp); in c_read()
1963 --bytesread; in c_read()
1972 xp = Xrestpos(xs, xp, xsave); in c_read()
1974 Xput(xs, xp, '\0'); in c_read()
1985 vq->flag |= AINDEX; in c_read()
1991 if (vq->flag & RDONLY) in c_read()
1996 if (!setstr(vq, Xstring(xs, xp), KSH_RETURN_ERROR)) in c_read()
2001 vq->type = 0; in c_read()
2012 Xfree(xs, xp); in c_read()
2028 s->u.strv = wp + builtin_opt.optind; in c_eval()
2029 s->line = current_lineno; in c_eval()
2031 /*- in c_eval()
2043 * do. The following is an excerpt from SUSv4 [1003.2-2008]: in c_eval()
2054 * special built-in utility, that special built-in in c_eval()
2087 if (p->trap) { in c_trap()
2088 shf_puts("trap -- ", shl_stdout); in c_trap()
2089 print_value_quoted(shl_stdout, p->trap); in c_trap()
2090 shprintf(Tf__sN, p->name); in c_trap()
2093 } while (i--); in c_trap()
2112 warningf(true, Tbad_sig_ss, builtin_argv0, wp[-1]); in c_trap()
2128 } else if (trap_exstat != -1) in c_exitreturn()
2131 if (wp[0][0] == 'r') { in c_exitreturn()
2139 for (ep = e; ep; ep = ep->oenv) in c_exitreturn()
2140 if (STOP_RETURN(ep->type)) { in c_exitreturn()
2178 /* AT&T ksh does this for non-interactive shells only - weird */ in c_brkcont()
2185 for (ep = e; ep && !STOP_BRKCONT(ep->type); ep = ep->oenv) in c_brkcont()
2186 if (ep->type == E_LOOP) { in c_brkcont()
2187 if (--quit == 0) in c_brkcont()
2189 ep->flags |= EF_BRKCONT_PASS; in c_brkcont()
2195 * AT&T ksh doesn't print a message - just does what it in c_brkcont()
2209 last_ep->flags &= ~EF_BRKCONT_PASS; in c_brkcont()
2211 wp[0], wp[0], (unsigned int)n - quit); in c_brkcont()
2226 struct block *l = e->loc; in c_set()
2228 if ((l->flags & BF_RESETSPEC)) { in c_set()
2230 l->flags &= ~BF_RESETSPEC; in c_set()
2232 l = l->next; in c_set()
2236 static const char *args[] = { Tset, "-", NULL }; in c_set()
2246 wp += argi - 1; in c_set()
2249 wp[0] = l->argv[0]; in c_set()
2251 strdupx(*wp, *wp, &l->area); in c_set()
2252 l->argc = wp - owp - 1; in c_set()
2253 l->argv = alloc2(l->argc + 2, sizeof(char *), &l->area); in c_set()
2254 for (wp = l->argv; (*wp++ = *owp++) != NULL; ) in c_set()
2257 /*- in c_set()
2260 * set -- $(getopt ab:c "$@") in c_set()
2266 /* traditional behaviour, unless set -o posix */ in c_set()
2269 /* conformant behaviour, unless set -o sh +o posix */ in c_set()
2281 while ((optc = ksh_getopt(wp, &builtin_opt, "fv")) != -1) in c_unset()
2302 if (n > 3 && ord(id[n - 3]) == ORD('[') && in c_unset()
2303 ord(id[n - 2]) == ORD('*') && in c_unset()
2304 ord(id[n - 1]) == ORD(']')) { in c_unset()
2305 strndupx(cp, id, n - 3, ATEMP); in c_unset()
2314 if ((vp->flag&RDONLY)) { in c_unset()
2315 warningf(true, Tf_ro, vp->name); in c_unset()
2359 * time pipeline (really a statement, not a built-in command)
2374 if (t->left) { in timex()
2378 * finish while we are executing t->left), or get the in timex()
2379 * cpu usage of t->left. AT&T ksh does the former, while in timex()
2385 rv = execute(t->left, f | XTIME, xerrok); in timex()
2386 if (t->left->type == TCOM) in timex()
2387 tf |= t->left->str[0]; in timex()
2395 /* ksh93 - report shell times (shell+kids) */ in timex()
2442 while ((optc = ksh_getopt((const char **)wp, &opt, ":p")) != -1) in timex_hook()
2445 t->str[0] |= TF_POSIX; in timex_hook()
2462 t->str[0] |= TF_NOARGS; in timex_hook()
2466 /* exec with no args - args case is taken care of in comexec() */
2473 if (e->savefd != NULL) { in c_exec()
2475 if (e->savefd[i] > 0) in c_exec()
2476 close(e->savefd[i]); in c_exec()
2482 e->savefd[i]) in c_exec()
2485 e->savefd = NULL; in c_exec()
2500 while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) { in c_mknod()
2570 bi_errorf("usage: mknod [-m mode] name %s", "b|c major minor"); in c_mknod()
2571 bi_errorf("usage: mknod [-m mode] name %s", "p"); in c_mknod()
2576 /*-
2578 * oexpr ::= aexpr | aexpr "-o" oexpr ;
2579 * aexpr ::= nexpr | nexpr "-a" aexpr ;
2581 * primary ::= unary-operator operand
2582 * | operand binary-operator operand
2587 * unary-operator ::= "-a"|"-b"|"-c"|"-d"|"-e"|"-f"|"-G"|"-g"|"-H"|"-h"|
2588 * "-k"|"-L"|"-n"|"-O"|"-o"|"-p"|"-r"|"-S"|"-s"|"-t"|
2589 * "-u"|"-v"|"-w"|"-x"|"-z";
2591 * binary-operator ::= "="|"=="|"!="|"<"|">"|"-eq"|"-ne"|"-gt"|"-ge"|
2592 * "-lt"|"-le"|"-ef"|"-nt"|"-ot";
2619 if (strcmp(wp[--argc], "]") != 0) { in c_test()
2630 * dumb code straight-forward from the 2008 spec, but unlike in c_test()
2634 switch (argc - 1) { in c_test()
2739 for (; tbl->op_text[0]; tbl++) in test_isop()
2740 if (sc1 == tbl->op_text[1] && !strcmp(s, tbl->op_text)) in test_isop()
2741 return (tbl->op_num); in test_isop()
2764 if (sb1->st_mtime < sb2->st_mtime) in mtimecmp()
2765 return (-1); in mtimecmp()
2766 if (sb1->st_mtime > sb2->st_mtime) in mtimecmp()
2769 if (sb1->st_mtimensec < sb2->st_mtimensec) in mtimecmp()
2770 return (-1); in mtimecmp()
2771 if (sb1->st_mtimensec > sb2->st_mtimensec) in mtimecmp()
2808 te->flags |= TEF_ERROR; in test_eval()
2824 /* -n */ in test_eval()
2828 /* -z */ in test_eval()
2832 /* -v */ in test_eval()
2834 return ((vp = isglobal(opnd1, false)) && (vp->flag & ISSET)); in test_eval()
2836 /* -o */ in test_eval()
2840 if ((k = option(opnd1)) == (size_t)-1) in test_eval()
2844 /* -r */ in test_eval()
2849 /* -w */ in test_eval()
2854 /* -x */ in test_eval()
2858 /* -a */ in test_eval()
2860 /* -e */ in test_eval()
2864 /* -f */ in test_eval()
2868 /* -d */ in test_eval()
2872 /* -c */ in test_eval()
2876 /* -b */ in test_eval()
2880 /* -p */ in test_eval()
2884 /* -h or -L */ in test_eval()
2892 /* -S */ in test_eval()
2896 /* -H => HP context dependent files (directories) */ in test_eval()
2921 /* -u */ in test_eval()
2926 /* -g */ in test_eval()
2931 /* -k */ in test_eval()
2940 /* -s */ in test_eval()
2945 /* -t */ in test_eval()
2948 te->flags |= TEF_ERROR; in test_eval()
2954 /* -O */ in test_eval()
2959 /* -G */ in test_eval()
2970 if (te->flags & TEF_DBRACKET) { in test_eval()
2979 if (te->flags & TEF_DBRACKET) { in test_eval()
2994 /* -nt */ in test_eval()
3004 /* -ot */ in test_eval()
3014 /* -ef */ in test_eval()
3026 /* -eq */ in test_eval()
3028 /* -ne */ in test_eval()
3030 /* -ge */ in test_eval()
3032 /* -gt */ in test_eval()
3034 /* -le */ in test_eval()
3036 /* -lt */ in test_eval()
3041 te->flags |= TEF_ERROR; in test_eval()
3063 (*te->error)(te, 0, "internal error: unknown op"); in test_eval()
3074 if (!(te->flags & TEF_ERROR) && !(*te->isa)(te, TM_END)) in test_parse()
3075 (*te->error)(te, 0, "unexpected operator/operand"); in test_parse()
3077 return ((te->flags & TEF_ERROR) ? T_ERR_EXIT : !rv); in test_parse()
3087 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_OR)) in test_oexpr()
3099 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_AND)) in test_aexpr()
3107 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_NOT)) in test_nexpr()
3119 if (te->flags & TEF_ERROR) in test_primary()
3121 if ((*te->isa)(te, TM_OPAREN)) { in test_primary()
3123 if (te->flags & TEF_ERROR) in test_primary()
3125 if (!(*te->isa)(te, TM_CPAREN)) { in test_primary()
3126 (*te->error)(te, 0, "missing )"); in test_primary()
3133 * so that something like test \( -f = -f \) is accepted in test_primary()
3135 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end && in test_primary()
3136 !test_isop(TM_BINOP, te->pos.wp[1]))) { in test_primary()
3137 if ((op = (*te->isa)(te, TM_UNOP))) { in test_primary()
3139 opnd1 = (*te->getopnd)(te, op, do_eval); in test_primary()
3141 (*te->error)(te, -1, Tno_args); in test_primary()
3145 return ((*te->eval)(te, op, opnd1, NULL, do_eval)); in test_primary()
3148 opnd1 = (*te->getopnd)(te, TO_NONOP, do_eval); in test_primary()
3150 (*te->error)(te, 0, "expression expected"); in test_primary()
3153 if ((op = (*te->isa)(te, TM_BINOP))) { in test_primary()
3155 opnd2 = (*te->getopnd)(te, op, do_eval); in test_primary()
3157 (*te->error)(te, -1, "missing second argument"); in test_primary()
3161 return ((*te->eval)(te, op, opnd1, opnd2, do_eval)); in test_primary()
3163 return ((*te->eval)(te, TO_STNZE, opnd1, NULL, do_eval)); in test_primary()
3172 * it is. Returns 0 if it is not, non-zero if it is (in the case of
3178 /* Order important - indexed by Test_meta values */ in ptest_isa()
3184 if (te->pos.wp >= te->wp_end) in ptest_isa()
3188 rv = test_isop(meta, *te->pos.wp); in ptest_isa()
3192 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ? in ptest_isa()
3197 te->pos.wp++; in ptest_isa()
3205 if (te->pos.wp >= te->wp_end) in ptest_getopnd()
3207 return (*te->pos.wp++); in ptest_getopnd()
3215 te->flags |= TEF_ERROR; in ptest_error()
3216 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs])) in ptest_error()
3319 while ((optc = ksh_getopt(wp, &builtin_opt, rlimits_opts)) != -1) in c_ulimit()
3331 bi_errorf("usage: ulimit [-%s] [value]", rlimits_opts); in c_ulimit()
3338 if (rlimits[i]->optchar == what) in c_ulimit()
3355 shprintf("-%c: %-20s ", rlimits[i]->optchar, rlimits[i]->name); in c_ulimit()
3381 bi_errorf("invalid %s limit: %s", l->name, v); in set_ulimit()
3384 val = (rlim_t)((rlim_t)rval * l->factor); in set_ulimit()
3387 if (getrlimit(l->resource, &limit) < 0) { in set_ulimit()
3390 l->name, cstrerror(errno)); in set_ulimit()
3400 if (!setrlimit(l->resource, &limit)) in set_ulimit()
3403 bi_errorf("%s exceeds allowable %s limit", v, l->name); in set_ulimit()
3405 bi_errorf("bad %s limit: %s", l->name, cstrerror(errno)); in set_ulimit()
3415 if (getrlimit(l->resource, &limit)) { in print_ulimit()
3426 shprintf("%lu\n", (unsigned long)(val / l->factor)); in print_ulimit()
3437 if (wp[0] && !strcmp(wp[0], "--")) in c_rename()
3438 /* skip "--" (options separator) */ in c_rename()
3462 if (wp[0] && !strcmp(wp[0], "--")) in c_realpath()
3463 /* skip "--" (options separator) */ in c_realpath()
3493 /* parse options: POSIX demands we support "-u" as no-op */ in c_cat()
3494 while ((rv = ksh_getopt(wp, &builtin_opt, Tu)) != -1) { in c_cat()
3528 MKSH_CAT_BUFSIZ)) == -1) { in c_cat()
3548 if ((w = write(STDOUT_FILENO, cp, n)) != -1) { in c_cat()
3549 n -= w; in c_cat()
3597 if (wp[0] && !strcmp(wp[0], "--")) in c_sleep()
3598 /* skip "--" (options separator) */ in c_sleep()
3636 /* this will re-schedule signal delivery */ in c_sleep()