cleaned up various modules

This commit is contained in:
Araq 2014-09-19 00:54:01 +02:00
commit d4bc11b654
12 changed files with 65 additions and 64 deletions

View file

@ -1,20 +1,21 @@
import posix, strutils, os
type
Tstatfs {.importc: "struct statfs64",
header: "<sys/statfs.h>", final, pure.} = object
f_type: int
f_bsize: int
f_blocks: int
f_bfree: int
f_bavail: int
f_files: int
f_ffree: int
f_fsid: int
f_namelen: int
when false:
type
Tstatfs {.importc: "struct statfs64",
header: "<sys/statfs.h>", final, pure.} = object
f_type: int
f_bsize: int
f_blocks: int
f_bfree: int
f_bavail: int
f_files: int
f_ffree: int
f_fsid: int
f_namelen: int
proc statfs(path: string, buf: var Tstatfs): int {.
importc, header: "<sys/vfs.h>".}
proc statfs(path: string, buf: var Tstatfs): int {.
importc, header: "<sys/vfs.h>".}
proc getSystemVersion*(): string =
@ -23,7 +24,7 @@ proc getSystemVersion*(): string =
var unix_info: TUtsname
if uname(unix_info) != 0:
os.OSError()
os.raiseOSError(osLastError())
if $unix_info.sysname == "Linux":
# Linux