aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-02-07 13:46:12 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-02-09 19:37:28 +0100
commit5ae403a2d4aa8b78f0e1ee6952b1a4aeb7fdffae (patch)
treefa9b134a8d30c39bce24160bdf55d1ba3c04873d
parent47918752700e27e192008a49ea879a4ffe8cdcd6 (diff)
downloadman-pages-5ae403a2d4aa8b78f0e1ee6952b1a4aeb7fdffae.tar.gz
mlock.2: mlock2(): Fix prototype parameter types
The documented prototype for mlock2() was a mix of the glibc wrapper prototype and the kernel syscall prototype. Let's document the glibc wrapper prototype, which is shown below. ...... .../glibc$ grep_glibc_prototype mlock2 sysdeps/unix/sysv/linux/bits/mman-shared.h:55: int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW; .../glibc$ function grep_glibc_prototype() { if ! [ -v 1 ]; then >&2 echo "Usage: ${FUNCNAME[0]} <func>"; return ${EX_USAGE}; fi find * -type f \ |grep '\.h$' \ |sort -V \ |xargs pcregrep -Mn \ "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; } Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/mlock.22
1 files changed, 1 insertions, 1 deletions
diff --git a/man2/mlock.2 b/man2/mlock.2
index 2822df7cf3..f48d632c4e 100644
--- a/man2/mlock.2
+++ b/man2/mlock.2
@@ -31,7 +31,7 @@ mlock, mlock2, munlock, mlockall, munlockall \- lock and unlock memory
.B #include <sys/mman.h>
.PP
.BI "int mlock(const void *" addr ", size_t " len );
-.BI "int mlock2(const void *" addr ", size_t " len ", int " flags );
+.BI "int mlock2(const void *" addr ", size_t " len ", unsigned int " flags );
.BI "int munlock(const void *" addr ", size_t " len );
.PP
.BI "int mlockall(int " flags );