Skip to content
  • Josh Megnauth's avatar
    c899feb7
    Implement fstatat · c899feb7
    Josh Megnauth authored and Josh Megnauth's avatar Josh Megnauth committed
    Linux's variant uses the syscall as intended. Redox's variant uses fpath
    to build a path to pass to fstat from the file descriptor plus the file
    name. Unlike the syscall, this isn't atomic so the liminal space between
    fpath/getcwd and fstat is subject to TOCTOU.
    
    Beyond fstatat, I moved the stat test to its correct location and added
    an assert since the output of the test is unchecked.
    
    I also added AT_FDCWD which seems to be -100 across Unixes. The other
    AT_* constants are unimplemented for now.
    c899feb7
    Implement fstatat
    Josh Megnauth authored and Josh Megnauth's avatar Josh Megnauth committed
    Linux's variant uses the syscall as intended. Redox's variant uses fpath
    to build a path to pass to fstat from the file descriptor plus the file
    name. Unlike the syscall, this isn't atomic so the liminal space between
    fpath/getcwd and fstat is subject to TOCTOU.
    
    Beyond fstatat, I moved the stat test to its correct location and added
    an assert since the output of the test is unchecked.
    
    I also added AT_FDCWD which seems to be -100 across Unixes. The other
    AT_* constants are unimplemented for now.
Loading