[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mlockall(2) _really_ locks up
- To: tech@openbsd.org
- Subject: mlockall(2) _really_ locks up
- From: Srebrenko Sehic <haver@insecure.dk>
- Date: Wed, 11 Jun 2003 20:19:09 +0200
- Content-Disposition: inline
- User-Agent: Mutt/1.5.4i
Following code will lock x86-current (3 weeks old) machine. It needs to
be run as root. Running it as unprivliged user doesn't have the same
effect.
I discovered this while trying to compile an app that runs this test in
it's configure script.
Any clues why this happens?
#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#ifndef HAVE_ERRNO_DEF
extern int errno;
#endif
int
main()
{
if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) {
if (errno == EINVAL || errno == ENOMEM ||
errno == EPERM || errno == EACCES)
exit(0);
exit(-1);
}
exit(0);
}