diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
index 5472294c..19afe362 100644
--- a/doc/jemalloc.xml.in
+++ b/doc/jemalloc.xml.in
@@ -3608,7 +3608,8 @@ MAPPED_LIBRARIES:
NULL, and newlen is too
large or too small. Alternatively, *oldlenp
is too large or too small; in this case as much data as possible
- are read despite the error.
+ are read despite the error, with the amount of data read being
+ recorded in *oldlenp.
ENOENT
diff --git a/src/ctl.c b/src/ctl.c
index 62a82a20..92e9f511 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1494,6 +1494,7 @@ ctl_mtx_assert_held(tsdn_t *tsdn) {
size_t copylen = (sizeof(t) <= *oldlenp) \
? sizeof(t) : *oldlenp; \
memcpy(oldp, (void *)&(v), copylen); \
+ *oldlenp = copylen; \
ret = EINVAL; \
goto label_return; \
} \