Skip to content
Snippets Groups Projects
  • Colin Walters's avatar
    806bb46e
    fdio: Use O_EXCL for anonymous tmpfiles · 806bb46e
    Colin Walters authored
    I noticed while reading the manpage for `linkat()` that `O_TMPFILE`
    supports `O_EXCL` to mean exactly what we're doing with the anonymous
    tmpfile API.
    
    Change the code to start using it; this required refactoring the internals since
    we had a check to be sure the caller wasn't passing `O_EXCL` for the
    non-anonymous path which we want to keep.
    
    Presumably the storage system could do smarter things if it knows a file will
    always be anonymous, e.g. it doesn't need to journal its data.
    806bb46e
    History
    fdio: Use O_EXCL for anonymous tmpfiles
    Colin Walters authored
    I noticed while reading the manpage for `linkat()` that `O_TMPFILE`
    supports `O_EXCL` to mean exactly what we're doing with the anonymous
    tmpfile API.
    
    Change the code to start using it; this required refactoring the internals since
    we had a check to be sure the caller wasn't passing `O_EXCL` for the
    non-anonymous path which we want to keep.
    
    Presumably the storage system could do smarter things if it knows a file will
    always be anonymous, e.g. it doesn't need to journal its data.