Commit Graph

7855 Commits

Author SHA1 Message Date
Christian S.J. Peron
4ccbe0c50d Un-break handling of -t 0 which was broken in my previous commit.
Add a flags argument to wait_for_lock so that O_NONBLOCK can be
passed to open if a user doesn't want the open to sleep until the
lock becomes available.

Submitted by:	Amir Shalem (partially modified)
2005-10-05 22:02:07 +00:00
Christian S.J. Peron
031469eb27 Fix long standing race condition associated with how lockf uses open(2)
for mutual exclusion:

A brief description of the problem:

	1) Proc A picks up non-blocking lock on file X
	2) Proc B attempts to pickup lock, fails then waits
	3) Proc C attempts to pickup lock, fails then waits
	4) Proc A releases lock
	5) Proc B acquires lock, release it to pickup a non-blocking version
	6) Proc C acquires lock, release it to pickup a non-blocking version
	7) Both process B and C race each other to pickup lock again

This occurs mainly because the processes do not keep the lock after they have
been waiting on it. They drop it, attempt to re-acquire it. (They use the wait
to notify when the lock has become available then race to pick it up). This
results in additional CPU utilization during the race, and can also result
in processes picking locks up out of order.

This change attempts to correct this problem by eliminating the test/acquire
race and having the operating system handle it.

Reported by:	kris
Tested by:	kris
MFC after:	1 week
2005-10-05 17:39:15 +00:00
Gary W. Swearingen
f0ab9f7b39 A minor overhaul: added comments, split cmds in 2, changed synopsis.
Split commands into two groups: one with optional count and one with
required argument.  Changed synopsis line accordingly.

Added some hopefully-helpful comments based on experiments, knowing
that not all hardware works the same.

PR:             docs/84101
Approved by:    keramida
MFC after:      3 days
2005-09-30 17:31:39 +00:00
Ruslan Ermilov
7fc550064a Oops, revert last commit (the manpage is still built in objdir). 2005-09-28 07:54:18 +00:00
Ruslan Ermilov
ec2cc32689 Add NO_OBJ. 2005-09-28 07:49:30 +00:00
Max Laier
b6de9e91bd Remove bridge(4) from the tree. if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on:	-arch
Reviewed by:	thompsa
X-MFC-after:	never (RELENG_6 as transition period)
2005-09-27 18:10:43 +00:00
Gleb Smirnoff
7c23a867f7 - Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
  statistics to honor -h flag.
2005-09-27 10:42:02 +00:00
Ruslan Ermilov
762fcdcf7d Remove redundant `\&' escapes. 2005-09-27 08:06:21 +00:00
Ruslan Ermilov
0b13db0306 Fixup previous commit. 2005-09-27 08:02:03 +00:00
Poul-Henning Kamp
1b56a319fe Please ship the pointy hat to its home position. 2005-09-26 22:07:59 +00:00
Poul-Henning Kamp
c711b5fe88 Update coordinates for "mph" hash generator now that it lives in ports. 2005-09-26 20:34:21 +00:00
Poul-Henning Kamp
2e5ee2bfac Add a .sinclude directive which does the exact same as .include, except
whine when the file cannot be found and opened.
2005-09-26 20:31:00 +00:00
Tim Kientzle
512c45ef6c Fix -u with absolute paths (e.g., "tar -uf foo.tar /bar") by handling
pathname edits before comparing pathnames on disk to those in the archive.

Thanks to: Gareth Bailey, Lowell Gilbert
2005-09-24 21:19:57 +00:00
Tim Kientzle
2f3b67647f Detect Mac OS X's broken ACL library.
Thanks to: Diego "Flameeyes" Petten?
2005-09-24 21:17:47 +00:00
Stefan Farfeleder
7c4847b792 The function inplace_edit() doesn't exist anymore, remove the prototype.
Submitted by:	Leonardo Chiquitto Filho
2005-09-24 13:18:30 +00:00
Marcus Alves Grando
8008bfe18b Add myself to FreeBSD calendar
Approved by:	pav (mentor)
2005-09-23 13:06:23 +00:00
Ruslan Ermilov
05248e759b Fix vgrind(1) indexing I broke in previous revision.
PR:		bin/86343
Submitted by:	Matej Vela <vela@debian.org>
2005-09-23 12:55:22 +00:00
Kirill Ponomarev
4e099ef9d9 Frank Lloyd Wright birth year is 1867, not 1869.
PR:		conf/82051
Submitted by:	Derek Jones <derek at wahila dot com>
2005-09-23 12:02:27 +00:00
Kirill Ponomarev
bb569d6301 Fix typo, FRG and GDR became UNO members in 1973, not in 1993.
PR:		conf/86193
Submitted by:	Matthias Buelow <mkb at incubus dot de>
2005-09-23 11:58:16 +00:00
Tim Kientzle
c114cc6c3f Style fix: Correct a compiler warning from GCC 4
Thanks to: Divacky Roman
PR: bin/84993
2005-09-21 03:21:35 +00:00
Diomidis Spinellis
d2e4ea2a51 Setting .nofinger will not hide you from root. 2005-09-19 10:11:47 +00:00
R. Imura
59fa708298 Connect smbfs build on powerpc. 2005-09-19 08:13:43 +00:00
Christian S.J. Peron
8729849a45 Use is '-' to imply that the flag is not set, rather than '.'. 2005-09-15 16:09:24 +00:00
Christian S.J. Peron
6f798df578 Print a warning if we fail to retrieve the process name for any reason. 2005-09-13 23:11:16 +00:00
Christian S.J. Peron
15f3d81f9c If there are'nt any bpf descriptors to process than dont bother attempting to
retrieve statistic information for them.

Pointed out by:	Pawel Worach < pawel.worach at gmail.com >
2005-09-13 22:13:01 +00:00
Christian S.J. Peron
48d91509de Free the bpf descriptor array after we are done with it. This probably isnt
that critical as the program exits after this point anyway, but this may
not always be the case.
2005-09-07 19:28:01 +00:00
Christian S.J. Peron
5dbd2da153 Update usage to reflect the new option.
Pointed out by:	ru
2005-09-07 19:15:43 +00:00
Gary W. Swearingen
25b20fc0b2 Several changes: Added a BUGS section with several bugs. And
--  Made the synopses more precise.
--  Added argument to flag in option description.
--  Moved -b default and limits to option description (to un-hide).
--  Noted several behaviors that were not mentioned.
--  A few more trivial changes.

PR:             docs/46787
Approved by:    keramida
MFC after:      3 days
2005-09-07 18:40:09 +00:00
Christian S.J. Peron
6b463eed3a Merge bpfstat's functionality into the netstat(1) utility. This adds
a -B option which causes bpf peers to be printed. This option can be
used in conjunction with -I if information about specific interfaces
is desired. This is similar to what NetBSD added to their version of
netstat.

$ netstat -B
  Pid  Netif  Flags      Recv      Drop     Match Sblen Hblen Command
 1137    lo0 p--s--         0         0         0     0     0 tcpdump
  205   sis0 -ifs-l     37331         0         1     0     0 dhclient
$

$ netstat -I lo0 -B
  Pid  Netif  Flags      Recv      Drop     Match Sblen Hblen Command
 1174    lo0 p--s--         0         0         0     0     0 tcpdump
$

-Add bpf.c which stores all the code for retrieving and parsing bpf
 related statistics.
-Modify main.c to add support for the -B option and hook it into the
 program logic.
-Add bpf.c to the build.
-Document this new functionality in the man page and bump the revision
 date.
-Add prototype for bpf_stats function.
2005-09-07 17:35:16 +00:00
Ralf S. Engelschall
60fc1eb79c Mention that uuidgen(1) generates DCE version 1 UUIDs only 2005-09-07 07:49:21 +00:00
Hartmut Brandt
724b6284e3 Fix the type of the variable 'debug'. It is used as a bitmap, so the
type should be int rather than Boolean.

PR:		bin/84528
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
MFC after:	3 weeks
2005-09-07 07:34:24 +00:00
Stefan Farfeleder
848b3d0fd7 In version 1.8 I botched findval()'s type, fix. 2005-09-02 21:51:18 +00:00
Stefan Farfeleder
1e72f11f56 Use socklen_t variables when passing sizes to getsockname() and
getsockopt().
2005-09-02 19:33:50 +00:00
Stefan Farfeleder
b702f91df9 The appropriate argument is -K -1, not -k -1. 2005-09-02 18:37:34 +00:00
Stefan Farfeleder
adcd73865c Fix a syntax error in the generated code when invoked with -P. Note that
the generated code still doesn't compile as we lack tinfo, t_getinfo and
friends.
2005-09-02 18:20:47 +00:00
Suleiman Souhlal
02dfd2b299 - Do not allocate memory to entries in /var/rwho which have been down for
more than 4 days - waste of memory.

Obtained from:	DragonFlyBSD (liamfoy)
MFC after:	3 days
2005-09-02 14:58:26 +00:00
Stefan Farfeleder
896cdc310c Stop generating the `register' keyword. 2005-09-02 10:32:05 +00:00
Stefan Farfeleder
15df5e2d43 Don't generate K&R C code. The -C flag is kept for backwards compatibility.
Also remove the SIG_PF macro, there is no need to cast closedown.
2005-09-02 10:23:26 +00:00
Stefan Farfeleder
ec06b5e868 Only write the dispatch table function prototypes to the header if the -h
flag was specified.  If all files are generated at once, those functions are
static and shouldn't appear in the header.

PR:		84450
Reviewed by:	alfred
2005-09-01 19:16:25 +00:00
Stefan Farfeleder
d0cc804bba - Use prototypes in headers.
- Include rpc_scan.h before rpc_util.h for the tok_kind enum.
- Nuke unused declarations.
2005-08-31 20:45:15 +00:00
Stefan Farfeleder
122562cd2b Rename the variable inline' to inline_size'. 2005-08-31 19:44:40 +00:00
Tim J. Robbins
33eafb83b7 Include option-argument names in the list in the DESCRIPTION section.
Remove a non-bug from the BUGS section.
2005-08-30 12:48:28 +00:00
Tim J. Robbins
bb78dba49b Remove undocumented historic support for treating "-" as an option
instead of a file operand; this is not compatible with POSIX.
2005-08-30 12:32:18 +00:00
Paul Saab
13829828e7 Unbreak tail -f on non-local filesystems. 2005-08-26 08:15:57 +00:00
Pawel Jakub Dawidek
70ffddc463 Revert previous behaviour of '-F' option and add '-L' option, which will
tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from
there.

Discussed with:	jhb, gad
2005-08-25 20:10:47 +00:00
Ollivier Robert
2fa9dad0ef Fixes for gcc 4.x.
PR:             bin/84995
Submitted by:   Divacky Roman <xdivac02@stud.fit.vutbr.cz>
2005-08-25 14:09:35 +00:00
Ollivier Robert
8a0a76b862 Fixes for gcc4.x.
Submitted by:   Divacky Roman <xdivac02@stud.fit.vutbr.cz>
PR:             bin/84991
2005-08-25 13:44:02 +00:00
Pawel Jakub Dawidek
712bf6af16 Modify '-F' option to work nicely with pidfile(3) - a pidfile given as
an argument has to be locked.
2005-08-24 19:38:28 +00:00
Yaroslav Tykhiy
b7cc036298 List -W as one of the meaningful options to the -i (interfaces)
display of netstat(1).

MFC after:	3 days
2005-08-24 12:21:34 +00:00
Brian Somers
e1bfde1b04 Add a -h option to tell cmp not to follow symbolic links.
MFC after:	3 weeks
Sponsored by:	Sophos/ActiveState
2005-08-23 13:13:13 +00:00