kldload exec format error on amd64 freebsd-7.1-rc2

Barney Cordoba barney_cordoba at yahoo.com
Wed Jan 21 03:14:21 PST 2009




--- On Tue, 1/20/09, Dag-Erling Smørgrav <des at des.no> wrote:

> From: Dag-Erling Smørgrav <des at des.no>
> Subject: Re: kldload exec format error on amd64 freebsd-7.1-rc2
> To: barney_cordoba at yahoo.com
> Cc: freebsd-current at freebsd.org, "Christof Schulze" <christof.schulze at gmx.net>
> Date: Tuesday, January 20, 2009, 1:34 PM
> Barney Cordoba <barney_cordoba at yahoo.com> writes:
> > Is there any interest in fixing this stupid and wrong
> error message to
> > be something like "unresolved externals" at
> some point?
> 
> When the kernel fails to load a module, kldload(2) returns
> ENOEXEC,
> which strerror(3) translates to "exec format
> error".  If you can think
> of a better errno value to use, feel free to send patches. 
> The only
> alternatives I can think of are ENOSYS (ambiguous) and
> EFTYPE (just as
> vague as ENOEXEC).
> 
> DES

Have errnos reached MAXINT already?

#define ENOREF 93

Or maybe some intelligent code, instead of just blindly calling warn(), since its just as likely an unresolved as it is a format error.

I've patched mine to include "may have unresolved externals" so my customers have some idea that they might have a mismatched kernel. The 
best solution is a more specific error. I'm not  quite sure why BSD developers are so frugal with errnos, but there must be a secret reason for it. Nobody really cares if yacc returns EINVAL for every error, but functionally visible binaries like kldload, which non-programmer users will encounter regularly, should have less cryptic error messages if possible. 

kldload is what, 11  years old now? Its time.

Barney


      


More information about the freebsd-current mailing list