News for hackers. Stuff that matters.
Re:Linux Container Internals by archrabbit on Monday June 05, 2017 @02:12PM (#14489854)
it's Rust. Btw, did you see erlang or clojure? ;p
Re:Linux Container Internals by striking on Monday June 05, 2017 @02:21PM (#14489933)
What's the point of writing your program in Rust if it's almost entirely wrapped in `unsafe{}`?

You'd be better off just writing a C program. It could even be clearer to a wider audience what exactly you're doing.

Re:Linux Container Internals by archrabbit on Monday June 05, 2017 @03:32PM (#14490676)
I probably could wrap in the `unsafe` block just the invocations to the system calls. I'm learning Rust and I wanted to give the post some freshness. There are already a plethora of examples in C.
Re:Linux Container Internals by tiles on Monday June 05, 2017 @10:10PM (#14494154)
That's a bizarre argument; the post is about writing an abstraction over another interface, and it's clearly meant to be extended. The abstraction can be written in a safer language than C. Seems like there's an obvious upside.
Re:Linux Container Internals by deathanatos on Tuesday June 06, 2017 @01:32AM (#14494982)
The large unsafe call inside pivot_root is much larger than it needs to be. It only needs to encompass the mount() call in that function. It's a pretty trivial change to have it only wrap the if. (Though it could wrap less, but that would either look uglier or need a variable binding the result, which honestly wouldn't be that bad either.)
Re:Linux Container Internals by gtirloni on Monday June 05, 2017 @10:49PM (#14494329)
With Rust you can at least have some certainty of where problems could happen. It gets boxed inside unsafe and affords extra scrutiny. You don't have to worry much about everything else surrounding you code.

Disclaimer: only went through basic tutorials and I don't program in Rust daily.