There's a number of bugs in NSData's file reading code: [Its code](https://github.com/apple/swift-corelibs-foundation/blob/43ecec27e47099e49aa2e668bdb6b00cb642850c/Foundation/NSData.swift#L457-L466) relies on two things that both are not true:
1. files don't shrink
2. `st_size` is equal to the number of readable bytes
How does this code rely on those untrue conditions?
This will spin in a loop until it has read `remaining` bytes in total which might never happen: For one the file might have shrunk between that `fstat` and the `read` calls and on top of that some pseudo-files in Linux (especially in `/sys`) return a large `st_size` and you can't actually read any bytes. For example on my machine:
so the file has `st_size = 4096` but
so we can't actually read anything from it... Testing this with `Foundation` shows this problem "nicely"