1 /* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
5 /* Not sure if all of these occur in the HGFS v1 protocol, but at least some
6 * that weren't in the original protocol, are being returned now.
9 static int error_map
[NERRS
] = {
11 ENOENT
, /* no such file/directory */
12 EBADF
, /* invalid handle */
13 EPERM
, /* operation not permitted */
14 EEXIST
, /* file already exists */
15 ENOTDIR
, /* not a directory */
16 ENOTEMPTY
, /* directory not empty */
17 EIO
, /* protocol error */
18 EACCES
, /* access denied */
19 EINVAL
, /* invalid name */
20 EIO
, /* generic error */
21 EIO
, /* sharing violation */
22 ENOSPC
, /* no space */
23 ENOSYS
, /* operation not supported */
24 ENAMETOOLONG
, /* name too long */
25 EINVAL
, /* invalid parameter */
28 /*===========================================================================*
30 *===========================================================================*/
31 int error_convert(int err
)
33 /* Convert a HGFS error into an errno error code.
36 if (err
< 0 || err
>= NERRS
) return EIO
;
38 return error_map
[err
];