Example #1
0
func PtraceSyscall(pid int) error {
	ret := int(C.PtraceSyscall(C.int(pid)))
	if ret == -1 {
		return syscall.Errno(C.get_errno()) // BUG(utkan): shouldn't be doing this!
	}
	return nil
}
Example #2
0
func (self *SSL) getError(ret C.int) error {
	err := C.SSL_get_error(self.SSL, ret)
	switch err {
	case C.SSL_ERROR_NONE:
	case C.SSL_ERROR_ZERO_RETURN:
		return nil
	case C.SSL_ERROR_SYSCALL:
		if int(C.ERR_peek_error()) != 0 {
			return syscall.Errno(C.get_errno())
		}

	default:
		msg := sslerr.SSLErrorMessage()
		return errors.New(msg)
	}
	return nil
}
Example #3
0
// Returns errno from C for the current thread
//
// Safe use may require locking this go routine to the underlying OSThread
func GetCErrno() int64 {
	return int64(C.get_errno())
}