On Fri, 2010-07-23 at 07:35 -0700, Alan Coopersmith wrote:
> James C. McPherson wrote:
> > On 23/07/10 07:14 PM, 邓宁 wrote:
> >>
> >> Dear solaris gurus,
> >> I have a stupid question when writing a program under solaris. In the
> >> program, I want to use the system function ddi_fls() and ddi_ffs().
> >> Can you show me how to use the ddi_XXXX() function in my userland code?
> > 
> > I did a quick check using cscope on the ON gate, and I cannot
> > find any example of these functions being used in userland.
> > All the usage I find of them is in the kernel ($SRC/uts).
> > 
> > When I read through $SRC/uts/common/sys/sunddi.h, I see that
> > those functions are contained within an
> > 
> > #ifdef _KERNEL
> > 
> > block, so it seems to me that the manpage (and WDD) is incorrect
> > because you cannot use these two functions outside of the kernel.
> 
> In userland code, you'd just use the standard ffs() in libc instead.
> I don't know of a userland fls equivalent off hand though.

There isn't one.  You'd have to roll your own.

        - Garrett



_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to