Commit Graph

8692 Commits

Author SHA1 Message Date
John Baldwin
2e4760b66b Make netstat -rn more resilient to having the routing table change out from
under it while running.  Note that this is still not perfect:
- Try to do something intelligent if kvm_read() fails to read a routing
  table structure such as an rtentry, radix_node, or ifnet.
- Don't follow left and right node pointers in radix_nodes unless
  RNF_ACTIVE is set in rn_flags.  This avoids walking through freed
  radix_nodes.

MFC after:	1 week
2008-02-14 20:01:52 +00:00
Marius Strobl
8a0bd6b806 Change another argument and a variable both related to netname() to
be also 32-bit on all archs.

MFC after:	3 days
2008-02-11 20:34:27 +00:00
Yaroslav Tykhiy
cf99a6bebb Fix a few obvious errors in the znew(1) script.
PR:		bin/120249
Submitted by:	Jaakko Heinonen <see the PR for email>
2008-02-09 13:04:01 +00:00
David Malone
d3e5e11ce6 WARNS fixes:
1) Add missing parens around assignment that is compared to zero.
2) Make some variables that only take non-negative values unsigned.
3) Some casts/type changes to fix other constness warnings.
4) Make one variable a const char *.
5) Make sure termwidth is positive, it doesn't make sense for it to be negative.

Approved by:	dds
2008-02-09 09:12:02 +00:00
Joe Marcus Clarke
f280594937 Add support for displaying a process' current working directory, root
directory, and jail directory within procstat.  While this functionality
is available already in fstat, encapsulating it in the kern.proc.filedesc
sysctl makes it accessible without using kvm and thus without needing
elevated permissions.

The new procstat output looks like:

  PID COMM               FD T V FLAGS    REF  OFFSET PRO NAME
  76792 tcsh              cwd v d --------   -       - -   /usr/src
  76792 tcsh             root v d --------   -       - -   /
  76792 tcsh               15 v c rw------  16    9130 -   -
  76792 tcsh               16 v c rw------  16    9130 -   -
  76792 tcsh               17 v c rw------  16    9130 -   -
  76792 tcsh               18 v c rw------  16    9130 -   -
  76792 tcsh               19 v c rw------  16    9130 -   -

I am also bumping __FreeBSD_version for this as this new feature will be
used in at least one port.

Reviewed by:	rwatson
Approved by:	rwatson
2008-02-09 05:16:26 +00:00
Guy Helmer
8a4313c59c Fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.

PR:		bin/76578
2008-02-08 23:04:13 +00:00
David Malone
97ce0ae60f WARNS fixes: mainly constness and avoid comparing signed with
unsigned by making array indicies unsigned. Also note one or two
unused parameters.
2008-02-08 11:03:05 +00:00
David Malone
84eebcc257 WARNS fixes: remove two unused variables and add some constness. 2008-02-08 10:58:50 +00:00
Marius Strobl
bc784cfe1b Fix netname() [1] and routename() on big-endian LP64 archs.
Submitted by:	Yuri Pankov [1]
MFC after:	3 days
2008-02-07 23:00:40 +00:00
Antoine Brodin
9298b21daf Add my birthday.
Approved by:	rwatson (mentor)
2008-02-05 19:34:54 +00:00
David E. O'Brien
d870d44d20 Minor style(9) nit. 2008-02-05 17:34:44 +00:00
Dag-Erling Smørgrav
5fb6bed92c Revert CLEANDEPFILES commit per ru@'s request; it does not really solve
the problem.  The correct fix will follow.
2008-02-05 08:52:36 +00:00
Dag-Erling Smørgrav
0d7cc1d0eb Normally, when a header file is removed from the build (as i4b headers
were recently), a simple 'make cleandepend; make depend' is sufficient
to keep the tree buildable after a cvs update when doing incremental
builds.

However, kdump and truss use a script which searches for header files
that define ioctls, and generates C code that includes them.  This
script will usually not need updating when a header file is removed,
so the normal dependency mechanism will not realize that it needs to
be re-run.  One is therefore left with code that references dead files
but will only be removed by a full 'make clean', which defeats the
purpose of incremental builds.

To work around this, modify the cleandepend target in bsd.dep.mk to
also remove any files listed in a new variable named CLEANDEPFILES,
and modify kdump's and truss's Makefiles accordingly.

MFC after:	2 weeks
2008-02-03 11:34:56 +00:00
Dag-Erling Smørgrav
72d1e737b5 These are files are shell scripts; give smart editors a chance to figure
it out by adding the usual shebang.

MFC after:	2 weeks
2008-02-03 11:33:27 +00:00
Ruslan Ermilov
3aefeab5df Christos decided to keep the manpages in mdoc(7) format,
so stop using our own versions of these.
2008-01-30 12:56:59 +00:00
Xin LI
2f487fe4e4 Use calloc() when requesting zero'ed memory allocation rather than rolling
our own.
2008-01-29 00:06:44 +00:00
Giorgos Keramidas
86ca3fd005 Revive '-opt' flags which I accidentally removed.
Noticed by:	simon
2008-01-27 16:20:36 +00:00
Giorgos Keramidas
a502340a03 Document the no-op -r option of BSD xargs(1).
PR:		docs/106416
Submitted by:	Pete Slagle, freebsd-stable at voidcaptain.com
MFC after:	3 days
2008-01-26 12:38:19 +00:00
Ruslan Ermilov
47dd70868b Flag a hack. 2008-01-24 07:25:13 +00:00
Ruslan Ermilov
f0c2fb2d04 Style. 2008-01-24 07:24:30 +00:00
Tim Kientzle
97f576d0a4 Make -l always have the SUSv2 meaning of "check links."
GNU tar changed -l to match SUSv2 a couple of years ago,
so bsdtar no longer needs to pander to this particular GNUism.

Thanks to: Debian maintainers
MFC after: 7 days
2008-01-22 07:23:44 +00:00
Andrey A. Chernov
8d4b16f8bb Understand newly introduced "ASCII" encoding 2008-01-22 00:04:50 +00:00
Tom Rhodes
e322ed0f05 Note what options are only for DDS drives.
PR:	35608
2008-01-21 22:08:05 +00:00
Robert Watson
87cb56f6df When printing process file descriptor lists, show a type of 'h' for
POSIX shared memory descriptors.
2008-01-20 19:57:33 +00:00
Peter Wemm
248e52ada8 Fix some boolean logic errors. && vs & and other sillyness. *blush*
This would prevent it from skipping non-present cpus in -P output.

Submitted by:  Pieter de Goeje <pieter@degoeje.nl>
2008-01-18 22:09:44 +00:00
Peter Wemm
031175705e Add a -P flag to display per-cpu cpu usage stats. 2008-01-18 01:43:14 +00:00
Xin LI
93b9f50404 ANSIfy and remove register.
Resulting binary verified with strip(1)+md5(1).
2008-01-16 19:27:43 +00:00
David Schultz
3c58f6ddbd Fix some bugs in wall(1):
- Handle wrapping correctly when \r appears in the input, and don't
  remove the \r from the output.
- For lines longer than 79 characters, don't drop every 80th character.
- Style: Braces around compound while statement.

PR:		114498
Submitted by:	Niclas Zeising <niclas.zeising@gmail.com> (earlier version)
2008-01-15 07:40:30 +00:00
David E. O'Brien
ef19c627f8 Update for the 'file' 4.23 import. 2008-01-13 20:37:19 +00:00
Xin LI
5abb148f43 - Handle the case where interface from "middle" is missing by
more carefully inspecting the return value from sysctl(3). [1]
 - Use calloc instead of malloc+memset of zero.

Submitted by:	Alexander Chernikov <admin su29 net> [1]
PR:		bin/119581
MFC after:	2 weeks
2008-01-12 00:11:26 +00:00
Andrew Thompson
a3ab9923ff Add IFT_BRIDGE to the Ethernet section so l2 addresses are formatted correctly.
PR:		bin/119542
Submitted by:	Niki Denev
2008-01-10 20:53:13 +00:00
Sam Leffler
7627e00431 quiet compiler complaint about unused parameters 2008-01-10 04:28:26 +00:00
David E. O'Brien
dbb2956620 Improve -u (limit uid lookups) behavior.
Submitted by:	David Frascone <dave@frascone.com>
PR:		119490
2008-01-09 18:06:24 +00:00
Dag-Erling Smørgrav
497a8b25b5 Welcome unzip(1), a pure BSD drop-in replacement for ports/unzip. In its
current state, it can handle all but four of the 991 zip files (including
jar files) I was able to identify in the ports tree.  The remaining four
are two self-extracting archives and two which have garbage preceding the
first local header.  This limitation is a feature of libarchive(3) which
I am currently working to resolve.

The code is unnecessarily large due to the need to emulate the exact
command-line syntax and behaviour of ports/unzip.  My initial incompatible
implementation was one quarter the size of the one I am committing here.
2008-01-08 08:00:06 +00:00
John Baldwin
0460d3516d Only use sockoptname() to parse socket option names for SOL_SOCKET
requests.

MFC after:	3 days
Reported by:	Michiel Boland  michiel boland.org
2008-01-07 18:50:25 +00:00
David E. O'Brien
bc215f5905 Make a few messages more consistant with the others. 2008-01-04 03:09:28 +00:00
David E. O'Brien
3feeb33206 more style(9) 2008-01-04 03:08:49 +00:00
Jason Evans
9a62623a15 The break() system call takes a pointer argument, not an integer. This
change fixes output for break() on LP64 systems.
2008-01-03 00:18:03 +00:00
David E. O'Brien
65475bc8e6 style(9)
+ kread is not a boolean, so check it as such
+ fix $FreeBSD$ Ids
+ denote copyrights with /*-
+ misc whitespace changes.
2008-01-02 23:26:11 +00:00
Tim Kientzle
4a1f529a56 Remove the old bsdtar test scripts; something much
better is almost ready to commit.
2008-01-02 00:28:44 +00:00
Tim Kientzle
d671137571 A couple of miscellaneous fixes:
* prototypes for optarg/optind on platforms that don't already have them
  * Disambiguate version number macros
  * Remove unnecessary PACKAGE_NAME macro
  * Hook for forthcoming bsdtar test suite
  * Sync version number up with the portable distribution
2008-01-02 00:27:14 +00:00
Tim Kientzle
ec3df377a1 Fill in the approximate date when tar(1) first appeared. 2008-01-02 00:24:10 +00:00
Tim Kientzle
e3bd5f097c Include a suitable stub definition of __FBSDID() for non-FreeBSD platforms. 2008-01-02 00:23:00 +00:00
Tim Kientzle
fd3fd2a992 Use archive_entry_strmode() instead of a local bsdtar_strmode().
(This does a couple of things that the standard library's strmode()
doesn't; it proved useful in bsdcpio as well, so I pushed it down
into libarchive.)
2008-01-02 00:21:27 +00:00
Tim Kientzle
b47d2925d7 Include Guido's copyright for the fnmatch() code I cribbed from.
(It's in the C source, just wasn't in the COPYING file until now.)
2008-01-02 00:19:49 +00:00
Weongyo Jeong
6bfc16da36 Add my birthday to the calendar.
Approved by:	thompsa (mentor)
2008-01-01 10:29:22 +00:00
Warner Losh
b428ff6b67 follow style(9) more closely and list sys/types.h first after sys/defs.h.
Submitted by: max@
2008-01-01 10:04:10 +00:00
Greg Lehey
8ddfe1c32c style(9) 2007-12-30 22:04:04 +00:00
Greg Lehey
cd59b2cd17 If we can't open a calendar file, don't guess why. Check the error
return and print a useful message.

Prior to this commit, access problems could give rise to messages that
the file didn't exist.
2007-12-30 22:02:50 +00:00
Warner Losh
ee4f10a0e0 Some systems need the types defined in sys/types.h, but lack the
sys/types.h polution  that FreeBSD  has in one  of its  include files.
Since  this  is  a  bootstrap  tool, include  more  than  is  strictly
necessary for FreeBSD.
2007-12-29 05:15:54 +00:00