3 ms·
It's hard to do by accident and is pretty unix specific. Also, what if you really want do access this and it panics?
by h4x0rr 3y ago
It's hard to do by accident and is pretty unix specific. Also, what if you really want do access this and it panics?
- kibwen 3y ago> Also, what if you really want do access this and it panics? That's the easy part, you'd provide some OS-specific API for getting this file handle, call it `std::os::fs::proc()` or thereabouts, and make it an `unsafe` function. The "hard to do" is the bigger problem, because if you're providing an unsafe alternative then you'd like to plug all the holes in the safe interface, which AFAIK is non-trivial.