Debian Codegraph @

osfs/mmap_file_other.go

raw symbols SCIP
1 //go:build !darwin && !linux && !js
2
3 package osfs
4
5 import "os"
6
7 // mmapFile is a stub on platforms without mmap support. The
8 // real implementation lives in mmap_file.go (darwin || linux);
9 // here the type exists solely so the wrapOpenedFile return
10 // path that constructs it still type-checks. newMmapFile
11 // always returns [errMmapUnavailable], so a value of this type
12 // is never actually constructed at runtime — the method bodies
13 // below are unreachable.
14 type mmapFile struct{}
15
16 func newMmapFile(_ *os.File, _ string) (*mmapFile, error) {
17 return nil, errMmapUnavailable
18 }
19
20 func (m *mmapFile) Name() string { return "" }
21 func (m *mmapFile) Stat() (os.FileInfo, error) { return nil, os.ErrInvalid }
22 func (m *mmapFile) Read(p []byte) (int, error) { return 0, os.ErrInvalid }
23 func (m *mmapFile) ReadAt(p []byte, off int64) (int, error) { return 0, os.ErrInvalid }
24 func (m *mmapFile) Write(p []byte) (int, error) { return 0, os.ErrInvalid }
25 func (m *mmapFile) WriteAt(p []byte, off int64) (int, error) { return 0, os.ErrInvalid }
26 func (m *mmapFile) Seek(offset int64, whence int) (int64, error) { return 0, os.ErrInvalid }
27 func (m *mmapFile) Truncate(size int64) error { return os.ErrInvalid }
28 func (m *mmapFile) Close() error { return os.ErrInvalid }