1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Fixed get_error_msg for *nix

* Fixed undefined: get_error_msg
This commit is contained in:
0x9ef
2019-07-18 21:21:48 +03:00
committed by Alexander Medvednikov
parent 67c2932f34
commit d6ddfa124d
4 changed files with 42 additions and 9 deletions

View File

@ -4,4 +4,13 @@ module os
const (
PathSeparator = '/'
)
)
// get_error_msg return error code representation in string.
pub fn get_error_msg(code int) string {
_ptr_text := C.strerror(code) // voidptr?
if _ptr_text == 0 {
return ''
}
return tos(_ptr_text, C.strlen(_ptr_text))
}