From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sat Sep 19 20:07:55 EDT 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id be3877ff (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Sat, 19 Sep 2020 17:07:47 -0700 (PDT) Message-ID: To: ori@eigenstate.org, kvik@a-b.xyz, 9front@9front.org Subject: Re: [9front] [PATCH] syscall: utility overhaul Date: Sat, 19 Sep 2020 17:07:45 -0700 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: descriptor standard dependency optimizer > Following is a list of functional changes: > > * The -o flag outputs the entire buffer to the length returned > by the syscall, or, in case of fd2path(2) and errstr(2), to '\0'. > * The -x flag is removed; the above makes it possible to pipe > into xd(1) to get the same result. > * The -s flag uses dirfmt(2) to format the stat message, instead > of trying to imitate ls(1). > * Stderr reports are normalized and made easier to parse. > > The code also suffered a number of stylistic changes. > > diff -r d947a4c5d7fa sys/man/1/syscall > --- a/sys/man/1/syscall Thu Sep 03 20:07:44 2020 -0700 > +++ b/sys/man/1/syscall Sat Sep 19 15:04:17 2020 +0200 > > + switch(i){ > + case _ERRSTR: case ERRSTR: case FD2PATH: > + nbuf = strlen(buf); > } > > Is buf guaranteed to be nul terminated here? I think > we're likely to be ok here, but I'd be more comfortable > if we had the last byte explicitly set before calling > strlen. > > Other than that, it lkooks good to me. (Actually, ignore that, those syscalls nul terminate)