Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 5,002 for perror (0.21 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/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)
  6. 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)
  7. 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)
  8. 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)
  9. src/cmd/cgo/internal/testcarchive/testdata/main4.c

    #include "libgo4.h"
    
    #ifdef _AIX
    // On AIX, CSIGSTKSZ is too small to handle Go sighandler.
    #define CSIGSTKSZ 0x4000
    #else
    #define CSIGSTKSZ SIGSTKSZ
    #endif
    
    static void die(const char* msg) {
    	perror(msg);
    	exit(EXIT_FAILURE);
    }
    
    static int ok = 1;
    
    static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
    }
    
    // Set up the SIGIO signal handler in a high priority constructor, so
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testcarchive/testdata/main2.c

    #include <stdlib.h>
    #include <string.h>
    #include <sys/types.h>
    #include <unistd.h>
    #include <sched.h>
    #include <time.h>
    #include <errno.h>
    
    #include "libgo2.h"
    
    static void die(const char* msg) {
    	perror(msg);
    	exit(EXIT_FAILURE);
    }
    
    static volatile sig_atomic_t sigioSeen;
    static volatile sig_atomic_t sigpipeSeen;
    
    // Use up some stack space.
    static void recur(int i, char *p) {
    	char a[1024];
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.7K bytes
    - Viewed (0)
Back to top