Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for to (0.06 sec)

  1. src/cmd/cgo/internal/testcarchive/testdata/main4.c

    #include <signal.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>
    #include <sched.h>
    #include <pthread.h>
    
    #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;
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. src/crypto/internal/boring/div_test.c

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file is a self-contained test for a copy of
    // the division algorithm in build-goboring.sh,
    // to verify that is correct. The real algorithm uses u128
    // but this copy uses u32 for easier testing.
    // s/32/128/g should be the only difference between the two.
    //
    // This is the dumbest possible division algorithm,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 18 21:28:09 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/testlife/testdata/c-life.c

    // done easily in Go, we are just using C for demonstration
    // purposes.
    void
    Step(int x, int y, int *a, int *n)
    {
    	struct GoStart_return r;
    
    	// Use Go to start 4 goroutines each of which handles 1/4 of the
    	// board.
    	r = GoStart(0, x, y, 0, x / 2, 0, y / 2, a, n);
    	assert(r.r0 == 0 && r.r1 == 100);	// test multiple returns
    	r = GoStart(1, x, y, x / 2, x, 0, y / 2, a, n);
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. src/cmd/cgo/internal/test/issue26213/jni.h

    // Copyright 2018 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // It's going to be hard to include a whole real JVM to test this.
    // So we'll simulate a really easy JVM using just the parts we need.
    
    // This is the relevant part of jni.h.
    
    // On Android NDK16, jobject is defined like this in C and C++
    typedef void* jobject;
    
    typedef jobject jclass;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 874 bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/testcarchive/testdata/main2.c

    	// a job control shell and from a shell script.
    	setsid();
    
    	if (verbose) {
    		printf("calling RunGoroutines\n");
    	}
    
    	RunGoroutines();
    
    	// Block SIGIO in this thread to make it more likely that it
    	// will be delivered to a goroutine.
    
    	if (verbose) {
    		printf("calling pthread_sigmask\n");
    	}
    
    	if (sigemptyset(&mask) < 0) {
    		die("sigemptyset");
    	}
    	if (sigaddset(&mask, SIGIO) < 0) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/testcarchive/testdata/main5.c

    			// this sleep finishes. We use select rather
    			// than sleep because in older versions of
    			// glibc the sleep function does some signal
    			// fiddling to handle SIGCHLD.  If this
    			// program is fiddling signals just when the
    			// test program sends the signal, the signal
    			// may be delivered to a Go thread which will
    			// break this test.
    			tv.tv_sec = 60;
    			tv.tv_usec = 0;
    			select(0, NULL, NULL, NULL, &tv);
    
    			break;
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 2K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/test/callback_c.c

    int
    returnAfterGrowFromGo(void)
    {
    	extern int goReturnVal(void);
    	return goReturnVal();
    }
    
    void
    callGoWithString(void)
    {
    	extern void goWithString(GoString);
    	const char *str = "string passed from C to Go";
    	goWithString((GoString){str, strlen(str)});
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 12:00:02 UTC 2023
    - 933 bytes
    - Viewed (0)
  8. src/cmd/cgo/internal/testcshared/testdata/main0.c

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    #include <stdint.h>
    #include <stdio.h>
    
    #include "p.h"
    #include "libgo.h"
    
    // Tests libgo.so to export the following functions.
    //   int8_t DidInitRun();
    //   int8_t DidMainRun();
    //   int32_t FromPkg();
    //   uint32_t Divu(uint32_t, uint32_t);
    int main(void) {
      int8_t ran_init = DidInitRun();
      if (!ran_init) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. src/cmd/cgo/internal/testcarchive/testdata/main6.c

    #include "libgo6.h"
    
    int main(int argc, char **argv) {
    	struct timeval tvstart, tvnow;
    	int diff;
    
    	gettimeofday(&tvstart, NULL);
    
    	go_start_profile();
    
    	// Busy wait so we have something to profile.
    	// If we just sleep the profiling signal will never fire.
    	while (1) {
    		gettimeofday(&tvnow, NULL);
    		diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec);
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 830 bytes
    - Viewed (0)
  10. src/cmd/cgo/internal/testplugin/testdata/issue25756/plugin/c-life.c

    // done easily in Go, we are just using C for demonstration
    // purposes.
    void
    Step(int x, int y, int *a, int *n)
    {
    	struct GoStart_return r;
    
    	// Use Go to start 4 goroutines each of which handles 1/4 of the
    	// board.
    	r = GoStart(0, x, y, 0, x / 2, 0, y / 2, a, n);
    	assert(r.r0 == 0 && r.r1 == 100);	// test multiple returns
    	r = GoStart(1, x, y, x / 2, x, 0, y / 2, a, n);
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top