Commit Graph

8668 Commits

Author SHA1 Message Date
Xin LI
423c5ce59d Resolve conflicts; Update defines.h to reflect latest change. 2007-11-16 22:24:31 +00:00
Stefan Eßer
e291efbd86 Fix (uncritical) potential buffer overflow: the length of "buf" was not
extended when "jaiL" was added to fmt_flags().
MFC after:	1 week
2007-11-15 07:31:11 +00:00
Ruslan Ermilov
95d0af0c53 - Steal short description from POSIX; it's more technical and was
easier to translate.
- Fix some markup nits.
2007-11-13 11:34:20 +00:00
John Baldwin
a4cc298ac9 write(1) needs to strip off the leading /dev/ from the tty name for the
current tty as returned from ttyname(3) so it can try to avoid writing to
the current tty if possible.  Previously, it did this by trimming off any
leading directory (effectively performing a basename(3) on the path
returned from ttyname(3)).  However, this chopped off too much of the path
for ttys who have directories in their name such as pts(4).  Instead, just
strip off the leading /dev/ from the path returned by ttyname(3).  This
fixes write(1) when using pts(4).

MFC after:	1 week
Reported by:	rwatson
2007-11-12 20:02:21 +00:00
Ruslan Ermilov
bf2105c4a9 Fix a typo. 2007-11-09 16:31:47 +00:00
Ruslan Ermilov
0cf4978129 - Fix documentation to match code. Specifically, -c doesn't have
to be specified together with either -u or -t to have an effect,
  and exit status of 2 is not possible after a Perl->C conversion.

- While here, fix markup.
2007-11-09 16:02:10 +00:00
Ruslan Ermilov
b8272c9193 Fix numerous bugs when parsing options and arguments. 2007-11-09 15:14:08 +00:00
Diomidis Spinellis
e7d538131d Use static storage-class specifier where appropriate.
Found by: CScout
2007-11-08 11:13:03 +00:00
Diomidis Spinellis
c14530c701 Make function's definition follow its declared visibility.
Found by: CScout
2007-11-08 09:09:02 +00:00
Diomidis Spinellis
a511e63958 Fix visibility of "inplace".
Found by: CScout
2007-11-08 08:57:51 +00:00
Kevin Lo
d4c16fe37d setenv(3) sets errno on failure, use warn() instead
Pointed out by: ru
2007-11-08 01:24:31 +00:00
Rong-En Fan
e0350ca8f5 - Include runefile.h for _CACHED_RUNES 2007-11-07 14:46:22 +00:00
Ruslan Ermilov
b328ef0eba Markup nits. 2007-11-07 07:59:38 +00:00
Ruslan Ermilov
10f9229070 Fix markup. 2007-11-07 07:56:57 +00:00
Kevin Lo
ee8f97394e Check return value for setenv() 2007-11-06 10:35:50 +00:00
Ulf Lilleengen
eec1c21f61 - Add ZFS-support to fstat(1). This allows ZFS-filsystems to be including in
the open file-listing. It is added as a separate source file, so it can
  respect WITH_/WITHOUT_CDDL as compile-flags.
- The warnlevel of the Makefile was decreased to quell solaris #pragma
  warnings.
- Expect that fstat(1) doesn't work with kernel compiled with
  DEBUG_VFS_LOCKS/DEBUG_LOCKS for now.

Approved by:	pjd (mentor)
2007-11-05 23:15:03 +00:00
Philippe Charnier
f8c2d2bde1 initialize variables, WARNS=6 compliant 2007-11-02 18:06:51 +00:00
Ruslan Ermilov
46122f64a6 Markup revision. 2007-11-02 12:07:07 +00:00
Henrik Brix Andersen
b58389792d Add my birthday to the calendar.
Approved by:	erwin (mentor)
2007-11-01 21:56:09 +00:00
Ruslan Ermilov
8931e1d50e Also fix a "blank line" issue that sneaked in from rev. 1.19.
Submitted by:	John Hein
2007-10-31 19:26:01 +00:00
Yaroslav Tykhiy
7773f5ddf9 Give more details on the following topics:
o How global, command-line, and environment variables relate.
o What peculiarities the -f option has WRT ${MAKEFLAGS}.
2007-10-31 08:20:09 +00:00
Ruslan Ermilov
de8f7dcbae Remove newly acquired hard sentence breaks. 2007-10-30 19:23:42 +00:00
Ruslan Ermilov
65717f952e Apply style(9) to usage(), fix markup of the manpage. 2007-10-30 17:49:00 +00:00
Kevin Lo
0f10497bce Never use getenv("HOME") without checking for NULL and non-zero
Obtained from: OpenBSD
2007-10-30 03:44:10 +00:00
Julian Elischer
7ab24ea3b9 Introduce a way to make pure kernal threads.
kthread_add() takes the same parameters as the old kthread_create()
plus a pointer to a process structure, and adds a kernel thread
to that process.

kproc_kthread_add() takes the parameters for kthread_add,
plus a process name and a pointer to a pointer to a process instead of just
a pointer, and if the proc * is NULL, it creates the process to the
specifications required, before adding the thread to it.

All other old kthread_xxx() calls return, but act on (struct thread *)
instead of (struct proc *). One reason to change the name is so that
any old kernel modules that are lying around and expect kthread_create()
to make a process will not just accidentally link.

fix top to show  kernel threads by their thread name in -SH mode
add a tdnam formatting option to ps to show thread names.

make all idle threads actual kthreads and put them into their own idled process.
make all interrupt threads kthreads and put them in an interd process
(mainly for aesthetic and accounting reasons)
rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper'

man page fixes to follow.
2007-10-26 08:00:41 +00:00
Ulf Lilleengen
26e4ee3b41 - Add my birthday to the calendar.
Approved by:	kib (mentor)
2007-10-25 19:35:09 +00:00
David E. O'Brien
149d554ac8 The AWK 23-Oct-2007 release includes fixes for FreeBSD PR's bin/104795
and bin/100443.
2007-10-25 12:43:22 +00:00
Ruslan Ermilov
4f6d329f1e - Convert NO_INSTALLLIB option to a new syntax: makefiles should
test MK_INSTALLLIB, users can set WITHOUT_INSTALLLIB.  The old
  NO_INSTALLLIB is still supported as several makefiles set it.

- While here, fix an install when instructed not to install libs
  (usr.bin/lex/lib/Makefile).

PR:		bin/114200
Submitted by:	Henrik Brix Andersen
2007-10-20 19:01:50 +00:00
John Baldwin
813947b737 Add a -z flag to nfsstat which zeros the NFS statistics after displaying
them.

MFC after:	1 week
Requested by:	ps
Submitted by:	ps (6 years ago)
2007-10-18 16:38:07 +00:00
Edwin Groothuis
9a09d70af1 Teach makewhatis.c to treat .SS with the same severity as .SH.
At least one port (net-mgmt/net-snmp) creates man-pages which are
in the format:

	.SH NAME
	The Net-SNMP agent \- The snmp agent responds to SNMP queries from management stations.

	.PP
	.SS "Modules"

At this moment, makewhatis determines the end of the .SH NAME section
as where it finds .SH again, but there is none here, is it "terminated"
by the .SS.

PR:		bin/116706
Submitted by:	edwin@
Approved by:	re (Ken Smith), grog (mentor)
MFC after:	1 week
2007-10-18 12:53:11 +00:00
David Xu
a964714f51 The upper while loop has already recycled child process, so the if
statement has never executed as expected, fix it.

MFC after: 3 days
2007-10-18 11:05:30 +00:00
Juli Mallett
a2229407e5 Prevent strange crashes in fmt with absurd goal lengths introduced by the
support for wide characters.

If the sizeof (wchar_t) times max_length would yield a value beyond
representation in a size_t, exit with a usage error up front, rather than
strange errors down the line from trying to malloc (well, realloc) with a size
of 0.

This is perhaps not the optimal behaviour - a clamp may be more appropriate as
we clamp the value of max_length now anyway, but this is at least better than
segfaulting or worse.  On systems which are friendly to malloc with a value of 0
the results could end up being strange corruption of the output.
2007-10-17 11:41:40 +00:00
Randall Stewart
e5221e8ba2 Fix incorrect string formats for netstat/s
PR:		117175
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)
MFC after:	1 week
2007-10-17 10:16:20 +00:00
Konstantin Belousov
7ce8354a9b Fix various memory leaks.
Submitted by:	rdivacky
Obtained from:	OpenBSD
MFC after:	1 week
2007-10-17 09:52:08 +00:00
Stefan Eßer
afb6c26e9e The previous version included too many file system types in the scan,
since "local" includes also synthetic file systems (e.g. /dev, /proc)
and loopback mounts.

This version uses lsvfs to identify file system types that are local
and additionally not synthetik, loopback mounts, or read-only. This
has been suggested by Craig Rodrigues half a year ago. The patch that
has been committed is based on his suggestion, but slightly modified.

The comments in locate.rc have been updated to reflect the change and
o include zfs and xfs in the example file system parameter that can
be used to override the default outlined above.

PR:		114101
Submitted by:	rodrigc at crodrigues dot org (Craig Rodrigues)
MFC:		2 weeks
2007-10-17 07:27:51 +00:00
Stefan Eßer
8862db8d54 Make the updatedb script installed as /usr/libexec/locate.updatedb
inspect all local file systems, not only ufs and ext2fs. A number
of local file systems has been added over time, and at least zfs
has the potential to become a popular choice. Without this change
a ZFS root file system causes the script to ignore all file-systems
and leads to an empty locate db. (An alternative is to add all the
relevant file systems individually, which means that at least zfs,
xfs, ntfs, ntfs-3g, msdosfs should be added, probably more).
2007-10-15 22:09:19 +00:00
Alexander Leidinger
9f05d312b3 Backout sensors framework.
Requested by:	phk
Discussed on:	cvs-all
2007-10-15 20:00:24 +00:00
Lars Engels
8f4435b1cb Add myself to the FreeBSD calendar.
Approved by:	    miwi (mentor)
2007-10-14 19:55:32 +00:00
Ruslan Ermilov
8f96b509a2 Bump document date for the last change. 2007-10-14 19:12:36 +00:00
Alexander Leidinger
99f6b270e3 Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components:

 * sample configuration file for sensorsd
 * rc(8) script and glue code for sensorsd(8)
 * sysctl(3) doc fixes for CTL_HW tree
 * sysctl(3) documentation for hardware sensors
 * sysctl(8) documentation for hardware sensors
 * support for the sensor structure for sysctl(8)
 * rc.conf(5) documentation for starting sensorsd(8)
 * sensor_attach(9) et al documentation
 * /sys/kern/kern_sensors.c
   o sensor_attach(9) API for drivers to register ksensors
   o sensor_task_register(9) API for the update task
   o sysctl(3) glue code
   o hw.sensors shadow tree for sysctl(8) internal magic
 * <sys/sensors.h>
 * HW_SENSORS definition for <sys/sysctl.h>
 * sensors display for systat(1), including documentation
 * sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and  -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by:	Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by:	Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by:	syrinx
Tested by:	many
OKed by:	kensmith
Obtained from:	OpenBSD (parts)
2007-10-14 10:45:31 +00:00
Maxim Konovalov
56ae331013 o Pablo Picasso's birthday is October 25 not October 5.
PR:		conf/116952
Submitted by:	Pablo Picasso <comet@transbay.net>
2007-10-14 08:52:29 +00:00
Christian S.J. Peron
2e61a3d00a Fix id -A when the subject has an extended subject token associated with
them (for example when they have logged in from an ip6 source).

- Stick with the initial call to getaudit(2), if it returns E2BIG, use
  getaudit_addr(2) instead and set the "extended" flag to indicate that
  we the calling credential has an extended subject state.
- Additionally, add the printing of the machine/at_addr (the ip/ip6
  addresses)

MFC after:	1 week
Obtained from:	TrustedBSD Project
2007-10-14 00:52:30 +00:00
Christian S.J. Peron
6a53f0a52b Revision 1.12 of lockf.c fixed a "thundering herd" scenario when the
lock experienced contention a number of processes would race to acquire
lock when it was released.  This problem resulted in a lot of CPU
load as well as locks being picked up out of order.

Unfortunately, a regression snuck in which allowed multiple threads
to pickup the same lock when -k was not used.  This could occur when
multiple processes open a file descriptor to inode X (one process
will be blocked) and the file is unlinked on unlock (thereby removing
the directory entry allow another process to create a new directory
entry for the same file name and lock it).

This changes restores the old algorithm of: wait for the lock, then
acquire lock when we want to unlink the file on exit (specifically
when -k is not used) and keeps the new algorithm for when -k is used,
which yields fairness and improved performance.

Also, update the man page to inform users that if lockf(1) is being
used to facilitate concurrency between a number of processes, it
is recommended that -k be used to reduce CPU load and yeld
fairness with regard to lock ordering.

Collaborated with:	jdp
PR:		bin/114341
PR:		bin/116543
PR:		bin/111101
MFC after:	1 week
2007-10-12 14:56:52 +00:00
David E. O'Brien
946367b8e2 Tweak the handling of "WITHOUT_LIBPTHREAD". Also remove the accidental
treatment of 'LIBKSE' as an "old style" knob.

Submitted by:	ru
Approved by:	re(kensmith)
2007-10-09 23:31:11 +00:00
David E. O'Brien
65c045e964 Repo copy libpthreads to libkse.
This introduces the WITHOUT_LIBKSE nob,
and changes WITHOUT_LIBPTHREADS to mean with neither threading libs.
Approved by:	re(kensmith)
2007-10-09 13:42:34 +00:00
Ruslan Ermilov
152f2a4a96 Always install libpthread.* symlinks if at least one of
the threading libraries is built.  This simplifies the
logic in makefiles that need to check if the pthreads
support is present.  It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by:	re (kensmith)
2007-10-01 18:22:32 +00:00
Edwin Groothuis
3011bef433 Update to calendar/calendars/hr_HR.ISO_8859-2/calendar.praznici
with fixes and new dates.

PR:		conf/26658
Submitted by:	Josip Rodin <joy@gkvk.hr>
Approved by:	re@ (bmah), grog@ (mentor)
MFC after:	1 week
2007-09-21 23:43:03 +00:00
Thomas Abthorpe
45d485af85 - add my entry
Approved by:	re (bmah), clsung/miwi (mentors)
2007-09-21 12:12:13 +00:00
Kevin Lo
8bcd62f2ff Use NULL instead of 0 for the return value of fopen().
Approved by: re (kensmith)
2007-09-21 01:55:11 +00:00
Edwin Groothuis
f734bd2c0d More dates: Sint Maarten, Dierendag, Trinitatis
Fix spelling: Carnaval
Add more of the Royal Family.

Approved by:	re@ (Ken Smith), grog@ (mentor)
MFC after:	1 week
2007-09-20 21:46:04 +00:00
Jeff Roberson
b61ce5b0e6 - Move all of the PS_ flags into either p_flag or td_flags.
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or
   previously the sched_lock.  These bugs have existed for some time.
 - Allow swapout to try each thread in a process individually and then
   swapin the whole process if any of these fail.  This allows us to move
   most scheduler related swap flags into td_flags.
 - Keep ki_sflag for backwards compat but change all in source tools to
   use the new and more correct location of P_INMEM.

Reported by:	pho
Reviewed by:	attilio, kib
Approved by:	re (kensmith)
2007-09-17 05:31:39 +00:00
Ruslan Ermilov
8be3f374a7 - Stop computing %CPU for the imaginary idle process; we now
have real idle processes for that.

- Fix the display on SMP by not scaling the sum of %CPU down
  to 1.  Instead, display raw data as computed by the kernel,
  like in top(1).

Reviewed by:	bde
Approved by:	re (bmah)
MFC after:	1 week
2007-09-11 07:51:03 +00:00
Kevin Lo
817e1ec901 Check return value of listen().
Reviewed by: emax
Approved by: re (kensmith)
2007-09-11 01:59:00 +00:00
Randall Stewart
a3a60860c8 - Netstat warning removal for 64 bit aware platforms.
Approved by:	re@freebsd.org (B Mah)
2007-09-09 11:03:56 +00:00
Tim Kientzle
cd41628daf Add --posix as a synonym for --format=pax, for GNU
tar compatibility.

Approved by: re (bmah)
2007-09-09 00:07:18 +00:00
Edwin Groothuis
21008fdbf9 Add misc entries communilated over the year
PR:             conf/113285, conf/113642, conf/70252 and conf/61641
Submitted by:   Edwin Groothuis <edwin@mavetju.org>, <acc107_3@acc.tula.ru>, Evan Dower <evantd@cs.washington.edu>
MFC after:      1 week
Approved by:    re (bmah@), mentor (grog@)
2007-09-07 03:23:06 +00:00
Ruslan Ermilov
06351b59c6 Inactive pages don't have to be dirty plus improve description of
the cache queue.

Submitted by:	alc
Approved by:	re (kensmith)
2007-09-02 10:29:16 +00:00
Ruslan Ermilov
d71e591b49 Fix the description of the "Cache" memory and clarify the
description of the "Inact" memory.  (They count pages in
the cache/inactive page queues, respectively.)

Approved by:	re (kensmith)
2007-09-01 05:52:39 +00:00
Randall Stewart
d37c519324 - Fix typo in netstat's display of Nagle algorithm - refer to the RFC.
Submitted by:	bruce@cran.org.uk
Approved by:	re@freebsd.org (Bruce Mah)
2007-08-24 00:35:18 +00:00
Xin LI
f7504c33c4 Use POSIX mutex instead of Solaris ones. This makes generation
of threaded RPC servers to work out of the box.

Spotted by:	Changming Sun <changming at staff.sina.com.cn>
Sponsored by:	SINA Corporation
Approved by:	re (kensmith)
2007-08-23 09:39:40 +00:00
Xin LI
f87730d4b0 sysent.h is installed as sys/sysent.h, so reflect it.
Approved by:	re (kensmith)
Spotted by:	Changming Sun <changming at staff.sina.com.cn>
Sponsored by:	SINA Corporation
2007-08-23 09:38:26 +00:00
Tim Kientzle
9b93c30d30 Fix for PR bin/115033. This corrects a crash when long options
are specified with the "-W option=arg" syntax and the '=' is omitted.

MFC after: 3 days
Approved by: re (rwatson)
2007-08-01 03:15:35 +00:00
Dag-Erling Smørgrav
218cbbea9a Make tcpstates[] static, and make sure TCPSTATES is defined before
<netinet/tcp_fsm.h> is included into any compilation unit that needs
tcpstates[].  Also remove incorrect extern declarations and TCPDEBUG
conditionals.  This allows kernels both with and without TCPDEBUG to
build, and unbreaks the tinderbox.

Approved by:	re (rwatson)
2007-07-30 11:06:42 +00:00
Marcel Moolenaar
f235995090 Print integer-typed arguments as integers. This makes sure that
on 64-bit platforms the result is more reliable. For example,
-1 was previously printed as 0xffffffff.

Approved by: re (kensmith)
2007-07-28 23:18:39 +00:00
Marcel Moolenaar
2c02627ff8 Fix handling of Quad-type arguments. Previously, syscalls
containing 64-bit arguments would have explicit padding.
On 64-bit platforms there was no padding, so the dummy
argument was not covering anything. On 32-bit platforms
with weak alignment (i.e. i386) the 64-bit argument did
not need to be aligned, so there too an aditional argument
was introduced. On 32-bit platforms with strong alignment
(i.e. PowerPC) the dummy argument in fact cover the padding.
By elimininating the dummy argument, 64-bit platforms now
have 1 argument less. This also applies to 32-bit platforms
with weak alignment. On PowerPC this doesn't matter, because
the padding is still there. We just don't "name" it.
Deal with those 3 cases.

Approved by: re (kensmith)
2007-07-28 23:15:04 +00:00
Marcel Moolenaar
3e1b607837 Syscalls have at most 6 argument, not 5. See mmap(2) for example.
Previously the offset argument to mmap(2) would be bogus as we
weren't reading it in.

Approved by: re (kensmith)
2007-07-28 23:00:42 +00:00
Alan Cox
eaa29f1ce4 Add a counter for the total number of pages cached and support for
reporting the value of this counter in the program "vmstat".

Approved by:	re (rwatson)
2007-07-27 20:01:22 +00:00
Alexander Nedotsukov
7bd2b6a8ab Update for japanese holidays.
PR:		114732
Approved by:	re (rwatson)
2007-07-27 12:09:55 +00:00
Xin LI
9a0e6be26a Stop mentioning /usr/X11R6.
Approved by:	re (hrs)
2007-07-24 06:41:07 +00:00
Tim Kientzle
660665be6b Fill in some casts that are needed (according to GCC 4.1)
Thanks to: Joerg Sonnenberger
Approved by: re (hrs)
MFC after: 3 days
2007-07-20 01:27:50 +00:00
Tim Kientzle
7061a01ba7 Don't exit immediately on libarchive warnings, just
set the delayed return value and keep going.

Approved by: re (hrs)
MFC after: 7 days
2007-07-20 01:24:49 +00:00
John Baldwin
87bebf24f7 Update the default FILESYSTEMS value in a comment to note that ext2fs is
included in the default list in the locate.updatedb script.

Approved by:	re (bmah)
Inspired by:	mwlucas
2007-07-19 21:00:08 +00:00
John Baldwin
55fd53e237 Bah, fix a cosmetic nit and remove a debugging aid missed in the previous
fixes for netstat -M.

Pointy hat to:	jhb
Approved by:	re (kensmith)
2007-07-16 18:13:12 +00:00
John Baldwin
feda1a4372 Restore netstat -M functionality for most statistics on core dumps. In
general, when support was added to netstat for fetching data using sysctl,
no provision was left for fetching equivalent data from a core dump, and
in fact, netstat would _always_ fetch data from the live kernel using
sysctl even when -M was specified resulting in the user believing they
were getting data from coredumps when they actually weren't.  Some specific
changes:
- Add a global 'live' variable that is true if netstat is running against
  the live kernel and false if -M has been specified.
- Stop abusing the sysctl flag in the protocol tables to hold the protocol
  number.  Instead, the protocol is now its own field in the tables, and
  it is passed as a separate parameter to the PCB and stat routines rather
  than overloading the KVM offset parameter.
- Don't run PCB or stats functions who don't have a namelist offset if we
  are being run against a crash dump (!live).
- For the inet and unix PCB routines, we generate the same buffer from KVM
  that the sysctl usually generates complete with the header and trailer.
- Don't run bpf stats for !live (before it would just silently always run
  live).
- kread() no longer trashes memory when opening the buffer if there is an
  error on open and the passed in buffer is smaller than _POSIX2_LINE_MAX.
- The multicast routing code doesn't fallback to kvm on live kernels if
  the sysctl fails.  Keeping this made the code rather hairy, and netstat
  is already tied to the kernel ABI anyway (even when using sysctl's since
  things like xinpcb contain an inpcb) so any kernels this is run against
  that have the multicast routing stuff should have the sysctls.
- Don't try to dig around in the kernel linker in the netgraph PCB routine
  for core dumps.

Other notes:
- sctp's PCB routine only works on live kernels, it looked rather
  complicated to generate all the same stuff via KVM.  Someone can always
  add it later if desired though.
- Fix the ipsec removal bug where N_xxx for IPSEC stats weren't renumbered.
- Use sysctlbyname() everywhere rather than hardcoded mib values.

MFC after:	1 week
Approved by:	re (rwatson)
2007-07-16 17:15:55 +00:00
Robert Watson
2b851aeb63 Disconnect netatm from the build as it is not MPSAFE and relies on
NET_NEEDS_GIANT, which will shortly be removed.  This is done in a
away that it may be easily reattached to the build before 7.1 if
appropriate locking is added.  Specifics:

- Don't install netatm include files
- Disconnect netatm command line management tools
- Don't build libatm
- Don't include ATM parts in rescue or sysinstall
- Don't install sample configuration files and documents
- Don't build kernel support as a module or in NOTES
- Don't build netgraph wrapper nodes for netatm

This removes the last remaining consumer of NET_NEEDS_GIANT.

Reviewed by:	harti
Discussed with:	bz, bms
Approved by:	re (kensmith)
2007-07-14 21:49:24 +00:00
Xin LI
78b8781ab1 - Simulate GNU gzip(1) behavior where full filename is
being output in verbose mode when doing recursive[1].
 - Use better representation of S:

PR:		bin/114470
Submitted by:	Ighighi <ighighi gmail com> [1]
Approved by:	re (hrs)
2007-07-12 01:17:14 +00:00
John Baldwin
1db0049fa1 Fix alignment of context switch traces.
MFC after:	1 week
Approved by:	re (rwatson: "I like simple patches.")
2007-07-10 00:01:30 +00:00
Xin LI
870945d830 Before doing compile_re() which needs a parameter to identify
whether we should ignore case, determine the flag by calling
compile_flags() first.  Also, make sure that we obtain an
initialized cmd->u.s buffer before processing further.  We
may want to refine this solution later, but for now, make
the changes in order to unbreak world build after a sed(1)
with rev. 1.29 of compile.c is installed.

Approved by:	re (hrs)
2007-07-06 16:34:56 +00:00
Bjoern A. Zeeb
53bf725ae1 Remove the -DFAST_IPSEC from Makefiles again.
This was needed during the IPSEC->FAST_IPSEC->IPSEC transition
period to not break the build after picking up netipsec header
files. Now that the FAST_IPSEC kernel option is gone and the
default is IPSEC again those defines are superfluous.

Approved by:	re (rwatson)
2007-07-05 08:56:46 +00:00
Peter Wemm
cae1120adf kdump has knowledge of lseek() and mmap() arg decoding. Teach it about
the new mmap and lseek syscalls.

Approved by:  re (kensmith)
2007-07-04 23:32:49 +00:00
Suleiman Souhlal
bdd72b703b Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
For example,
	sed /foo/Id
	sed s/foo/bar/Ig

Reviewed by:	dds
Approved by:	re (hrs)
2007-07-04 16:42:41 +00:00
Sean Farley
2966d28c32 Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR:		kern/99826
Approved by:	wes
Approved by:	re (kensmith)
2007-07-04 00:00:41 +00:00
George V. Neville-Neil
8409aedfa6 Commit IPv6 support for FAST_IPSEC to the tree.
This commit includes all remaining changes for the time being including
user space updates.

Submitted by:    bz
Approved by:    re
2007-07-01 12:08:08 +00:00
Warner Losh
986bd8412b Add support using an alternate table file to usbhidaction(1).
Submitted by: Michael Haro
PR: 61234
Approved by: re (bmah)
2007-06-30 03:58:01 +00:00
Xin LI
ef29ac7f76 MFp4: Bugfixes for truss(1):
- Fix logic handling execve().  We will not be able to
   obtain information otherwise.
 - truss coredump [1].
 - truss does not work against itself [2].

PR:		bin/58970 [1], bin/45193 [2]
Submitted by:	Howard Su
Approved by:	re (kensmith)
2007-06-26 22:42:37 +00:00
Sean Farley
e2ebaca52a Add myself as a src committer.
Approved by:  wes (mentor)
Approved by:  re (bmah)
2007-06-25 14:28:12 +00:00
Randall Stewart
b8a1761e07 o style(9) nit.
o shorten explainations which are over 80 columns in console.
	o group rows
	o clean up and change explanations a little bit.
Obtained from:	weongyo.jeong@gmail.com
2007-06-17 14:45:28 +00:00
Randall Stewart
3f8d71d596 - Forced commit to update who actually did this code (I forgot
the obtained from in the original line)
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)
2007-06-17 01:57:08 +00:00
Maxim Konovalov
48c513e07f o Do not warn if the process exits before we get its name.
PR:		bin/113777
Submitted by:	Dmitrij Tejblum
MFC after:	1 week
2007-06-16 20:24:55 +00:00
Stefan Eßer
03fec0bdbc Never define the generated rpc server main function with storage type
"static". The header file generated by "rpcgen -h" will always declare
it as extern, leading to a "static after extern" error being issued by
gcc-4.2. This caused only a warning in gcc-3.x, but it has been wrong
all the time.

This change does not modify the code generated by "rpcgen -m", it only
affects rpcgen used to generate server stubs with a local main function.

This is the minimal patch. It does not remove the now obsolete "storage"
parameter from write_program() and write_programs() in an attempt to keep
differences to other systems' versions of rpcgen as small as possible.
2007-06-16 14:39:25 +00:00
John Baldwin
5900369697 Expand TCP counters from 9 digits to 12.
MFC after:	1 week
PR:		bin/112881
2007-06-15 18:12:58 +00:00
John Baldwin
595bf788f6 Consistently indent the R() macro for fields on the right-side of the
display to make the code easier to read.

PR:		bin/112881
2007-06-15 18:00:10 +00:00
John Baldwin
02a50a14b3 Add a new counter for retransmitted packets due to SACK.
PR:		bin/112881
Submitted by:	Phil Rosenthal <pr  isprime com>
2007-06-15 17:55:44 +00:00
Bruce Evans
e19249f7a7 Third stage of unbreaking printing of pseudo-nice values (realtime
priorities, etc.) in the NICE field:

Use a combination of pri_native and pri_user instead of pri_level to
guess the original realtime priority.  Using pri_level here has been
wrong since 2001/02/12.  Using only pri_native here would be correct
if the kernel actually initialized it reasonably.  (The kernel exports
its raw td_base_priority as pri_native, but userland mostly wants a
refined base priority).  Give up on waiting pri_native to work correctly
and only use it when there is nothing better (for kthreads).

This should reduce printing of bizarre pseudo-nice values.  Bizarre
values are still printed if we observe a transient borrowed priority
for a kthread (transient borrowing is the main thing that makes the
raw td_base_priority almost useless in userland), or if there is a
kernel bug.  One current kernel bug involves the kernel idprio thread
pagezero permanently changing its priority from PRI_MAX_IDLE (255) to
PUSER (160).  Then the bizarre value "ki-6" is printed instead of
"ki31".  Here "-6" is PRI_MIN_IDLE - PUSER = -64 truncated to 2
characters.  We are observing a transient borrowed priority that has
become permanent due to a bug.

ps/print.c:priorityr() needs similar changes (including ones in stage 2
here).
2007-06-15 12:03:07 +00:00
Timur I. Bakeyev
a79e185ffa Add myself as a commiter.
Approved by:	shaun (mentor)
2007-06-13 16:37:36 +00:00
Xin LI
04b764d8f4 sctp_process_inpcb() wants an offset parameter in size_t,
so define it as what it is expected.  This fixes WARNS=3
without NO_WERROR build.
2007-06-13 02:37:00 +00:00
Stephane E. Potvin
04031e9ae2 Options spring cleanup:
- Add and document the KVM and KVM_SUPPORT options that
are needed for the ifmcstats(3) makefile
- Garbage collect unused variables
- Add missing inclusion of bsd.own.mk where needed

Approved by: kan (mentor)
Reviewed by: ru
2007-06-13 02:08:04 +00:00
Bruce M Simpson
71498f308b Import rewrite of IPv4 socket multicast layer to support source-specific
and protocol-independent host mode multicast. The code is written to
accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work.

This change only pertains to FreeBSD's use as a multicast end-station and
does not concern multicast routing; for an IGMPv3/MLDv2 router
implementation, consider the XORP project.

The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6,
which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html

Summary
 * IPv4 multicast socket processing is now moved out of ip_output.c
   into a new module, in_mcast.c.
 * The in_mcast.c module implements the IPv4 legacy any-source API in
   terms of the protocol-independent source-specific API.
 * Source filters are lazy allocated as the common case does not use them.
   They are part of per inpcb state and are covered by the inpcb lock.
 * struct ip_mreqn is now supported to allow applications to specify
   multicast joins by interface index in the legacy IPv4 any-source API.
 * In UDP, an incoming multicast datagram only requires that the source
   port matches the 4-tuple if the socket was already bound by source port.
   An unbound socket SHOULD be able to receive multicasts sent from an
   ephemeral source port.
 * The UDP socket multicast filter mode defaults to exclusive, that is,
   sources present in the per-socket list will be blocked from delivery.
 * The RFC 3678 userland functions have been added to libc: setsourcefilter,
   getsourcefilter, setipv4sourcefilter, getipv4sourcefilter.
 * Definitions for IGMPv3 are merged but not yet used.
 * struct sockaddr_storage is now referenced from <netinet/in.h>. It
   is therefore defined there if not already declared in the same way
   as for the C99 types.
 * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF
   which are then interpreted as interface indexes) is now deprecated.
 * A patch for the Rhyolite.com routed in the FreeBSD base system
   is available in the -net archives. This only affects individuals
   running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces.
 * Make IPv6 detach path similar to IPv4's in code flow; functionally same.
 * Bump __FreeBSD_version to 700048; see UPDATING.

This work was financially supported by another FreeBSD committer.

Obtained from:  p4://bms_netdev
Submitted by:   Wilbert de Graaf (original work)
Reviewed by:    rwatson (locking), silence from fenner,
		net@ (but with encouragement)
2007-06-12 16:24:56 +00:00
Yaroslav Tykhiy
85ae5d2f94 Drop the argument to the OUT macro because it can't emit
anything but the pattern space anyway.  Apply style(9)
to the macro.

Tested with:	md5(1)
2007-06-12 12:17:25 +00:00
Yaroslav Tykhiy
26a5710c40 Don't forget to clear out the hold space for each subsequent file
when in -i mode so that each file gets a clean context of its own.

Add a regression test for the bug.

Tested with:	regression tests
2007-06-12 12:05:24 +00:00