Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for ByteSliceFromString (0.22 sec)

  1. src/cmd/vendor/golang.org/x/sys/unix/syscall.go

    package unix // import "golang.org/x/sys/unix"
    
    import (
    	"bytes"
    	"strings"
    	"unsafe"
    )
    
    // ByteSliceFromString returns a NUL-terminated slice of bytes
    // containing the text of s. If s contains a NUL byte at any
    // location, it returns (nil, EINVAL).
    func ByteSliceFromString(s string) ([]byte, error) {
    	if strings.IndexByte(s, 0) != -1 {
    		return nil, EINVAL
    	}
    	a := make([]byte, len(s)+1)
    	copy(a, s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  2. src/syscall/syscall.go

    // If s contains a NUL byte this function panics instead of
    // returning an error.
    //
    // Deprecated: Use ByteSliceFromString instead.
    func StringByteSlice(s string) []byte {
    	a, err := ByteSliceFromString(s)
    	if err != nil {
    		panic("syscall: string with NUL passed to StringByteSlice")
    	}
    	return a
    }
    
    // ByteSliceFromString returns a NUL-terminated slice of bytes
    // containing the text of s. If s contains a NUL byte at any
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/sys/plan9/syscall.go

    package plan9 // import "golang.org/x/sys/plan9"
    
    import (
    	"bytes"
    	"strings"
    	"unsafe"
    )
    
    // ByteSliceFromString returns a NUL-terminated slice of bytes
    // containing the text of s. If s contains a NUL byte at any
    // location, it returns (nil, EINVAL).
    func ByteSliceFromString(s string) ([]byte, error) {
    	if strings.IndexByte(s, 0) != -1 {
    		return nil, EINVAL
    	}
    	a := make([]byte, len(s)+1)
    	copy(a, s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/sys/windows/syscall.go

    package windows // import "golang.org/x/sys/windows"
    
    import (
    	"bytes"
    	"strings"
    	"syscall"
    	"unsafe"
    )
    
    // ByteSliceFromString returns a NUL-terminated slice of bytes
    // containing the text of s. If s contains a NUL byte at any
    // location, it returns (nil, syscall.EINVAL).
    func ByteSliceFromString(s string) ([]byte, error) {
    	if strings.IndexByte(s, 0) != -1 {
    		return nil, syscall.EINVAL
    	}
    	a := make([]byte, len(s)+1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  5. src/syscall/syscall_dragonfly.go

    	// will silently write 2 words farther than we specify
    	// and we'll get memory corruption.
    	var buf [CTL_MAXNAME + 2]_C_int
    	n := uintptr(CTL_MAXNAME) * siz
    
    	p := (*byte)(unsafe.Pointer(&buf[0]))
    	bytes, err := ByteSliceFromString(name)
    	if err != nil {
    		return nil, err
    	}
    
    	// Magic sysctl: "setting" 0.3 to a string name
    	// lets you read back the array of integers form.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 18:12:35 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  6. src/syscall/syscall_freebsd.go

    	// will silently write 2 words farther than we specify
    	// and we'll get memory corruption.
    	var buf [CTL_MAXNAME + 2]_C_int
    	n := uintptr(CTL_MAXNAME) * siz
    
    	p := (*byte)(unsafe.Pointer(&buf[0]))
    	bytes, err := ByteSliceFromString(name)
    	if err != nil {
    		return nil, err
    	}
    
    	// Magic sysctl: "setting" 0.3 to a string name
    	// lets you read back the array of integers form.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 18:12:35 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  7. src/syscall/syscall_darwin.go

    	// will silently write 2 words farther than we specify
    	// and we'll get memory corruption.
    	var buf [CTL_MAXNAME + 2]_C_int
    	n := uintptr(CTL_MAXNAME) * siz
    
    	p := (*byte)(unsafe.Pointer(&buf[0]))
    	bytes, err := ByteSliceFromString(name)
    	if err != nil {
    		return nil, err
    	}
    
    	// Magic sysctl: "setting" 0.3 to a string name
    	// lets you read back the array of integers form.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:50 UTC 2024
    - 11K bytes
    - Viewed (0)
  8. src/net/cgo_unix.go

    		return cgoLookupServicePort(&hints, network, service)
    	})
    }
    
    func cgoLookupServicePort(hints *_C_struct_addrinfo, network, service string) (port int, err error) {
    	cservice, err := syscall.ByteSliceFromString(service)
    	if err != nil {
    		return 0, &DNSError{Err: err.Error(), Name: network + "/" + service}
    	}
    	// Lowercase the C service name.
    	for i, b := range cservice[:len(service)] {
    		cservice[i] = lowerASCII(b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go

    	// will silently write 2 words farther than we specify
    	// and we'll get memory corruption.
    	var buf [CTL_MAXNAME + 2]_C_int
    	n := uintptr(CTL_MAXNAME) * siz
    
    	p := (*byte)(unsafe.Pointer(&buf[0]))
    	bytes, err := ByteSliceFromString(name)
    	if err != nil {
    		return nil, err
    	}
    
    	// Magic sysctl: "setting" 0.3 to a string name
    	// lets you read back the array of integers form.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 10 16:32:44 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go

    	// will silently write 2 words farther than we specify
    	// and we'll get memory corruption.
    	var buf [CTL_MAXNAME + 2]_C_int
    	n := uintptr(CTL_MAXNAME) * siz
    
    	p := (*byte)(unsafe.Pointer(&buf[0]))
    	bytes, err := ByteSliceFromString(name)
    	if err != nil {
    		return nil, err
    	}
    
    	// Magic sysctl: "setting" 0.3 to a string name
    	// lets you read back the array of integers form.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 05:26:45 UTC 2024
    - 15.6K bytes
    - Viewed (0)
Back to top