]> Cypherpunks.ru repositories - nncp.git/blob - src/df_netbsd.go
OpenBSD compatible IsEnoughSpace()
[nncp.git] / src / df_netbsd.go
1 //go:build netbsd
2 // +build netbsd
3
4 package nncp
5
6 import (
7         "log"
8
9         "golang.org/x/sys/unix"
10 )
11
12 func (ctx *Ctx) IsEnoughSpace(want int64) bool {
13         var s unix.Statvfs_t
14         if err := unix.Statvfs(ctx.Spool, &s); err != nil {
15                 log.Fatalln("Can not stat spool:", err)
16         }
17         return int64(s.Bavail)*int64(s.Frsize) > want
18 }