mirror of
https://github.com/containers/podman.git
synced 2025-08-01 07:40:22 +08:00

When running a privileged container, it should inherit the same devices the host has. Signed-off-by: baude <bbaude@redhat.com> Closes: #330 Approved by: mheon
30 lines
708 B
Go
30 lines
708 B
Go
package console
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
const (
|
|
cmdTcGet = unix.TIOCGETA
|
|
cmdTcSet = unix.TIOCSETA
|
|
)
|
|
|
|
// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
|
|
// unlockpt should be called before opening the slave side of a pty.
|
|
// This does not exist on FreeBSD, it does not allocate controlling terminals on open
|
|
func unlockpt(f *os.File) error {
|
|
return nil
|
|
}
|
|
|
|
// ptsname retrieves the name of the first available pts for the given master.
|
|
func ptsname(f *os.File) (string, error) {
|
|
n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return fmt.Sprintf("/dev/pts/%d", n), nil
|
|
}
|