9fans.net/go@v0.0.5/plan9/client/dial_plan9.go (about)

     1  package client
     2  
     3  import (
     4  	"path/filepath"
     5  	"syscall"
     6  )
     7  
     8  func openSrv(service string) (fd int, err error) {
     9  	p := filepath.Join(Namespace(), service)
    10  	return syscall.Open(p, syscall.O_RDWR)
    11  }
    12  
    13  func DialService(service string) (*Conn, error) {
    14  	fd, err := openSrv(service)
    15  	if err != nil {
    16  		return nil, err
    17  	}
    18  	return &Conn{fd: fd, name: service}, nil
    19  }
    20  
    21  func Mount(network, addr string) (*Fsys, error) {
    22  	panic("unimplemented")
    23  }
    24  
    25  func MountService(service string) (*Fsys, error) {
    26  	panic("unimplemented")
    27  }
    28  
    29  // Namespace returns the path to the name space directory.
    30  func Namespace() string {
    31  	return "/srv"
    32  }