code: func getBuffer(fd int) ([]byte, error) {
  	var s syscall.Stat_t
  	if err := syscall.Fstat(fd, &s); err != nil {
  		return nil, err
  	}
  
  	// Check that size doesn't overflow an int.
  	if s.Size > int64(^uint(0)>>1) {
  		return nil, syscall.EDOM
  	}
  
  	return syscall.Mmap(fd, 0, int(s.Size), syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_SHARED|syscall.MAP_FILE)
  }
docs: // getBuffer returns a memory region mapped to the full contents of the given
  // file descriptor.