Skip to content
Snippets Groups Projects
  • Simon McVittie's avatar
    4ad7b057
    bwrap-lock: Add support for OFD locks · 4ad7b057
    Simon McVittie authored
    
    These more modern locks, introduced in Linux 3.15 and not yet included
    in POSIX, propagate across fork(), dup(), fd-passing etc. the way you'd
    expect: as long as at least one copy of the inherited or fd-passed file
    descriptor remains open, the lock remains held. This allows us to
    pass a lock fd to a child process across bwrap's fork-and-exec the way
    we were already trying to, and have it actually work.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
    4ad7b057
    History
    bwrap-lock: Add support for OFD locks
    Simon McVittie authored
    
    These more modern locks, introduced in Linux 3.15 and not yet included
    in POSIX, propagate across fork(), dup(), fd-passing etc. the way you'd
    expect: as long as at least one copy of the inherited or fd-passed file
    descriptor remains open, the lock remains held. This allows us to
    pass a lock fd to a child process across bwrap's fork-and-exec the way
    we were already trying to, and have it actually work.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
bwrap-lock.c 6.39 KiB