projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix leaks
[m6w6/ext-psi]
/
psi.d
/
uname.psi
diff --git
a/psi.d/uname.psi
b/psi.d/uname.psi
index 25abfcbbf48709f85b809e5de4fe945f9f39487f..404399cfdf458ccb014d6ea4072d47ac9119dd29 100644
(file)
--- a/
psi.d/uname.psi
+++ b/
psi.d/uname.psi
@@
-1,12
+1,13
@@
-extern int uname(struct utsname *u);
+#include <sys/utsname.h>
+
function psi\uname(array &$u = NULL) : int {
function psi\uname(array &$u = NULL) : int {
- let
u = calloc(1, struct utsname
);
- return to_int(uname);
- set $u = to_array(*
u
,
+ let
name = calloc(1, sizeof(struct utsname)
);
+ return
uname(name) as
to_int(uname);
+ set $u = to_array(*
name
,
to_string(sysname),
to_string(nodename),
to_string(release),
to_string(version),
to_string(machine),
to_string(domainname));
to_string(sysname),
to_string(nodename),
to_string(release),
to_string(version),
to_string(machine),
to_string(domainname));
-}
\ No newline at end of file
+}