On Wed, Aug 25, 2010 at 7:27 PM, Wes Hardaker <
harda...@users.sourceforge.net> wrote:

> >>>>> On Wed, 25 Aug 2010 17:14:20 +0200, Bart Van Assche <
> bvanass...@acm.org> said:
>
> BVA> In my opinion /dev/kmem should be detected at runtime, not from the
> BVA> configure script: trying to detect /dev/kmem from the configure
> BVA> script does not only break cross-compilation but also gives
> BVA> undesired results when Net-SNMP is built on a system that has
> BVA> /dev/kmem and is run on a system that does not have /dev/kmem, or
> BVA> vice versa.
>
> Well, I agree in principal...  However:
>
> 1) I think that'd require modifying a lot of code and ifdefs and thus
>   something like that should be push beyond 5.6
> 2) Adds to code-bloat in a running agent since both methods always have
>   to be compiled in.
>

Code bloat ? All that is needed to test whether or not /dev/kmem exists is
something like the code below, which can e.g. be put in a function in such a
way that the stat() system call is only invoked once:

struct stat devkmem;
if (stat("/dev/kmem", &devkmem) >= 0)
    ...

See also http://www.opengroup.org/onlinepubs/009695399/functions/stat.html.

Bart.
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to