Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 90 for pipe1 (0.1 sec)

  1. src/internal/trace/testdata/testprog/wait-on-pipe.go

    import (
    	"log"
    	"os"
    	"runtime/trace"
    	"syscall"
    	"time"
    )
    
    func main() {
    	// Create a pipe to block on.
    	var p [2]int
    	if err := syscall.Pipe(p[:]); err != nil {
    		log.Fatalf("failed to create pipe: %v", err)
    	}
    	rfd, wfd := p[0], p[1]
    
    	// Create a goroutine that blocks on the pipe.
    	done := make(chan struct{})
    	go func() {
    		var data [1]byte
    		_, err := syscall.Read(rfd, data[:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  2. pkg/kubelet/util/util_windows.go

    	}
    	// windows pipes are expected to use forward slashes: https://learn.microsoft.com/windows/win32/ipc/pipe-names
    	// so using `url` like we do on unix gives us unclear benefits - see https://github.com/kubernetes/kubernetes/issues/78628
    	// So we just construct the path from scratch.
    	// Format: \\ServerName\pipe\PipeName
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 14 08:58:18 UTC 2024
    - 3K bytes
    - Viewed (0)
  3. src/os/exec/exec.go

    }
    
    // StdinPipe returns a pipe that will be connected to the command's
    // standard input when the command starts.
    // The pipe will be closed automatically after [Cmd.Wait] sees the command exit.
    // A caller need only call Close to force the pipe to close sooner.
    // For example, if the command being run will not exit until standard input
    // is closed, the caller must close the pipe.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 41.4K bytes
    - Viewed (0)
  4. src/internal/trace/testdata/testprog/stress-start-stop.go

    			outerDone <- true
    		}()
    
    		var wg sync.WaitGroup
    		done := make(chan bool)
    
    		wg.Add(1)
    		go func() {
    			<-done
    			wg.Done()
    		}()
    
    		rp, wp, err := os.Pipe()
    		if err != nil {
    			log.Fatalf("failed to create pipe: %v", err)
    			return
    		}
    		defer func() {
    			rp.Close()
    			wp.Close()
    		}()
    		wg.Add(1)
    		go func() {
    			var tmp [1]byte
    			rp.Read(tmp[:])
    			<-done
    			wg.Done()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  5. src/internal/trace/testdata/testprog/stress.go

    	// Create a goroutine blocked before tracing.
    	wg.Add(1)
    	go func() {
    		<-done
    		wg.Done()
    	}()
    
    	// Create a goroutine blocked in syscall before tracing.
    	rp, wp, err := os.Pipe()
    	if err != nil {
    		log.Fatalf("failed to create pipe: %v", err)
    	}
    	defer func() {
    		rp.Close()
    		wp.Close()
    	}()
    	wg.Add(1)
    	go func() {
    		var tmp [1]byte
    		rp.Read(tmp[:])
    		<-done
    		wg.Done()
    	}()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. src/os/exec/exec_test.go

    		// stderr pipe is closed.
    		if ee := new(*exec.ExitError); !errors.As(err, ee) {
    			t.Errorf("Wait error = %v; want %T", err, *ee)
    		}
    	})
    
    	// If the process exits with status 0 but leaves a child behind writing
    	// to its output pipes, Wait should only wait for WaitDelay before
    	// closing the pipes and returning.  Wait should return ErrWaitDelay
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 20:13:53 UTC 2024
    - 48.4K bytes
    - Viewed (0)
  7. src/io/pipe_test.go

    		}
    		if err = r.Close(); err != nil {
    			t.Errorf("r.Close: %v", err)
    		}
    	}
    }
    
    // Test close on Read side during Read.
    func TestPipeReadClose2(t *testing.T) {
    	c := make(chan int, 1)
    	r, _ := Pipe()
    	go delayClose(t, r, c, pipeTest{})
    	n, err := r.Read(make([]byte, 64))
    	<-c
    	if n != 0 || err != ErrClosedPipe {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9K bytes
    - Viewed (0)
  8. src/os/os_test.go

    	}
    }
    
    // Test that it's OK to have parallel I/O and Close on a pipe.
    func TestPipeIOCloseRace(t *testing.T) {
    	// Skip on wasm, which doesn't have pipes.
    	if runtime.GOOS == "js" || runtime.GOOS == "wasip1" {
    		t.Skipf("skipping on %s: no pipes", runtime.GOOS)
    	}
    	t.Parallel()
    
    	r, w, err := Pipe()
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	var wg sync.WaitGroup
    	wg.Add(3)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 83.1K bytes
    - Viewed (0)
  9. src/os/exec_test.go

    	testenv.MustHaveGoBuild(t)
    	t.Parallel()
    
    	r, w, err := os.Pipe()
    	if err != nil {
    		t.Fatalf("Pipe() got err %v, want nil", err)
    	}
    	defer r.Close()
    	defer w.Close()
    
    	p, err := os.StartProcess(testenv.GoToolPath(t), []string{"go"}, &os.ProcAttr{
    		// N.B. On Windows, StartProcess requires exactly 3 Files. Pass
    		// in a dummy pipe to avoid irrelevant output on the test stdout.
    		Files: []*os.File{r, w, w},
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 11 18:08:44 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/telemetry/start.go

    			log.Fatalf("opening sidecar log file for child: %v", err)
    		}
    		defer childLog.Close()
    		cmd.Stderr = childLog
    	}
    
    	if reportCrashes {
    		pipe, err := cmd.StdinPipe()
    		if err != nil {
    			log.Fatalf("StdinPipe: %v", err)
    		}
    
    		crashmonitor.Parent(pipe.(*os.File)) // (this conversion is safe)
    	}
    
    	if err := cmd.Start(); err != nil {
    		log.Fatalf("can't start telemetry child process: %v", err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 14:52:56 UTC 2024
    - 10.8K bytes
    - Viewed (0)
Back to top