Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of about 10,000 for perror (0.13 sec)

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

    	}
    
    	C.changeSignalStack()
    	defer C.restoreSignalStack()
    	defer func() {
    		if recover() == nil {
    			t.Error("did not see expected panic")
    		}
    	}()
    	v := 1 / int(C.zero())
    	t.Errorf("unexpected success of division by zero == %d", v)
    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/main_unix.c

    		return 2;
    	}
    	oldHandler = osa.sa_sigaction;
    
    	return 0;
    }
    
    int check_handler() {
    	if (sigaction(SIGSEGV, NULL, &sa) < 0) {
    		perror("sigaction check");
    		return 2;
    	}
    	if (sa.sa_sigaction != handler) {
    		fprintf(stderr, "ERROR: wrong signal handler: %p != %p\n", sa.sa_sigaction, handler);
    		return 2;
    	}
    	return 0;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprogcgo/stackswitch.c

    	if (stack1 == NULL) {
    		perror("malloc");
    		exit(1);
    	}
    
    	// Allocate the second stack before freeing the first to ensure we don't get
    	// the same address from malloc.
    	//
    	// Will be freed in stackSwitchThread2.
    	stack2 = malloc(STACK_SIZE);
    	if (stack1 == NULL) {
    		perror("malloc");
    		exit(1);
    	}
    
    	if (getcontext(&uctx_switch) == -1) {
    		perror("getcontext");
    		exit(1);
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 26 15:17:33 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  4. src/runtime/cgo/gcc_solaris_amd64.c

    	pthread_sigmask(SIG_SETMASK, &ign, &oset);
    
    	pthread_attr_init(&attr);
    
    	if (pthread_attr_getstack(&attr, &base, &size) != 0)
    		perror("runtime/cgo: pthread_attr_getstack failed");
    	if (size == 0) {
    		ts->g->stackhi = 2 << 20;
    		if (pthread_attr_setstack(&attr, NULL, ts->g->stackhi) != 0)
    			perror("runtime/cgo: pthread_attr_setstack failed");
    	} else {
    		ts->g->stackhi = size;
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 15 14:57:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  5. src/runtime/testdata/testprogcgo/sigstack.go

    	void* base = mmap(0, CSIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
    	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();
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/testsanitizers/testdata/tsan11.go

    	struct sigaction sa;
    	memset(&sa, 0, sizeof(sa));
    	sigemptyset(&sa.sa_mask);
    	sa.sa_flags = SA_ONSTACK;
    	sa.sa_handler = raise_usr2;
    
    	if (sigaction(SIGUSR1, &sa, NULL) != 0) {
    		perror("failed to register SIGUSR1 handler");
    		exit(EXIT_FAILURE);
    	}
    }
    */
    import "C"
    
    func main() {
    	ch := make(chan os.Signal, 1)
    	signal.Notify(ch, syscall.SIGUSR2)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testcarchive/testdata/libgo2/libgo2.go

    package main
    
    /*
    #include <signal.h>
    #include <unistd.h>
    #include <stdlib.h>
    #include <stdio.h>
    
    // Raise SIGPIPE.
    static void CRaiseSIGPIPE() {
    	int fds[2];
    
    	if (pipe(fds) == -1) {
    		perror("pipe");
    		exit(EXIT_FAILURE);
    	}
    	// Close the reader end
    	close(fds[0]);
    	// Write to the writer end to provoke a SIGPIPE
    	if (write(fds[1], "some data", 9) != -1) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  8. build/pause/linux/orphan.c

          ;
        printf("Child exiting: pid=%d ppid=%d\n", getpid(), getppid());
        return 0;
      } else if (pid > 0) {
        printf("Parent exiting: pid=%d ppid=%d\n", getpid(), getppid());
        return 0;
      }
      perror("Could not create child");
      return 1;
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Sep 26 13:26:24 UTC 2020
    - 1014 bytes
    - Viewed (0)
  9. src/cmd/cgo/internal/testsanitizers/testdata/tsan8.go

    	struct sigaction sa;
    	memset(&sa, 0, sizeof(sa));
    	sigemptyset(&sa.sa_mask);
    	sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
    	sa.sa_sigaction = forwardSignal;
    
    	if (sigaction(SIGSEGV, &sa, &prev_sa) != 0) {
    		perror("failed to register SEGV forwarder");
    		exit(EXIT_FAILURE);
    	}
    }
    */
    import "C"
    
    func main() {
    	C.registerSegvFowarder()
    
    	defer func() {
    		recover()
    	}()
    	var nilp *int
    	*nilp = 42
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testsanitizers/testdata/tsan_shared.go

    static void register_handler() {
    	struct sigaction sa;
    	memset(&sa, 0, sizeof(sa));
    	sigemptyset(&sa.sa_mask);
    	sa.sa_flags = SA_SIGINFO;
    	sa.sa_sigaction = check_params;
    
    	if (sigaction(SIGUSR1, &sa, NULL) != 0) {
    		perror("failed to register SIGUSR1 handler");
    		exit(EXIT_FAILURE);
    	}
    }
    */
    import "C"
    
    import "syscall"
    
    func init() {
    	C.raise(C.int(syscall.SIGUSR1))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.5K bytes
    - Viewed (0)
Back to top