Re: kldload exec format error on amd64 freebsd-7.1-rc2

From: Barney Cordoba <barney_cordoba_at_yahoo.com>
Date: Wed, 21 Jan 2009 03:14:17 -0800 (PST)
--- 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


      
Received on Wed Jan 21 2009 - 10:14:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC