Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/bin/cat Pull up revision 1.26 (requested by mason in ti...



details:   https://anonhg.NetBSD.org/src/rev/ac9106cd6760
branches:  netbsd-1-6
changeset: 527873:ac9106cd6760
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jun 11 15:45:15 2002 +0000

description:
Pull up revision 1.26 (requested by mason in ticket #243):
Add -l option to cat(1), as discussed on tech-userlevel. This option
causes cat(1) to use fcntl(2) to set an exclusive advisory lock on stdout.
While being useful in its own right, this will shortly be used to
guarantee orderly writing to METALOG in the case of unprivileged builds
with NBUILDJOBS > 1.

diffstat:

 bin/cat/cat.1 |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 7109f24aa571 -r ac9106cd6760 bin/cat/cat.1
--- a/bin/cat/cat.1     Tue Jun 11 08:49:55 2002 +0000
+++ b/bin/cat/cat.1     Tue Jun 11 15:45:15 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: cat.1,v 1.25 2002/05/15 06:52:54 kleink Exp $
+.\"    $NetBSD: cat.1,v 1.25.2.1 2002/06/11 15:45:15 lukem Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -44,7 +44,7 @@
 .Nd concatenate and print files
 .Sh SYNOPSIS
 .Nm
-.Op Fl befnstuv
+.Op Fl beflnstuv
 .Op Fl
 .Op Ar
 .Sh DESCRIPTION
@@ -79,6 +79,15 @@
 as well.
 .It Fl f
 Only attempt to display regular files.
+.It Fl l
+Set an exclusive advisory lock on the standard output file descriptor.
+This lock is set using
+.Xr fcntl 2
+with the
+.Dv F_SETLKW
+command. If the output file is already locked,
+.Nm
+will block until the lock is acquired.
 .It Fl n
 Number the output lines, starting at 1.
 .It Fl s
@@ -117,7 +126,8 @@
 .Xr pr 1 ,
 .Xr tail 1 ,
 .Xr view 1 ,
-.Xr vis 1
+.Xr vis 1 ,
+.Xr fcntl 2
 .Rs
 .%A Rob Pike
 .%T "UNIX Style, or cat -v Considered Harmful"



Home | Main Index | Thread Index | Old Index