Re: [PATCH] mmap.2: Explicitly state that the fd can be closed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Elliot

On 08/24/2018 07:28 PM, enh wrote:
> I regularly see excessive fd usage bugs (or even leaks) caused by people
> who think they need to keep the fd open as long as the mapping exists.

Good idea! Patch applied.

Cheers,

Michael

> ---
>  man2/mmap.2 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/man2/mmap.2 b/man2/mmap.2
> index 3d3d1882f..7ca39ff5d 100644
> --- a/man2/mmap.2
> +++ b/man2/mmap.2
> @@ -87,6 +87,8 @@ in the file (or other object) referred to by the
> file descriptor
>  .I offset
>  must be a multiple of the page size as returned by
>  .IR sysconf(_SC_PAGE_SIZE) .
> +The file descriptor can be closed immediately without invalidating the
> +mapping.
>  .PP
>  The
>  .I prot


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux