winpath2unix() - convert a Windows pathname to Interix syntax
#include <interix/interix.h>
int winpath2unix(const char *path, int flags, char *buf, size_t buflen)
The winpath2unix(2) call converts a Windows pathname to an equivalent Interix pathname.
If the Windows pathname is a drive-relative pathname such as "\foo", then the current working directory is translated to Windows syntax using unixpath2win(2). If this translation fails with EWINPATH, then winpath2unix(2) also fails with EWINPATH. Otherwise, the root part of the Windows translation of the current working directory is extracted, which will be a string such as "C:\" or "\\host\share", and this string is prepended to the drive-relative pathname. Then the resultant absolute Windows pathname is translated.
A Windows pathname such as "C:foo" will be interpreted as if it were "C:\foo". That's the best we can do, since Interix processes do not have a notion of a current working directory for each mounted drive.
The Windows pathname is not required to name an existing file. However, if possible, the winpath2unix(2) call will find the longest prefix of the Windows pathname that names an existing file which is accessible to the effective user, and it will convert that prefix to canonical case. This conversion is necessary because Windows pathname lookups are case insensitive, while Interix pathname lookups are case sensitive.
If the PATH_NONSTRICT bit of the flags argument is set, then the following rules apply:
On success, winpath2unix(2) returns 0 and stores a null-terminated pathname in buf. On failure, it returns -1 and sets errno.
The winpath2unix(2) call may fail if:
unixpath2win(2)