Commit Graph

8637 Commits

Author SHA1 Message Date
Ruslan Ermilov
0decbf9db9 Fix printing of the number of syncache entries added. 2007-12-18 12:07:10 +00:00
Edwin Groothuis
fa44a2923e Stylify ipcs/ipcs.c and ipcrm/ipcrm in preparation of the upcoming
changes as proposed in bin/118292.

Feel free to mention any I have missed, there is much to learn with
regarding to style(9).

Approved by:	grog@
2007-12-18 09:39:47 +00:00
Maxim Konovalov
fe832db659 o Fix a holiday to reflect a reality.
Submitted by:	Andrey V. Elsukov
MFC after:	1 week
2007-12-17 07:36:39 +00:00
Edwin Groothuis
1b61ad6f38 Give a better description when a install of multiple files fails
because of the absence of a destination directory or if the
"destination directory" is not a directory.

PR:		bin/11826
Submitted by:	Denis Eremenko <moonshade@pnhz.kz>
Approved by:	grog@
X-MFC after:	various freezes
2007-12-14 08:46:57 +00:00
Peter Wemm
4adb5266e8 Add the -H, -h and -P flags to vmstat. -P causes per-cpu output of
user/system/idle stats.  -h feeds the memory column through
humanize_number() to reduce the amount of column overflowing.  -H turns
this off.  -h is turned on by default if stdout is a tty.
2007-12-13 02:36:11 +00:00
Robert Watson
5a246d2912 Add 'COMM' column to a few more output modes of procstat(1). The only
one it's missing from is the VM display, where there's really not room,
and the file output display is looking quite cramped.
2007-12-10 20:55:43 +00:00
Warner Losh
640360c2f4 Use a clever definition of __FBSDID to allow building on !FreeBSD systems. 2007-12-09 16:48:51 +00:00
John Baldwin
b850a685ce Add several missing comma's in the fancy syscall parsing case before
some arguments that are parsed (e.g., semctl command names).

MFC after:	3 days
2007-12-06 08:49:43 +00:00
Robert Watson
45c29f5ba2 Display per-thread command line in TDNAME field for -k and -t; if
no per-thread name is available or the name is identical to the
process name, display "-" instead.  Very slightly shrink the COMM
entry to make a bit more room, although this doesn't help with
stack traces much.

Suggested by:	thompsa
2007-12-03 21:21:15 +00:00
Robert Watson
b59f38b57c Connect procstat(1) to the build. 2007-12-02 23:32:03 +00:00
Robert Watson
3d91be41d1 Add procstat(1), a process inspection utility. This provides both some
of the missing functionality from procfs(4) and new functionality for
monitoring and debugging specific processes.  procstat(1) operates in
the following modes:

  -b  Display binary information for the process.
  -c  Display command line arguments for the process.
  -f  Display file descriptor information for the process.
  -k  Display the stacks of kernel threads in the process.
  -s  Display security credential information for the process.
  -t  Display thread information for the process.
  -v  Display virtual memory mappings for the process.

Further revision and modes are expected.

Testing, ideas, etc:	cognet, sam, Skip Ford <skip at menantico dot com>
			Wesley Shields <wxs at atarininja dot org>
2007-12-02 23:31:45 +00:00
Philip Paeps
db3dfd0efa Add a cross-reference to newgrp(1).
Every time I need newgrp, I forget its name but I remember it's like
login for groups - newgrp(1) already cross-references login(1).

MFC after:	2 days
2007-11-30 11:02:36 +00:00
John Birrell
ee8a5fa77d Remove _SOLARIS_C_SOURCE now that it doesn't do anything in FreeBSD
headers. All OpenSolaris compatibility comes via the set of specific
compatibility headers in src/compat/opensolaris and
src/sys/compat/opensolaris.
2007-11-28 22:58:09 +00:00
Max Khon
cb0ed6eefb Fix -jX when makefiles are remade. 2007-11-25 20:43:27 +00:00
Tai-hwa Liang
e7356456ed Nuking the temporary pointer once it is properly tracked in local storage.
This should fix the double free() bug where there's no tailing newline(\n)
character:

	current# echo -n test | tail
	testAssertion failed: (run->magic == ARENA_RUN_MAGIC), function
	arena_dalloc, file /usr/src/lib/libc/stdlib/malloc.c, line 2448.
	Abort (core dumped)

Reviewed by:	kib
MFC after:	3 days
2007-11-22 01:51:46 +00:00
John Birrell
0aad0f2282 These are the things that the tinderbox has problems with because it
doesn't use the default CFLAGS which contain -fno-strict-aliasing.

Until the code is cleaned up, just add -fno-strict-aliasing to the
CFLAGS of these for the tinderboxes' sake, allowing the rest of the
tree to have -Werror enabled again.
2007-11-20 02:07:30 +00:00
John Birrell
844b78330c Generate code that doesn't fail gcc 4.2's strict aliasing test. 2007-11-20 01:46:12 +00:00
John Birrell
13959da95c Reduce the WARNS levels in a couple of places so that we can enable
-Werror at higher WARNS levels like we did before gcc4 was imported.
2007-11-18 00:29:36 +00:00
John Birrell
dd43ab7d9b Use variable types which match the function prototypes. 2007-11-17 23:21:38 +00:00
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