mlock requires privilege
Open, NormalPublic

Description

On Solaris, mlock(2) requires PRIV_PROC_LOCK_MEMORY} privilege to work.
Similarly, with FreeBSD kernel configured with

# sysctl security.bsd.unprivileged_mlock=0

It is priviledged operation.