github.com/puellanivis/breton@v0.2.16/lib/files/fileresolve_posix.go (about)

     1  //go:build dragonflybsd || freebsd || linux || netbsd || openbsd || solaris || darwin
     2  // +build dragonflybsd freebsd linux netbsd openbsd solaris darwin
     3  
     4  package files
     5  
     6  import (
     7  	"os"
     8  	"strconv"
     9  )
    10  
    11  func resolveFileHandle(num string) (uintptr, error) {
    12  	fd, err := strconv.ParseUint(num, 0, strconv.IntSize)
    13  	if err != nil {
    14  		return uintptr(^fd), os.ErrInvalid
    15  	}
    16  
    17  	return uintptr(fd), nil
    18  }