Date: Mon, 25 Nov 2013 14:58:50 +0000 From: Venkata Duvvuru <VenkatKumar.Duvvuru@Emulex.Com> To: Matthew Fleming <mdf@FreeBSD.org> Cc: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: RE: sysctl add macros Message-ID: <BF3270C86E8B1349A26C34E4EC1C44CB2C7E0D3E@CMEXMB1.ad.emulex.com> In-Reply-To: <CAMBSHm9K_Yu9SDdHP1exh99RXq9tta7kwVWQbEY_zs2ZJa5RjQ@mail.gmail.com> References: <BF3270C86E8B1349A26C34E4EC1C44CB2C7E0C74@CMEXMB1.ad.emulex.com> <CAMBSHm9K_Yu9SDdHP1exh99RXq9tta7kwVWQbEY_zs2ZJa5RjQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
The problem with using int or u_int for 1 or 2 byte values is that while pr= inting these 1 or 2 byte values I observed that sysctl module is considerin= g 4 bytes. Hence I see an undesired output. It is actually considering the = next two bytes also as the value. /Venkat. From: mdf356@gmail.com [mailto:mdf356@gmail.com] On Behalf Of Matthew Flemi= ng Sent: Monday, November 25, 2013 8:18 PM To: Venkata Duvvuru Cc: freebsd-current@freebsd.org Subject: Re: sysctl add macros On Mon, Nov 25, 2013 at 3:35 AM, Venkata Duvvuru <VenkatKumar.Duvvuru@emule= x.com<mailto:VenkatKumar.Duvvuru@emulex.com>> wrote: Hi, I'm unable to figure out how to add an unsigned short or an unsigned char v= alues to a sysctl node. SYSCTL_ADD_INT, SYSCTL_ADD_UINT, etc., are present but to add a char or a s= hort values I couldn't find any macros. Could you please let me know how to add them? FreeBSD does not have any sysctl handlers for 1 or 2 byte values. FreeBSD = code that wants to do this has used int or u_int instead of a smaller type. Cheers, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BF3270C86E8B1349A26C34E4EC1C44CB2C7E0D3E>