Bug 22175

Summary: kldstat(2) does not return error value, and kldstat(1) uses it.
Product: Base System Reporter: NOKUBI Hirotaka <nokubi>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   

Description NOKUBI Hirotaka 2000-10-21 07:00:01 UTC
	Kldstat(2) man page saids it seems always returns 0, and kldstat(1)
	expects negative return value when some error condition occurs.
	It seems that klkstat() in src/sys/kern/kern_linker.c returns 0 on
	successful case, or some garbage on failed case (or, p_retval[0]'s
	initial value?).

Fix: 

I think kldstat(2) should return -1 when some error condition occurs.
	Kldnext(2) has same problem.
Comment 1 dd freebsd_committer freebsd_triage 2001-06-19 01:17:11 UTC
State Changed
From-To: open->closed

The man page no longer says what you describe, and from visual inspection 
it looks like the kldstat code does the right thing.  If you think this 
is still a problem, please file another PR with *a lot* more details.