Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for sigaltstack (0.12 sec)

  1. src/cmd/cgo/internal/test/sigaltstack.go

    #define CSIGSTKSZ 0x4000
    #else
    #define CSIGSTKSZ SIGSTKSZ
    #endif
    
    static stack_t oss;
    static char signalStack[CSIGSTKSZ];
    
    static void changeSignalStack(void) {
    	stack_t ss;
    	memset(&ss, 0, sizeof ss);
    	ss.ss_sp = signalStack;
    	ss.ss_flags = 0;
    	ss.ss_size = CSIGSTKSZ;
    	if (sigaltstack(&ss, &oss) < 0) {
    		perror("sigaltstack");
    		abort();
    	}
    }
    
    static void restoreSignalStack(void) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/testcarchive/testdata/main4.c

    			exit(EXIT_FAILURE);
    		}
    	}
    
    	// We should still be on the same signal stack.
    	if (sigaltstack(NULL, &nss) < 0) {
    		die("sigaltstack check");
    	}
    	if ((nss.ss_flags & SS_DISABLE) != 0) {
    		fprintf(stderr, "sigaltstack disabled on return from Go\n");
    		ok = 0;
    	} else if (nss.ss_sp != ss.ss_sp) {
    		fprintf(stderr, "sigaltstack changed on return from Go\n");
    		ok = 0;
    	}
    
    	return NULL;
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprogcgo/sigstack.go

    	if (base == MAP_FAILED) {
    		perror("mmap failed");
    		abort();
    	}
    	stack_t st = {}, ost = {};
    	st.ss_sp = (char*)base;
    	st.ss_flags = 0;
    	st.ss_size = CSIGSTKSZ;
    	if (sigaltstack(&st, &ost) < 0) {
    		perror("sigaltstack failed");
    		abort();
    	}
    
    	// Call Go.
    	SigStackCallback();
    
    	// Disable signal stack and protect it so we can detect reuse.
    	if (ost.ss_flags & SS_DISABLE) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  4. src/runtime/os_netbsd.go

    	// new signal stack here, to avoid having two Go threads using
    	// the same signal stack. This breaks the case of a thread
    	// created in C that calls sigaltstack and then calls a Go
    	// function, because we will lose track of the C code's
    	// sigaltstack, but it's the best we can do.
    	signalstack(&gp.m.gsignal.stack)
    	gp.m.newSigstack = true
    
    	minitSignalMask()
    }
    
    // Called from dropm to undo the effect of an minit.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  5. src/runtime/cgo/gcc_netbsd.c

    	// in minit, but it's a simple change that keeps NetBSD
    	// working like other OS's. At this point all signals are
    	// blocked, so there is no race.
    	memset(&ss, 0, sizeof ss);
    	ss.ss_flags = SS_DISABLE;
    	sigaltstack(&ss, nil);
    
    	crosscall1(ts.fn, setg_gcc, ts.g);
    	return nil;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 15 03:55:51 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  6. src/runtime/signal_unix.go

    	gp.stackguard0 = st.stackguard0
    	gp.stackguard1 = st.stackguard1
    	gp.stktopsp = st.stktopsp
    }
    
    // signalstack sets the current thread's alternate signal stack to s.
    //
    //go:nosplit
    func signalstack(s *stack) {
    	st := stackt{ss_size: s.hi - s.lo}
    	setSignalstackSP(&st, s.lo)
    	sigaltstack(&st, nil)
    }
    
    // setsigsegv is used on darwin/arm64 to fake a segmentation fault.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 16:04:54 UTC 2024
    - 45K bytes
    - Viewed (0)
  7. src/runtime/sys_openbsd2.go

    	asmcgocall_no_g(unsafe.Pointer(abi.FuncPCABI0(sigprocmask_trampoline)), unsafe.Pointer(&how))
    	KeepAlive(new)
    	KeepAlive(old)
    }
    func sigprocmask_trampoline()
    
    //go:nosplit
    //go:cgo_unsafe_args
    func sigaltstack(new *stackt, old *stackt) {
    	libcCall(unsafe.Pointer(abi.FuncPCABI0(sigaltstack_trampoline)), unsafe.Pointer(&new))
    	KeepAlive(new)
    	KeepAlive(old)
    }
    func sigaltstack_trampoline()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  8. src/runtime/os_openbsd_syscall2.go

    // munmap calls the munmap system call. It is implemented in assembly.
    func munmap(addr unsafe.Pointer, n uintptr)
    
    func nanotime1() int64
    
    //go:noescape
    func sigaltstack(new, old *stackt)
    
    func fcntl(fd, cmd, arg int32) (ret int32, errno int32)
    
    func walltime() (sec int64, nsec int32)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  9. src/runtime/os2_aix.go

    	sigaction1(sig, uintptr(unsafe.Pointer(new)), uintptr(unsafe.Pointer(old)))
    }
    
    //go:nosplit
    func sigaltstack(new, old *stackt) {
    	r, err := syscall2(&libc_sigaltstack, uintptr(unsafe.Pointer(new)), uintptr(unsafe.Pointer(old)))
    	if int32(r) == -1 {
    		println("syscall sigaltstack failed: ", hex(err))
    		throw("syscall sigaltstack")
    	}
    }
    
    //go:nosplit
    //go:linkname internal_cpu_getsystemcfg internal/cpu.getsystemcfg
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 17:22:18 UTC 2023
    - 20.9K bytes
    - Viewed (0)
  10. src/runtime/sys_darwin.go

    	KeepAlive(old)
    }
    func sigprocmask_trampoline()
    
    //go:nosplit
    //go:cgo_unsafe_args
    func sigaltstack(new *stackt, old *stackt) {
    	if new != nil && new.ss_flags&_SS_DISABLE != 0 && new.ss_size == 0 {
    		// Despite the fact that Darwin's sigaltstack man page says it ignores the size
    		// when SS_DISABLE is set, it doesn't. sigaltstack returns ENOMEM
    		// if we don't give it a reasonable size.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:17:26 UTC 2024
    - 23.9K bytes
    - Viewed (0)
Back to top