Commit Graph

17 Commits

Author SHA1 Message Date
Wojciech A. Koszek
5658c6d3f7 Extend kldunload(8) functionality and fix minor problems:
o multiple modules can be unloaded at once (specified either by id or be
  module name)
o exit with EX_USAGE after usage() is called.
o remove unused variables, since we keep command line flags as bitmask,
  in 'opt'.
o 'kldload -n ...' does nothing. Add comment to this options.

Additionally:
o Update manual page to conform new functionality.
o Increace WARNS to 6. Because we can.

Approved by:	cognet (mentor)
MFC after:	1 week
2006-02-27 22:20:57 +00:00
Wojciech A. Koszek
2b1165e30a Big style(9) fix. This commit brings no functional change.
Approved by:	cognet (mentor)
MFC after:	1 week
2006-02-27 21:55:47 +00:00
Ruslan Ermilov
48dd075bf1 Document -f in usage(). 2005-01-30 13:23:04 +00:00
Poul-Henning Kamp
65a311fcb2 Give kldunload a -f(orce) argument.
Add a MOD_QUIESCE event for modules.  This should return error (EBUSY)
of the module is in use.

MOD_UNLOAD should now only fail if it is impossible (as opposed to
inconvenient) to unload the module.  Valid reasons are memory references
into the module which cannot be tracked down and eliminated.

When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is
not given, MOD_QUIESCE failing will also prevent the unload.

For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as
success.

Document that modules should return EOPNOTSUPP for unknown events.
2004-07-13 19:36:59 +00:00
David E. O'Brien
c69284ca08 Use __FBSDID() to quiet GCC 3.3 warnings. 2003-05-03 18:41:59 +00:00
Johan Karlsson
7f10745771 style(9): use NULL when assigning/comparing a char *,
consitently compare fileid with 0 using == and !=.

Reviewed by:	silence on @audit
2003-04-23 20:33:57 +00:00
Johan Karlsson
7d2101965f Make this WARNS=5 clean by adding () in 'if (a || (b && c))'.
Look at by:	sebastian.ssmoller@web.de on audit@
2003-04-23 20:26:21 +00:00
Bruce Evans
4255717924 Fixed bitrot in usage message (-n is now optional). 1999-09-08 05:46:47 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Nick Hibma
7d83305d4e Add a sensible message if an invalid ID was entered
PR:		8739
Submitted by:	Love lha@stacken.kth.se
Reviewed by:	Doug Rabson <doug@freebsd.org>
1999-07-25 11:00:05 +00:00
Dag-Erling Smørgrav
eda1fa0957 Bitch if both an id and a name are specified. Make the man page and usage
message reflect this. As a bonus, make the -n optional so that 'kldunload
name' works as one would expect.
1998-11-07 00:42:52 +00:00
Philippe Charnier
063bb8badc Lowercase 1st char. in err(3) strings. 1998-07-06 06:59:52 +00:00
Philippe Charnier
57e78ffb16 Sync. usage string and synopsis. Add rcsid. 1998-01-05 07:10:42 +00:00
John-Mark Gurney
60add4e38d fix mispelling of kld 1997-10-24 05:30:12 +00:00
John-Mark Gurney
2830148a29 a few code style changes:
o start function names in column 1
    o sort order of flags in getopt and switch
    o don't try to reference progname
    o unspam some changes introduced by a 2.2.1-R build box instead of a
	-current build box

doc changes:
    o document when these commands first appeared
    o put email address in angle brakets
    o minor mdoc clean up
1997-10-21 09:59:26 +00:00
John-Mark Gurney
23e200d5ab activate the programs that will be used to manipulate kld modules
fix a few problems with missing headers, warn called with an exit
value, and undeclared getopt vars

these programs now compile -Wall clean (and yes, I know I should use
more than just -Wall) :)
1997-10-19 11:15:45 +00:00
Doug Rabson
a79fe60755 Add utilities for the kernel linker. 1997-05-07 18:19:54 +00:00