Type: syscall.F_RDLCK, Whence: io.SeekStart, }) if err != nil { fmt.Printf("fcntl error %v\n", err) } defer syscall.FcntlFlock(f.file.Fd(), syscall.F_SETLKW, &syscall.Flock_t{ Start: f.offset(index), Len: f.nodeSize(), Type: syscall.F_UNLCK, Whence: io.SeekStart, }) b := make([]byte, f.nodeSize()) syscall.Pread(int(f.file.Fd()), b, f.offset(index))