Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for closeFunc (0.16 sec)

  1. src/net/file_unix.go

    		poll.CloseFunc(s)
    		return -1, os.NewSyscallError("setnonblock", err)
    	}
    	return s, nil
    }
    
    func newFileFD(f *os.File) (*netFD, error) {
    	s, err := dupSocket(f)
    	if err != nil {
    		return nil, err
    	}
    	family := syscall.AF_UNSPEC
    	sotype, err := syscall.GetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_TYPE)
    	if err != nil {
    		poll.CloseFunc(s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 20 06:04:31 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. src/net/main_windows_test.go

    	// Placeholders for saving original socket system calls.
    	origWSASocket   = wsaSocketFunc
    	origClosesocket = poll.CloseFunc
    	origConnect     = connectFunc
    	origConnectEx   = poll.ConnectExFunc
    	origListen      = listenFunc
    	origAccept      = poll.AcceptFunc
    )
    
    func installTestHooks() {
    	wsaSocketFunc = sw.WSASocket
    	poll.CloseFunc = sw.Closesocket
    	connectFunc = sw.Connect
    	poll.ConnectExFunc = sw.ConnectEx
    	listenFunc = sw.Listen
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:36:30 UTC 2023
    - 1K bytes
    - Viewed (0)
  3. src/net/main_unix_test.go

    	origSocket        = socketFunc
    	origClose         = poll.CloseFunc
    	origConnect       = connectFunc
    	origListen        = listenFunc
    	origAccept        = poll.AcceptFunc
    	origGetsockoptInt = getsockoptIntFunc
    
    	extraTestHookInstallers   []func()
    	extraTestHookUninstallers []func()
    )
    
    func installTestHooks() {
    	socketFunc = sw.Socket
    	poll.CloseFunc = sw.Close
    	connectFunc = sw.Connect
    	listenFunc = sw.Listen
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  4. src/internal/poll/hook_unix.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build unix || (js && wasm) || wasip1
    
    package poll
    
    import "syscall"
    
    // CloseFunc is used to hook the close call.
    var CloseFunc func(int) error = syscall.Close
    
    // AcceptFunc is used to hook the accept call.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 07 23:34:17 UTC 2023
    - 447 bytes
    - Viewed (0)
  5. src/net/internal/socktest/main_unix_test.go

    package socktest_test
    
    import "syscall"
    
    var (
    	socketFunc func(int, int, int) (int, error)
    	closeFunc  func(int) error
    )
    
    func installTestHooks() {
    	socketFunc = sw.Socket
    	closeFunc = sw.Close
    }
    
    func uninstallTestHooks() {
    	socketFunc = syscall.Socket
    	closeFunc = syscall.Close
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:54:10 UTC 2023
    - 493 bytes
    - Viewed (0)
  6. src/internal/poll/splice_linux_test.go

    	"sync/atomic"
    	"testing"
    	"time"
    )
    
    var closeHook atomic.Value // func(fd int)
    
    func init() {
    	closeFunc := poll.CloseFunc
    	poll.CloseFunc = func(fd int) (err error) {
    		if v := closeHook.Load(); v != nil {
    			if hook := v.(func(int)); hook != nil {
    				hook(fd)
    			}
    		}
    		return closeFunc(fd)
    	}
    }
    
    func TestSplicePipePool(t *testing.T) {
    	const N = 64
    	var (
    		p          *poll.SplicePipe
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:49:26 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  7. src/internal/poll/hook_windows.go

    // Copyright 2017 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.
    
    package poll
    
    import "syscall"
    
    // CloseFunc is used to hook the close call.
    var CloseFunc func(syscall.Handle) error = syscall.Closesocket
    
    // AcceptFunc is used to hook the accept call.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 07 21:54:36 UTC 2017
    - 668 bytes
    - Viewed (0)
  8. src/net/internal/socktest/main_test.go

    	"os"
    	"sync"
    	"syscall"
    	"testing"
    )
    
    var sw socktest.Switch
    
    func TestMain(m *testing.M) {
    	installTestHooks()
    
    	st := m.Run()
    
    	for s := range sw.Sockets() {
    		closeFunc(s)
    	}
    	uninstallTestHooks()
    	os.Exit(st)
    }
    
    func TestSwitch(t *testing.T) {
    	const N = 10
    	var wg sync.WaitGroup
    	wg.Add(N)
    	for i := 0; i < N; i++ {
    		go func() {
    			defer wg.Done()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:36:30 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. src/internal/poll/fd_unixjs.go

    	// If the descriptor is indeed closed, using a loop would race
    	// with some other goroutine opening a new descriptor.
    	// (The Linux kernel guarantees that it is closed on an EINTR error.)
    	return CloseFunc(fd)
    }
    
    // dupCloseOnExecOld is the traditional way to dup an fd and
    // set its O_CLOEXEC bit, using two system calls.
    func dupCloseOnExecOld(fd int) (int, string, error) {
    	syscall.ForkLock.RLock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 25 00:12:41 UTC 2023
    - 2K bytes
    - Viewed (0)
  10. src/net/sys_cloexec.go

    	if err == nil {
    		syscall.CloseOnExec(s)
    	}
    	syscall.ForkLock.RUnlock()
    	if err != nil {
    		return -1, os.NewSyscallError("socket", err)
    	}
    	if err = syscall.SetNonblock(s, true); err != nil {
    		poll.CloseFunc(s)
    		return -1, os.NewSyscallError("setnonblock", err)
    	}
    	return s, nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 03 14:38:32 UTC 2022
    - 962 bytes
    - Viewed (0)
Back to top