RE: sysctl add macros

From: Venkata Duvvuru <VenkatKumar.Duvvuru_at_Emulex.Com>
Date: Mon, 25 Nov 2013 14:58:50 +0000
The problem with using int or u_int for 1 or 2 byte values is that while printing these 1 or 2 byte values I observed that sysctl module is considering 4 bytes. Hence I see an undesired output. It is actually considering the next two bytes also as the value.

/Venkat.

From: mdf356_at_gmail.com [mailto:mdf356_at_gmail.com] On Behalf Of Matthew Fleming
Sent: Monday, November 25, 2013 8:18 PM
To: Venkata Duvvuru
Cc: freebsd-current_at_freebsd.org
Subject: Re: sysctl add macros

On Mon, Nov 25, 2013 at 3:35 AM, Venkata Duvvuru <VenkatKumar.Duvvuru_at_emulex.com<mailto:VenkatKumar.Duvvuru_at_emulex.com>> wrote:
Hi,
I'm unable to figure out how to add an unsigned short or an unsigned char values to a sysctl node.
SYSCTL_ADD_INT, SYSCTL_ADD_UINT, etc., are present but to add a char or a short 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
Received on Mon Nov 25 2013 - 13:58:53 UTC

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