errormap: Add unix_to_werror() function
[samba.git] / source3 / lib / errmap_unix.c
index 91a620eccec2ccb2de1b642e21ea68bf1f33d854..b4a98f963423a21a53581626ce7bc2754b507643 100644 (file)
@@ -141,6 +141,12 @@ NTSTATUS map_nt_error_from_unix(int unix_error)
        return NT_STATUS_ACCESS_DENIED;
 }
 
+/* Convert a Unix error code to a WERROR. */
+WERROR unix_to_werror(int unix_error)
+{
+       return ntstatus_to_werror(map_nt_error_from_unix(unix_error));
+}
+
 /* Return a UNIX errno from a NT status code */
 static const struct {
        NTSTATUS status;