Skip to contentSkip to conversation

man page mlock/munlock

DISCUSSION Mehdi Aqadjani Memar 2 participants 3 messages May 6, 2015 – Jul 22, 2015 2 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Dear Michael Kerrisk,
in my application I am using munlock() as described in the man page. munlock() fails and returns ENOMEM. The man page for this error has not helped me to find out what the problem was. I traced my code and discovered that this error appears when "the process's maximum number of mappings would have been exceeded", as it is mentioned at the man page of mmap(). This happens because munlock() splits the vma's.
I believe that this information should be a part of the man page of munlock().

Signature · 6 lines
Met vriendelijke groet/Kind regards
Mehdi Aqadjani Memar
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hello Mehdi

Quoted 11 lines · Mehdi Aqadjani Memar

Dear Michael Kerrisk,
in my application I am using munlock() as described in the man page. munlock() fails and returns ENOMEM. The man page for this error has not helped me to find out what the problem was. I traced my code and discovered that this error appears when "the process's maximum number of mappings would have been exceeded", as it is mentioned at the man page of mmap(). This happens because munlock() splits the vma's.
I believe that this information should be a part of the man page of munlock(). --
Met vriendelijke groet/Kind regards
Mehdi Aqadjani Memar

Thanks for the report, and sorry for the delayed response. I've confirmed your point. How would the following text be:

ENOMEM Locking or unlocking a region would result in the total
number of mappings with distinct attributes (e.g., locked versus unlocked) exceeding the allowed maximum. (For example, unlocking a range in the middle of a currently locked mapping would result in three mappings: two locked mappings at each end and an unlocked mapping in the mid‐ dle.)
?

Thanks,

Michael

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAKgNAkjMuMdu952zj_3kL7cmC-xeRzTzDo_2emxwjEoG+2YVFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

Hello Michael,
thank you for your reply!
Your text has explained the effect of locking and unlocking very well. Regards,
Mehdi

Quoted 31 lines · Michael Kerrisk (man-pages)

Hello Mehdi

Quoted 11 lines · Mehdi Aqadjani Memar

Dear Michael Kerrisk,
in my application I am using munlock() as described in the man page. munlock() fails and returns ENOMEM. The man page for this error has not helped me to find out what the problem was. I traced my code and discovered that this error appears when "the process's maximum number of mappings would have been exceeded", as it is mentioned at the man page of mmap(). This happens because munlock() splits the vma's.
I believe that this information should be a part of the man page of munlock(). --
Met vriendelijke groet/Kind regards
Mehdi Aqadjani Memar

Thanks for the report, and sorry for the delayed response. I've confirmed your point. How would the following text be:

ENOMEM Locking or unlocking a region would result in the total
number of mappings with distinct attributes (e.g., locked versus unlocked) exceeding the allowed maximum. (For example, unlocking a range in the middle of a currently locked mapping would result in three mappings: two locked mappings at each end and an unlocked mapping in the mid‐ dle.)
?

Thanks,

Michael

Signature · 6 lines
Met vriendelijke groet/Kind regards
Mehdi Aqadjani Memar
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html