Modify mallctl output length when needed
This is the only reason why `oldlenp` was designed to be in the form of a pointer.
This commit is contained in:
parent
4258402047
commit
f5fb4e5a97
@ -3608,7 +3608,8 @@ MAPPED_LIBRARIES:
|
|||||||
<constant>NULL</constant>, and <parameter>newlen</parameter> is too
|
<constant>NULL</constant>, and <parameter>newlen</parameter> is too
|
||||||
large or too small. Alternatively, <parameter>*oldlenp</parameter>
|
large or too small. Alternatively, <parameter>*oldlenp</parameter>
|
||||||
is too large or too small; in this case as much data as possible
|
is too large or too small; in this case as much data as possible
|
||||||
are read despite the error.</para></listitem>
|
are read despite the error, with the amount of data read being
|
||||||
|
recorded in <parameter>*oldlenp</parameter>.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><errorname>ENOENT</errorname></term>
|
<term><errorname>ENOENT</errorname></term>
|
||||||
|
@ -1494,6 +1494,7 @@ ctl_mtx_assert_held(tsdn_t *tsdn) {
|
|||||||
size_t copylen = (sizeof(t) <= *oldlenp) \
|
size_t copylen = (sizeof(t) <= *oldlenp) \
|
||||||
? sizeof(t) : *oldlenp; \
|
? sizeof(t) : *oldlenp; \
|
||||||
memcpy(oldp, (void *)&(v), copylen); \
|
memcpy(oldp, (void *)&(v), copylen); \
|
||||||
|
*oldlenp = copylen; \
|
||||||
ret = EINVAL; \
|
ret = EINVAL; \
|
||||||
goto label_return; \
|
goto label_return; \
|
||||||
} \
|
} \
|
||||||
|
Loading…
Reference in New Issue
Block a user