Subject: Re: This should be the final cat(1) patch...
To: Ben Harris , Alan Barrett <apb@cequrux.com>
From: Mason Loring Bliss <mason@acheron.middleboro.ma.us>
List: tech-userlevel
Date: 06/08/2002 13:41:45
--a+b56+3nqLzpiR9O
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 08, 2002 at 04:24:25PM +0100, Ben Harris wrote:

> >From /usr/share/misc/style:
>=20
>          * Use err/warn(3), don't roll your own!

I'm researching this right now, trying to understand where and how err(3)
and warn(3) are actually defined on a system with no err.h... Given that
part of this exercise is to produce a new host tool for inclusion in
TOOLDIR, using non-standard function calls seems uncool. (This is, for
instance, why I'm using fcntl(2) instead of the much simpler flock(2).)


On Sat, Jun 08, 2002 at 11:25:56AM +0200, Alan Barrett wrote:

> Please add fcntl(2) to the SEE ALSO section of the man page,
> and add more detail to the description of the -l option,
> something like this:

Okay, all reasonable. I will do so in a couple minutes.


On Sat, Jun 08, 2002 at 11:38:00AM +0200, Alan Barrett wrote:

> It's probably not a good idea to lock the file before all the options
> have been parsed.

Okay, I will defer locking. Not doing work in the middle of getopt(3) will
seem cleaner in any event.


> While we are adding flags to cat, how about "-a" flag to do
> fcntl(STDOUT_FILENO, O_APPEND) ?

There's no equivalent functionality to the -l flag currently. However, how
would -a differ from "cat >> foo"?


On Sat, Jun 08, 2002 at 04:20:48PM +0100, Ben Harris wrote:

> Erm, if you change that, you should probably also change install(1) to use
> fcntl() as well.  I'm not sure how nicely they play together.

They mix quite well. It's still an exclusive advisory lock - they don't
differ qualitatively. But, still, Luke is in fact moving install(1) over
to using fcntl(2) instead of flock(2). I don't know if it's been committed
yet.

--=20
Mason Loring Bliss   mason@acheron.middleboro.ma.us   Ewige Blumenkraft!
https://www.deadsexy.org/  awake ? sleep : random() & 2 ? dream : sleep;

--a+b56+3nqLzpiR9O
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE9AkHZykMMY715wXIRAvDYAKD0eVE2IA73v3DMuMeHkcBMjQRMowCgp9vR
cDJRICcKPZjiOwgxsMw/xpo=
=1p+r
-----END PGP SIGNATURE-----

--a+b56+3nqLzpiR9O--