… | |
… | |
129 | #define sync() EIO_ENOSYS () |
129 | #define sync() EIO_ENOSYS () |
130 | #define readlink(path,buf,s) EIO_ENOSYS () |
130 | #define readlink(path,buf,s) EIO_ENOSYS () |
131 | #define statvfs(path,buf) EIO_ENOSYS () |
131 | #define statvfs(path,buf) EIO_ENOSYS () |
132 | #define fstatvfs(fd,buf) EIO_ENOSYS () |
132 | #define fstatvfs(fd,buf) EIO_ENOSYS () |
133 | |
133 | |
|
|
134 | /* rename() uses MoveFile, which fails to overwrite */ |
|
|
135 | #define rename(old,neu) eio__rename (old, neu) |
|
|
136 | |
|
|
137 | static int |
|
|
138 | eio__rename (const char *old, const char *neu) |
|
|
139 | { |
|
|
140 | if (MoveFileEx (old, neu, MOVEFILE_REPLACE_EXISTING)) |
|
|
141 | return 0; |
|
|
142 | |
|
|
143 | /* should steal _dosmaperr */ |
|
|
144 | switch (GetLastError ()) |
|
|
145 | { |
|
|
146 | case ERROR_FILE_NOT_FOUND: |
|
|
147 | case ERROR_PATH_NOT_FOUND: |
|
|
148 | case ERROR_INVALID_DRIVE: |
|
|
149 | case ERROR_NO_MORE_FILES: |
|
|
150 | case ERROR_BAD_NETPATH: |
|
|
151 | case ERROR_BAD_NET_NAME: |
|
|
152 | case ERROR_BAD_PATHNAME: |
|
|
153 | case ERROR_FILENAME_EXCED_RANGE: |
|
|
154 | errno = ENOENT; |
|
|
155 | break; |
|
|
156 | |
|
|
157 | default: |
|
|
158 | errno = EACCES; |
|
|
159 | break; |
|
|
160 | } |
|
|
161 | |
|
|
162 | return -1; |
|
|
163 | } |
|
|
164 | |
134 | /* we could even stat and see if it exists */ |
165 | /* we could even stat and see if it exists */ |
135 | static int |
166 | static int |
136 | symlink (const char *old, const char *neu) |
167 | symlink (const char *old, const char *neu) |
137 | { |
168 | { |
138 | #if WINVER >= 0x0600 |
169 | #if WINVER >= 0x0600 |
… | |
… | |
1674 | |
1705 | |
1675 | if (dirp == INVALID_HANDLE_VALUE) |
1706 | if (dirp == INVALID_HANDLE_VALUE) |
1676 | { |
1707 | { |
1677 | dirp = 0; |
1708 | dirp = 0; |
1678 | |
1709 | |
|
|
1710 | /* should steal _dosmaperr */ |
1679 | switch (GetLastError ()) |
1711 | switch (GetLastError ()) |
1680 | { |
1712 | { |
1681 | case ERROR_FILE_NOT_FOUND: |
1713 | case ERROR_FILE_NOT_FOUND: |
1682 | req->result = 0; |
1714 | req->result = 0; |
1683 | break; |
1715 | break; |