Permalink
Browse files

Add support for mips/mips64

Signed-off-by: Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
  • Loading branch information...
Vladimir Stefanovic
Vladimir Stefanovic committed Feb 17, 2017
1 parent 9916b79 commit d01050e6d4910d1497038e84273eafdb70c137cb
Showing with 71 additions and 0 deletions.
  1. +25 −0 libcontainer/system/syscall_linux_mipsx.go
  2. +1 −0 signalmap.go
  3. +45 −0 signalmap_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
}
View
@@ -1,4 +1,5 @@
// +build linux
// +build !mips,!mipsle,!mips64,!mips64le
package main
View
@@ -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,
}

0 comments on commit d01050e

Please sign in to comment.