func Getcon() string { var pcon C.security_context_t C.getcon(&pcon) scon := C.GoString(pcon) C.freecon(pcon) return scon }
func Getpidcon(pid int) (string, error) { var pcon C.security_context_t var scon string rc, err := C.getpidcon(C.pid_t(pid), &pcon) if rc >= 0 { scon = C.GoString(pcon) C.freecon(pcon) err = nil } return scon, err }
func Getfscreatecon() (string, error) { var scon C.security_context_t var fcon string rc, err := C.getfscreatecon(&scon) if rc >= 0 { fcon = C.GoString(scon) err = nil C.freecon(scon) } return fcon, err }
func Getpeercon(socket int) (string, error) { var pcon C.security_context_t var scon string rc, err := C.getpeercon(C.int(socket), &pcon) if rc >= 0 { scon = C.GoString(pcon) C.freecon(pcon) err = nil } return scon, err }