summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/os_std_alloc.go
blob: 60c92182cb8a9de11687ce0a25c8e8eedd78d687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//go:build !(linux || darwin) || sqlite3_flock || sqlite3_nosys

package vfs

import (
	"io"
	"os"
)

func osAllocate(file *os.File, size int64) error {
	off, err := file.Seek(0, io.SeekEnd)
	if err != nil {
		return err
	}
	if size <= off {
		return nil
	}
	return file.Truncate(size)
}