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
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;

function grep_glibc_prototype()
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <func>";
		return ${EX_USAGE};

	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 <>
Signed-off-by: Michael Kerrisk <>
1 file changed