mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 07:37:25 -04:00
Add a function for exporting 64 bit types.
This commit is contained in:
parent
41e419cb61
commit
df82ff50ed
2 changed files with 26 additions and 0 deletions
|
|
@ -891,6 +891,31 @@ sysctl_handle_long(SYSCTL_HANDLER_ARGS)
|
|||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle a 64 bit int, signed or unsigned. arg1 points to it.
|
||||
*/
|
||||
|
||||
int
|
||||
sysctl_handle_quad(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error = 0;
|
||||
uint64_t tmpout;
|
||||
|
||||
/*
|
||||
* Attempt to get a coherent snapshot by making a copy of the data.
|
||||
*/
|
||||
if (!arg1)
|
||||
return (EINVAL);
|
||||
tmpout = *(uint64_t *)arg1;
|
||||
error = SYSCTL_OUT(req, &tmpout, sizeof(uint64_t));
|
||||
|
||||
if (error || !req->newptr)
|
||||
return (error);
|
||||
|
||||
error = SYSCTL_IN(req, arg1, sizeof(uint64_t));
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle our generic '\0' terminated 'C' string.
|
||||
* Two cases:
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ struct sysctl_oid {
|
|||
int sysctl_handle_int(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_handle_long(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_handle_quad(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_handle_intptr(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_handle_string(SYSCTL_HANDLER_ARGS);
|
||||
int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue