Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs: information for the information gods
Signed-off-by: Vincent Batts <vbatts@redhat.com>
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
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,15 @@ | ||
// +build linux | ||
|
||
package btrfs | ||
|
||
/* | ||
#include <btrfs/version.h> | ||
*/ | ||
import "C" | ||
|
||
func BtrfsBuildVersion() string { | ||
return string(C.BTRFS_BUILD_VERSION) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vbatts
via email
Author
Contributor
|
||
} | ||
func BtrfsLibVersion() int { | ||
return int(C.BTRFS_LIB_VERSION) | ||
} |
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,13 @@ | ||
// +build linux | ||
|
||
package btrfs | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestBuildVersion(t *testing.T) { | ||
if len(BtrfsBuildVersion()) == 0 { | ||
t.Errorf("expected output from btrfs build version, but got empty string") | ||
} | ||
} |
ping @vbatts, looks like the latest btrfs/version.h has gotten rid of BTRFS_BUILD_VERSION ... can't find it on rawhide (btrfs-progs-devel-3.19-1.fc23) but can find it on f21 (btrfs-progs-devel-3.18.1-1.fc21)