Skip to content

Commit 613c5de

Browse files
author
Dongsu Park
committed
runtimetest: check if /dev/ptmx is a symlink to /dev/pts/ptmx
Inside a container, we need to check if /dev/ptmx exists, a symlink to /dev/pts/ptmx, as mentioned in the runtime-spec, https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#default-devices. Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
1 parent fdcd30f commit 613c5de

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/runtimetest/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ var (
5050
"/dev/shm": "tmpfs",
5151
}
5252

53+
// NOTE: check if /dev/ptmx is a symlink to /dev/pts/ptmx.
54+
// os.Readlink() returns only a relative path "pts/ptmx" instead of
55+
// an absolute path /dev/pts/ptmx.
5356
defaultSymlinks = map[string]string{
5457
"/dev/fd": "/proc/self/fd",
58+
"/dev/ptmx": "pts/ptmx",
5559
"/dev/stdin": "/proc/self/fd/0",
5660
"/dev/stdout": "/proc/self/fd/1",
5761
"/dev/stderr": "/proc/self/fd/2",

0 commit comments

Comments
 (0)