code: func readdirnames(dirname string) (names []nameIno, err error) {
  	var (
  		size = 100
  		buf  = make([]byte, 4096)
  		nbuf int
  		bufp int
  		nb   int
  	)
  
  	f, err := os.Open(dirname)
  	if err != nil {
  		return nil, err
  	}
  	defer f.Close()
  
  	names = make([]nameIno, 0, size) // Empty with room to grow.
  	for {
  		// Refill the buffer if necessary
  		if bufp >= nbuf {
  			bufp = 0
  			nbuf, err = unix.ReadDirent(int(f.Fd()), buf) // getdents on linux
  			if nbuf < 0 {
  				nbuf = 0
  			}
  			if err != nil {
  				return nil, os.NewSyscallError("readdirent", err)
  			}
  			if nbuf <= 0 {
  				break // EOF
  			}
  		}
  
  		// Drain the buffer
  		nb, names = parseDirent(buf[bufp:nbuf], names)
  		bufp += nb
  	}
  
  	sl := nameInoSlice(names)
  	sort.Sort(sl)
  	return sl, nil
  }
docs: // readdirnames is a hacked-apart version of the Go stdlib code, exposing inode
  // numbers further up the stack when reading directory contents. Unlike
  // os.Readdirnames, which returns a list of filenames, this function returns a
  // list of {filename,inode} pairs.