Skip to content

Commit

Permalink
fix: add missing Truncate() function stub to os/file for bare-metal s…
Browse files Browse the repository at this point in the history
…ystems

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Aug 26, 2024
1 parent 1ef1aa7 commit d144b11
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/os/file_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,17 @@ func Readlink(name string) (string, error) {
func tempDir() string {
return "/tmp"
}

// Truncate is unsupported on this system.
func Truncate(filename string, size int64) (err error) {
return ErrUnsupported
}

// Truncate is unsupported on this system.
func (f *File) Truncate(size int64) (err error) {
if f.handle == nil {
return ErrClosed
}

return Truncate(f.name, size)
}

0 comments on commit d144b11

Please sign in to comment.