diff --git a/runtime-linux.md b/runtime-linux.md index 36277a19d..388df30a7 100644 --- a/runtime-linux.md +++ b/runtime-linux.md @@ -1,8 +1,18 @@ # Linux Runtime ## File descriptors + By default, only the `stdin`, `stdout` and `stderr` file descriptors are kept open for the application by the runtime. +The runtime MAY pass additional file descriptors to the application to support features such as [socket activation](http://0pointer.de/blog/projects/socket-activated-containers.html). +Some of the file descriptors MAY be redirected to `/dev/null` even though they are open. + +## Dev symbolic links -The runtime may pass additional file descriptors to the application to support features such as [socket activation](http://0pointer.de/blog/projects/socket-activated-containers.html). +After the container has `/proc` mounted, the following standard symlinks MUST be setup within `/dev/` for the io. -Some of the file descriptors may be redirected to `/dev/null` even though they are open. +| Source | Destination | +| --------------- | ----------- | +| /proc/self/fd | /dev/fd | +| /proc/self/fd/0 | /dev/stdin | +| /proc/self/fd/1 | /dev/stdout | +| /proc/self/fd/2 | /dev/stderr |