• Pekka Paalanen's avatar
    os: use posix_fallocate in creating sharable buffers · 5b4ddbc1
    Pekka Paalanen authored
    If posix_fallocate is available, use it instead of ftruncate. Unlike
    ftruncate, when posix_fallocate succeeds, it guarantees that you cannot
    run out of disk space, when later writing to the mmap()'ed file.
    
    With posix_fallocate, if os_create_anonymous_file() succeeds, the
    program cannot get a SIGBUS later from accessing this file via mmap. If
    there is insufficient disk space, the function fails and errno is set to
    ENOSPC.
    
    This is useful on systems, that limit the available buffer space by
    having XDG_RUNTIME_DIR on a small tmpfs.
    Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    5b4ddbc1
Name
Last commit
Last update
..
Makefile.am Loading commit data...
cairo-util.c Loading commit data...
cairo-util.h Loading commit data...
config-parser.c Loading commit data...
config-parser.h Loading commit data...
frame.c Loading commit data...
image-loader.c Loading commit data...
image-loader.h Loading commit data...
matrix.c Loading commit data...
matrix.h Loading commit data...
option-parser.c Loading commit data...
os-compatibility.c Loading commit data...
os-compatibility.h Loading commit data...
zalloc.h Loading commit data...