| 1597 | */ |
| 1598 | |
| 1599 | int |
| 1600 | sysctl_handle_int(SYSCTL_HANDLER_ARGS) |
| 1601 | { |
| 1602 | int tmpout, error = 0; |
| 1603 | |
| 1604 | /* |
| 1605 | * Attempt to get a coherent snapshot by making a copy of the data. |
| 1606 | */ |
| 1607 | if (arg1) |
| 1608 | tmpout = *(int *)arg1; |
| 1609 | else |
| 1610 | tmpout = arg2; |
| 1611 | error = SYSCTL_OUT(req, &tmpout, sizeof(int)); |
| 1612 | |
| 1613 | if (error || !req->newptr) |
| 1614 | return (error); |
| 1615 | |
| 1616 | if (!arg1) |
| 1617 | error = EPERM; |
| 1618 | else |
| 1619 | error = SYSCTL_IN(req, arg1, sizeof(int)); |
| 1620 | return (error); |
| 1621 | } |
| 1622 | |
| 1623 | /* |
| 1624 | * Based on on sysctl_handle_int() convert milliseconds into ticks. |
no outgoing calls
no test coverage detected