Commit Graph

24 Commits

Author SHA1 Message Date
markm
3382584a53 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
ru
4d4cec31b2 Not too much point specifying -N but not specifying -M. 2004-03-26 09:24:45 +00:00
iedowse
8b1fc57339 Further simplify the code for printing the message buffer:
- Ensure that the buffer ends with "\n\0" to avoid special cases
   and allow the use of strtol().
 - Use strvisx() on each complete line instead of character by
   character.

Submitted by:	bde
MFC after:	1 week
2004-02-08 23:08:53 +00:00
iedowse
84628eff1c Don't print the oldest line in the message buffer if the buffer is
full, since that line is almost always incomplete. Make the parsing
of <%d> lines more strict.

Also simplify the logic a little:
 - Start off by making the buffer linear so that we don't have to
   deal with it wrapping around (suggested by bde).
 - Process line by line rather than byte at a time.
2004-02-05 21:07:50 +00:00
iedowse
4b4bacfb9a Replace the code for reading and writing the kernel message buffer
with a new implementation that has a mostly reentrant "addchar"
routine, supports multiple message buffers in the kernel, and hides
the implementation details from callers.

The new code uses a kind of sequence number to represend the current
read and write positions in the buffer. This approach (suggested
mainly by bde) permits the read and write pointers to be maintained
separately, which reduces the number of atomic operations that are
required. The "mostly reentrant" above refers to the way that while
it is now always safe to have any number of concurrent writers,
readers could see the message buffer after a writer has advanced
the pointers but before it has witten the new character.

Discussed on:	freebsd-arch
2003-06-22 02:18:31 +00:00
obrien
489743d041 bufpos is used in size_t contexts, so make it one. 2003-05-02 07:08:52 +00:00
bde
a1b0d4b756 Include <nlist.h> for nlist interfaces instead of depending on namespace
pollution in <kvm.h>.
2002-08-18 17:57:08 +00:00
imp
2abd102587 o Remove __P
o Use ANSI function definitions
o mark usage() as __dead2
2002-03-19 13:29:39 +00:00
billf
7b70d8e03b add -a to usage()
Submitted by:	Ashley Penney <ashp@unloved.org>
MFC after:	3 days
2001-07-14 21:56:04 +00:00
tmm
ae1087b3dd Use the kern.msgbuf sysctl to get the message buffer on a running
kernel, and remove setgid kmem, which is not needed any more.
2001-07-03 19:49:31 +00:00
ru
a455e0b30d Backout -a restriction hack.
Requested by:	rwatson
2001-02-26 08:09:51 +00:00
ru
884e483150 Restrict -a to root only.
PR:		bin/25337
2001-02-24 10:16:54 +00:00
phk
0a600ec825 Add a -a option to show the entire message buffer. 2000-12-17 19:05:17 +00:00
peter
e226894fa0 $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
hoek
f25124165a Use an error message that more clearly indites(sp?) an out-of-sync
kernel+userland when that is the case.

PR:		bin/7414
1998-07-27 18:53:45 +00:00
charnier
b48ede248a Use .Pa for filenames. Use .Bl/.El in FILES section. Remove unused #includes. 1998-06-04 06:51:14 +00:00
phk
8aa81c2fdf Make the size of the msgbuf (dmesg) a "normal" option. 1998-05-19 08:58:53 +00:00
imp
88b6081b7e compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
peter
4997d39dce Revert $FreeBSD$ to $Id$ 1997-02-22 14:40:44 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
bde
10a7419102 Who would have though that dmesg didn't understand message buffers?
Fixed the following bugs:
- the buffer was reprinted endlessly when msg.bufx == 0 and (for a
  different reason) when msg.bufx == 1.
- the last byte of the buffer wasn't printed except in the the infinite
  loop cases.
- the comment about walking the buffer didn't match the (correct) code.
- minor -Wall and style bugs.
Not fixed:
- excessive newline processing which hid the non-printing of the last
  byte of the buffer.
1996-09-21 08:11:22 +00:00
alex
4674754eec Add #include <err.h>. 1996-06-19 01:49:01 +00:00
ache
d461006ff1 Add setlocale LC_CTYPE 1995-10-23 23:36:55 +00:00
rgrimes
d038e02fd6 BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00