tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: General device properties API
Hello,
On Fri, 13 Aug 2021 19:10:20 -0700
Jason Thorpe <thorpej%me.com@localhost> wrote:
> ==> int device_getprop_string(device_t dev, const char *prop, void *buf, int buflen);
> Fetch the specified property as a string info buf, copying at most
> buflen bytes, **including the terminating NUL**. If the backing
> store has typing information, ensures the property is a string.
> Returns the actual size of the property in the backing store
> **including the terminating NUL** or -1 if the property does not
> exist or is not a string.
Does this append a NUL if the property doesn't have one?
IIRC OpenFirmware can be a bit inconsistent with that, I remember doing
things like zeroing the buffer, then requesting buffer_size - 1 from
OF_getprop() to make sure the result is NUL terminated.
Looking at you, Apple...
have fun
Michael
Home |
Main Index |
Thread Index |
Old Index