diff --git a/libcontainer/system/syscall_linux_mipsx.go b/libcontainer/system/syscall_linux_mipsx.go new file mode 100644 index 000000000..98a3f088b --- /dev/null +++ b/libcontainer/system/syscall_linux_mipsx.go @@ -0,0 +1,25 @@ +// +build linux,mips linux,mipsle linux,mips64 linux,mips64le + +package system + +import ( + "syscall" +) + +// Setuid sets the uid of the calling thread to the specified uid. +func Setuid(uid int) (err error) { + _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = e1 + } + return +} + +// Setgid sets the gid of the calling thread to the specified gid. +func Setgid(gid int) (err error) { + _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = e1 + } + return +} diff --git a/signalmap.go b/signalmap.go index 39610f35f..b1c139a40 100644 --- a/signalmap.go +++ b/signalmap.go @@ -1,4 +1,5 @@ // +build linux +// +build !mips,!mipsle,!mips64,!mips64le package main diff --git a/signalmap_mipsx.go b/signalmap_mipsx.go new file mode 100644 index 000000000..046bf1529 --- /dev/null +++ b/signalmap_mipsx.go @@ -0,0 +1,45 @@ +// +build linux,mips linux,mipsle linux,mips64 linux,mips64le + +package main + +import ( + "syscall" + + "golang.org/x/sys/unix" +) + +var signalMap = map[string]syscall.Signal{ + "ABRT": unix.SIGABRT, + "ALRM": unix.SIGALRM, + "BUS": unix.SIGBUS, + "CHLD": unix.SIGCHLD, + "CLD": unix.SIGCLD, + "CONT": unix.SIGCONT, + "FPE": unix.SIGFPE, + "HUP": unix.SIGHUP, + "ILL": unix.SIGILL, + "INT": unix.SIGINT, + "IO": unix.SIGIO, + "IOT": unix.SIGIOT, + "KILL": unix.SIGKILL, + "PIPE": unix.SIGPIPE, + "POLL": unix.SIGPOLL, + "PROF": unix.SIGPROF, + "PWR": unix.SIGPWR, + "QUIT": unix.SIGQUIT, + "SEGV": unix.SIGSEGV, + "STOP": unix.SIGSTOP, + "SYS": unix.SIGSYS, + "TERM": unix.SIGTERM, + "TRAP": unix.SIGTRAP, + "TSTP": unix.SIGTSTP, + "TTIN": unix.SIGTTIN, + "TTOU": unix.SIGTTOU, + "URG": unix.SIGURG, + "USR1": unix.SIGUSR1, + "USR2": unix.SIGUSR2, + "VTALRM": unix.SIGVTALRM, + "WINCH": unix.SIGWINCH, + "XCPU": unix.SIGXCPU, + "XFSZ": unix.SIGXFSZ, +}