Re: Alloc and lock down large amounts of memory

Gilad Ben-Yossef
2002-08-18T12:18:11Z

On Sun, 2002-08-18 at 15:09, Gilad Ben-Yossef wrote:

> > 4. When a process exits will it cause a close to occur on the device?
>
> Depends how you got the shared memeory. With mmap() it's yes (for
> regular files at least), with shmget/shmat it's no by default. For mmap
> of non regulat files (e.g. device files) anything the device file writer
> had in mind is the answer.
>
> man shmget, shmat, shmat and finally mmap will help you a lot.

When I first read the question I was still thinking in terms of shared
memeory and thought you meant: 'will it destroy the shared memory
segment?'.

If the question was not related to shared memeory and you meant 'will it
do the same as close() on the file' the answer is yes as well unless the
device driver specifically chose to fail that for some reason (see the
watchdog devices for an example and a reason).

Gilad.

--
Gilad Ben-Yossef <gilad@benyossef.com>
Code mangler, senior coffee drinker and VP SIGSEGV
Qlusters ltd.

"You got an EMP device in the server room? That is so cool."
-- from a hackers-il thread on paranoia