diff --git a/headers/build/os/support/Errors.h b/headers/build/os/support/Errors.h index 5184484403..75d630c29b 100644 --- a/headers/build/os/support/Errors.h +++ b/headers/build/os/support/Errors.h @@ -408,6 +408,7 @@ extern "C" { #endif extern int *_haiku_build_errno(); +extern int _haiku_to_host_error(int error); #ifdef __cplusplus } diff --git a/headers/private/fs_shell/fssh_errno.h b/headers/private/fs_shell/fssh_errno.h index 2bfa252304..890da56e2b 100644 --- a/headers/private/fs_shell/fssh_errno.h +++ b/headers/private/fs_shell/fssh_errno.h @@ -17,6 +17,7 @@ extern int *_fssh_errnop(void); extern int fssh_get_errno(void); extern void fssh_set_errno(int error); +extern int fssh_to_host_error(int error); #ifdef __cplusplus } /* "C" */ diff --git a/src/build/libroot/errors.cpp b/src/build/libroot/errors.cpp index 1b6c548937..30871dbbaf 100644 --- a/src/build/libroot/errors.cpp +++ b/src/build/libroot/errors.cpp @@ -180,3 +180,9 @@ _haiku_build_errno() return &localErrno; } +// _haiku_to_host_error +int +_haiku_to_host_error(int error) +{ + return to_host_error(error); +} diff --git a/src/tools/fs_shell/errno.cpp b/src/tools/fs_shell/errno.cpp index 835da29799..36802bfc87 100644 --- a/src/tools/fs_shell/errno.cpp +++ b/src/tools/fs_shell/errno.cpp @@ -29,3 +29,13 @@ fssh_set_errno(int error) { errno = error; } + +int +fssh_to_host_error(int error) +{ + #if __BEOS__ + return error; + #else + return _haiku_to_host_error(error); + #endif +}