• Geoff Simmons's avatar
    Don't bother writing a terminating null to the mapped page. · d0bc503b
    Geoff Simmons authored
    Since we mmap length st_size + 1, and since mmap(2) fills the mapped
    page past the length of the file with nulls, we ensure that there
    is a terminating null after the file contents.
    
    This means that the file can be opened with O_RDONLY and mmap'd
    with PROT_READ. So the child process only needs read permissions
    on the file.
    
    Pointed out by Nils
    d0bc503b
vmod_file.c 9.28 KB