projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
gitignore
[m6w6/ext-psi]
/
psi.d
/
errno.psi
diff --git
a/psi.d/errno.psi
b/psi.d/errno.psi
index 4c987d68b113c5bec1ded99acc72ced02ba1b694..f74d0ed4982295fa62930a7c843f653c6ec5a654 100644
(file)
--- a/
psi.d/errno.psi
+++ b/
psi.d/errno.psi
@@
-1,5
+1,14
@@
-// redirected macro
-extern int errno();
+#include <errno.h>
+
+#ifdef __GNUC__
+# ifdef linux
function psi\errno() : int {
function psi\errno() : int {
- return
to_int(errno
);
+ return
__errno_location() as to_int(*__errno_location
);
}
}
+# endif /* linux */
+# ifdef __FreeBSD__
+function psi\errno() : int {
+ return __error() as to_int(*__error);
+}
+# endif /* __FreeBSD__ */
+#endif /* __GNUC__ */