public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: nncp-devel@lists.cypherpunks.ru
Subject: Re: Build error on NetBSD
Date: Wed, 4 Aug 2021 18:04:10 +0300	[thread overview]
Message-ID: <YQqsghr9FmDlZiUP@stargrave.org> (raw)
In-Reply-To: <87mtpxx5j9.fsf@complete.org>

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-08-04 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  3:17 Build error on NetBSD John Goerzen
2021-08-04 15:04 ` Sergey Matveev [this message]
2021-08-04 16:02   ` John Goerzen
2021-08-04 17:58     ` Sergey Matveev