M: netbsd file-systems ( -- array )
f 0 0 getvfsstat dup io-error
-- \ statvfs <c-type-array> dup dup length 0 getvfsstat io-error
++ \ statvfs <c-array> dup dup length 0 getvfsstat io-error
\ statvfs heap-size group
[ f_mntonname>> utf8 alien>string file-system-info ] map ;
M: openbsd file-systems ( -- seq )
f 0 0 getfsstat dup io-error
-- \ statfs <c-type-array> dup dup length 0 getfsstat io-error
++ \ statfs <c-array> dup dup length 0 getfsstat io-error
\ statfs heap-size group
[ f_mntonname>> alien>native-string file-system-info ] map ;
: make-lang-id ( lang1 lang2 -- n )
10 shift bitor ; inline
-<< "TCHAR" require-c-type-arrays >>
++<< "TCHAR" require-c-arrays >>
+
ERROR: error-message-failed id ;
:: n>win32-error-string ( id -- string )
{
f
id
LANG_NEUTRAL SUBLANG_DEFAULT make-lang-id
- 32768 [ "TCHAR" <c-array> ] keep
- 32768 [ "TCHAR" <c-type-array> ] [ ] bi
++ 32768 [ "TCHAR" <c-array> ] [ ] bi
f pick [ FormatMessage 0 = [ id error-message-failed ] when ] dip
utf16n alien>string [ blank? ] trim ;