From c3fe9d5fb560112d7745f7717538132ccc2b6266 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 19 Mar 2017 18:05:29 +0000 Subject: [PATCH] =?UTF-8?q?Haiku-related=20ulimit=20overhaul:=20=E2=80=A2?= =?UTF-8?q?=20print=20ulimit=20-a=20with=20the=20flag,=20like=20most=20oth?= =?UTF-8?q?er=20shells=20do=20=E2=80=A2=20move=20ulimit-1=20regression=20t?= =?UTF-8?q?est=20to=20ulimit-2=20and=20exclude=20on=20Haiku:=20=20=20it=20?= =?UTF-8?q?can=20only=20set=20the=20-n=20and=20-V=20limits=20AFAICT=20?= =?UTF-8?q?=E2=80=A2=20document=20that=20some=20OSes=20(here:=20Haiku)=20c?= =?UTF-8?q?an=20only=20set=20the=20soft=20limits=20=20=20(so=20=E2=80=9Cul?= =?UTF-8?q?imit=20-nS=201024=E2=80=9D=20is=20okay=20but=20-S=20is=20requir?= =?UTF-8?q?ed)=20=E2=80=A2=20check=20=E2=80=9Culimit=20-c=200=E2=80=9D,=20?= =?UTF-8?q?which=20dot.mkshrc=20uses,=20everywhere=20=20=20(if=20it=20erro?= =?UTF-8?q?rs=20out,=20hack=20around=20it=20or=20stub=20it=20out=20with=20?= =?UTF-8?q?MKSH=5FNO=5FLIMITS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 11 +++++++++-- funcs.c | 4 ++-- mksh.1 | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/check.t b/check.t index b6b340b..b6f901b 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.760 2017/03/17 22:45:48 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.761 2017/03/19 18:05:25 tg Exp $ # -*- mode: sh -*- #- # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, @@ -10224,9 +10224,16 @@ expected-stdout: 16#61 16#0 16#62 16#20AC 16#63 . --- name: ulimit-1 +description: + Check that ulimit as used in dot.mksh works or is stubbed +stdin: + ulimit -c 0 +--- +name: ulimit-2 description: Check if we can use a specific syntax idiom for ulimit -category: !os:syllable + XXX Haiku works, but only for -n and -V +category: !os:haiku,!os:syllable stdin: if ! x=$(ulimit -d) || [[ $x = unknown ]]; then #echo expected to fail on this OS diff --git a/funcs.c b/funcs.c index 4880f7b..b1ff560 100644 --- a/funcs.c +++ b/funcs.c @@ -38,7 +38,7 @@ #endif #endif -__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.328 2017/03/17 22:45:50 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.329 2017/03/19 18:05:28 tg Exp $"); #if HAVE_KILLPG /* @@ -3655,7 +3655,7 @@ c_ulimit(const char **wp) if (!all) print_ulimit(rlimits[i], how); else for (i = 0; i < NELEM(rlimits); ++i) { - shprintf("%-20s ", rlimits[i]->name); + shprintf("-%c: %-20s ", rlimits[i]->optchar, rlimits[i]->name); print_ulimit(rlimits[i], how); } return (0); diff --git a/mksh.1 b/mksh.1 index 7ae3e84..9af9908 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,4 +1,4 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.430 2017/03/19 16:48:51 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.431 2017/03/19 18:05:29 tg Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -5030,7 +5030,7 @@ once they are set. Also note that the types of limits available are system dependent \*(en some systems have only the .Fl f -limit. +limit, or not even that, or can set only the soft limits .Bl -tag -width 5n .It Fl a Display all limits; unless