Subject: Re: Build error on NetBSD

From: Sergey Matveev <[email-masked]>
Date: Wed, 4 Aug 2021 18:04:10 +0300

Greetings!

*** John Goerzen [2021-08-03 22:17]:
>I guess that, at least in Go, Statfs is unimplemented or incompletely
>implemented on NetBSD.

That is right. They some kind of "sync" those C-structures to Go code,
but without any guarantees. Can you check if following code will work on
NetBSD? Currently I do not have NetBSD and it is failing installation
under bhyve :-(

    package main
    import "syscall"
    func main() {
        var s syscall.Statfs_t
        if err := syscall.Statfs("/", &s); err != nil { panic(err) }
        println(int64(s.Bavail) * int64(s.Bsize))
    }

Some kind of:

    $ tmp=`mktemp -d`
    $ cd $tmp
    [save Go code above in main.go]
    $ go run main.go

If that works, I will replace free space determining with that code.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF