Commit Graph

8743 Commits

Author SHA1 Message Date
dwmalone
61bc7e9048 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
marcus
7e24637c24 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
ghelmer
56c7e4a9b4 Fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.

PR:		bin/76578
2008-02-08 23:04:13 +00:00
dwmalone
889b35d148 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
dwmalone
90972e91da WARNS fixes: remove two unused variables and add some constness. 2008-02-08 10:58:50 +00:00
marius
1811facdc6 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
c9994c03d3 Add my birthday.
Approved by:	rwatson (mentor)
2008-02-05 19:34:54 +00:00
obrien
6ccddb5af5 Minor style(9) nit. 2008-02-05 17:34:44 +00:00
des
f7514f1316 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
des
0e657b23ab 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
des
b198f5f802 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
ru
3c0bb170e1 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
delphij
6aa3c8ee5a Use calloc() when requesting zero'ed memory allocation rather than rolling
our own.
2008-01-29 00:06:44 +00:00
keramida
a15e8d3ada Revive '-opt' flags which I accidentally removed.
Noticed by:	simon
2008-01-27 16:20:36 +00:00
keramida
dfacf4dc3d 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
ru
5294e28829 Flag a hack. 2008-01-24 07:25:13 +00:00
ru
1958a457a4 Style. 2008-01-24 07:24:30 +00:00
kientzle
5ca21996e8 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
ache
0f0fc0acb4 Understand newly introduced "ASCII" encoding 2008-01-22 00:04:50 +00:00
trhodes
fceb0bfa37 Note what options are only for DDS drives.
PR:	35608
2008-01-21 22:08:05 +00:00
rwatson
c4193aa3c5 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
edc23a8104 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
368d76456b Add a -P flag to display per-cpu cpu usage stats. 2008-01-18 01:43:14 +00:00
delphij
8f8cb7cbec ANSIfy and remove register.
Resulting binary verified with strip(1)+md5(1).
2008-01-16 19:27:43 +00:00
das
409fbbd08f 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
obrien
e7d969a2b5 Update for the 'file' 4.23 import. 2008-01-13 20:37:19 +00:00
delphij
3f4eb439e2 - 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
thompsa
2fdbb8b316 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
5960f63b76 quiet compiler complaint about unused parameters 2008-01-10 04:28:26 +00:00
obrien
2678039b69 Improve -u (limit uid lookups) behavior.
Submitted by:	David Frascone <dave@frascone.com>
PR:		119490
2008-01-09 18:06:24 +00:00
des
2f455753ea 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
jhb
1b130ab327 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
obrien
21f57c54a6 Make a few messages more consistant with the others. 2008-01-04 03:09:28 +00:00
obrien
42e1a3c481 more style(9) 2008-01-04 03:08:49 +00:00
jasone
7719fcccbc 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
obrien
7407056580 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
kientzle
7926f8421a Remove the old bsdtar test scripts; something much
better is almost ready to commit.
2008-01-02 00:28:44 +00:00
kientzle
6b16e2b440 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
kientzle
af2a151201 Fill in the approximate date when tar(1) first appeared. 2008-01-02 00:24:10 +00:00
kientzle
4e518cef81 Include a suitable stub definition of __FBSDID() for non-FreeBSD platforms. 2008-01-02 00:23:00 +00:00
kientzle
9f949d65f6 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
kientzle
8077de9724 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
60090fe4ff Add my birthday to the calendar.
Approved by:	thompsa (mentor)
2008-01-01 10:29:22 +00:00
imp
d858710a4f 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
grog
08cba53c94 style(9) 2007-12-30 22:04:04 +00:00
grog
0abc02edc2 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
imp
48aadec12a 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
des
5679753564 List all environment variables supported by libfetch, along with a reference
to the fetch(3) man page.

MFC after:	1 week
2007-12-28 19:47:37 +00:00
edwin
3919ec2a10 Add the ability to clean up all shared memory segments which are
unused in one go.

From the original PR:

	I've observed that linux apps running under the linuxulator
	have a habit of leaving behind shared memory segments which
	are unused, but which eventually cause the system to run
	out of free segments and these apps will stop working.
	ipcrm(1) currently only allows removal of unused message
	queues, shared memory segments and semaphores on an individual
	basis, or those having a matching (non-zero) key. However
	it would often be convenient to just do a complete cleanup
	of everything, usually as root.

PR:		bin/118292
Submitted by:	Callum Gibson <callumgibson@optusnet.com.au>
Not reviewed by:	grog@
Approved by:	grog@
2007-12-25 00:52:24 +00:00
imp
88bf38f550 usbhidctl appears to not report features and write size correctly
This turns out to be due to an argument botch for hid_report_size.
The PR contained patches to fix the argument botch.

Submitted by: Maurice Castro
PR: usb/118915
2007-12-21 03:40:36 +00:00