c++ – Why do we need newp, newLen parameters in sysctl () function?

Question:

The documentation for the sysctl function says the following:

To set a new value, newp is set to point to a buffer of length newlen from which the requested value is to be taken. If a new value is not to be set, newp should be set to NULL and newlen set to 0.

But I can't figure out what this means.

Answer:

Literal translation:

To set a new value, newp points to a buffer of length newlen from which the requested value is taken. If no new value is set, then newp must be set to NULL and newlen to 0.

Scroll to Top