-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unix: add Illumos statvfs(2) syscall
Reference: https://www.illumos.org/man/2/statvfs Change-Id: If7af43da35b3204f5069a48eb08426a145544008 Reviewed-on: https://go-review.googlesource.com/43490 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
- Loading branch information
Showing
5 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2017 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build solaris | ||
|
||
package unix_test | ||
|
||
import ( | ||
"os/exec" | ||
"testing" | ||
|
||
"golang.org/x/sys/unix" | ||
) | ||
|
||
func TestStatvfs(t *testing.T) { | ||
if err := unix.Statvfs("", nil); err == nil { | ||
t.Fatal(`Statvfs("") expected failure`) | ||
} | ||
|
||
statvfs := unix.Statvfs_t{} | ||
if err := unix.Statvfs("/", &statvfs); err != nil { | ||
t.Errorf(`Statvfs("/") failed: %v`, err) | ||
} | ||
|
||
if t.Failed() { | ||
mount, err := exec.Command("mount").CombinedOutput() | ||
if err != nil { | ||
t.Logf("mount: %v\n%s", err, mount) | ||
} else { | ||
t.Logf("mount: %s", mount) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.