1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/os/os_nix.v
0x9ef d6ddfa124d Fixed get_error_msg for *nix
* Fixed undefined: get_error_msg
2019-07-18 20:21:48 +02:00

16 lines
291 B
Go

module os
#include <dirent.h>
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))
}