sscanf in kernel

Juli Mallett jmallett at FreeBSD.org
Wed Mar 17 21:13:53 UTC 2010


On Wed, Mar 17, 2010 at 13:39, igeek <gds089 at gmail.com> wrote:
> On Mar 17, 2010, at 2:12 PM, serena zanetta wrote:
>> Hi,
>> I need to convert an ascii string in its corresponding hex version (the
>> same
>> as sscanf(str,"%02x%02x...",...) does) in the kernel.

FreeBSD has sscanf in the kernel.  See <sys/systm.h>.  That said,
sscanf is pretty evil — are you sure it's what you want?  Are you sure
you need to parse it in the kernel instead of in userland?

> sscanf() has a kernel version declared in kernel.h.
> http://www.gelato.unsw.edu.au/lxr/source/include/linux/kernel.h#L196

I believe you are confused.  FreeBSD is not Linux.


More information about the freebsd-net mailing list