dev_t st_rdev;
};
-static void tar_dosmaperr(unsigned long);
+static void __tar_dosmaperr(unsigned long);
/* Transform 64-bits ino into 32-bits by hashing.
* You do not forget that really unique number size is 64-bits.
}
static HANDLE
-la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
+__tar_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
attr = GetFileAttributesW(wnewsrc);
if (attr == -1 || (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
if (attr == -1)
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
else
errno = EPERM;
free (wnewsrc);
free (wnewsrc);
}
if (res == 0) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
retval = -1;
} else
retval = 0;
}
int
-la_chdir(const char *path)
+__tar_chdir(const char *path)
{
wchar_t *ws;
int r;
r = SetCurrentDirectoryA(path);
if (r == 0) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
} else
r = SetCurrentDirectoryW(ws);
free(ws);
if (r == 0) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
return (0);
* This implements for only to pass libarchive_test.
*/
size_t
-la_mbstowcs(wchar_t *wcstr, const char *mbstr, size_t nwchars)
+__tar_mbstowcs(wchar_t *wcstr, const char *mbstr, size_t nwchars)
{
return (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
}
int
-la_open(const char *path, int flags, ...)
+__tar_open(const char *path, int flags, ...)
{
va_list ap;
wchar_t *ws;
attr = GetFileAttributesW(ws);
}
if (attr == -1) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
free(ws);
return (-1);
}
NULL);
free(ws);
if (handle == INVALID_HANDLE_VALUE) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
r = _open_osfhandle((intptr_t)handle, _O_RDONLY);
/* simular other POSIX system action to pass a test */
attr = GetFileAttributesA(path);
if (attr == -1)
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
else if (attr & FILE_ATTRIBUTE_DIRECTORY)
errno = EISDIR;
else
/* simular other POSIX system action to pass a test */
attr = GetFileAttributesW(ws);
if (attr == -1)
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
else if (attr & FILE_ATTRIBUTE_DIRECTORY)
errno = EISDIR;
else
break;
default:
/* This ftype is undocumented type. */
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
ZeroMemory(&info, sizeof(info));
if (!GetFileInformationByHandle (handle, &info)) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
}
int
-la_fstat(int fd, struct stat *st)
+__tar_fstat(int fd, struct stat *st)
{
struct ustat u;
int ret;
}
int
-la_stat(const char *path, struct stat *st)
+__tar_stat(const char *path, struct stat *st)
{
HANDLE handle;
struct ustat u;
int ret;
- handle = la_CreateFile(path, 0, 0, NULL, OPEN_EXISTING,
+ handle = __tar_CreateFile(path, 0, 0, NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY,
NULL);
if (handle == INVALID_HANDLE_VALUE) {
- tar_dosmaperr(GetLastError());
+ __tar_dosmaperr(GetLastError());
return (-1);
}
ret = __hstat(handle, &u);
};
static void
-tar_dosmaperr(unsigned long e)
+__tar_dosmaperr(unsigned long e)
{
int i;