Using statvfs() vs statfs()

OS documentation refer to statfs() as deprecated and recommend statsvfs(), but generally both are available and most software would not care about the difference.

Go exposes statfs(), but I’m running go on a platform which has statvfs() but has deprecated statfs() to the point of renaming the syscall and making it awkward to link against.

Wondering if I should

  1. Write a go statfs() wrapper which pulls from statvfs() and converts
  2. Try real hard to get the linking to work
  3. Raise the question of whether go should expose statvfs() on a forum

Implicit here is option 4) “Run go on another platform”, but I’m already doing that as well :slight_smile:

David

Hmmn, other people have discussed this, and I see an implementation for ssh at https://github.com/pkg/sftp/blob/master/client.go#L452 so you may just need to do some googling to see if there is an existing resolution… else 1
–dave (:-))

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.