Unfortunately, Linux doesn't have MAP_NOCORE.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@696 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
dfe04a59e4
commit
fe081dbbfc
|
@ -53,9 +53,14 @@ struct oath_key *
|
|||
oath_key_alloc(void)
|
||||
{
|
||||
struct oath_key *key;
|
||||
int prot, flags;
|
||||
|
||||
if ((key = mmap(NULL, sizeof *key, PROT_READ|PROT_WRITE,
|
||||
MAP_ANON|MAP_NOCORE, -1, 0)) == NULL) {
|
||||
prot = PROT_READ|PROT_WRITE;
|
||||
flags = MAP_ANON;
|
||||
#ifdef MAP_NOCORE
|
||||
flags |= MAP_NOCORE;
|
||||
#endif
|
||||
if ((key = mmap(NULL, sizeof *key, prot, flags, -1, 0)) == NULL) {
|
||||
memset(key, 0, sizeof *key);
|
||||
key->mapped = 1;
|
||||
if (mlock(key, sizeof *key) == 0)
|
||||
|
|
Loading…
Reference in New Issue