… | |
… | |
42 | #endif |
42 | #endif |
43 | |
43 | |
44 | #include "eio.h" |
44 | #include "eio.h" |
45 | #include "ecb.h" |
45 | #include "ecb.h" |
46 | |
46 | |
47 | #ifdef EIO_STACKSIZE |
|
|
48 | # define X_STACKSIZE EIO_STACKSIZE |
|
|
49 | #endif |
|
|
50 | #include "xthread.h" |
|
|
51 | |
|
|
52 | #include <errno.h> |
47 | #include <errno.h> |
53 | #include <stddef.h> |
48 | #include <stddef.h> |
54 | #include <stdlib.h> |
49 | #include <stdlib.h> |
55 | #include <string.h> |
50 | #include <string.h> |
56 | #include <errno.h> |
51 | #include <errno.h> |
… | |
… | |
206 | /* we could even stat and see if it exists */ |
201 | /* we could even stat and see if it exists */ |
207 | static int |
202 | static int |
208 | symlink (const char *old, const char *neu) |
203 | symlink (const char *old, const char *neu) |
209 | { |
204 | { |
210 | #if WINVER >= 0x0600 |
205 | #if WINVER >= 0x0600 |
|
|
206 | int flags; |
|
|
207 | |
|
|
208 | /* This tries out all combinations of SYMBOLIC_LINK_FLAG_DIRECTORY |
|
|
209 | * and SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE, |
|
|
210 | * with directory first. |
|
|
211 | */ |
|
|
212 | for (flags = 3; flags >= 0; --flags) |
211 | if (CreateSymbolicLink (neu, old, 1)) |
213 | if (CreateSymbolicLink (neu, old, flags)) |
212 | return 0; |
214 | return 0; |
213 | |
|
|
214 | if (CreateSymbolicLink (neu, old, 0)) |
|
|
215 | return 0; |
|
|
216 | #endif |
215 | #endif |
217 | |
216 | |
218 | return EIO_ERRNO (ENOENT, -1); |
217 | return EIO_ERRNO (ENOENT, -1); |
219 | } |
218 | } |
220 | |
219 | |
… | |
… | |
283 | # include <utime.h> |
282 | # include <utime.h> |
284 | #endif |
283 | #endif |
285 | |
284 | |
286 | #if HAVE_SYS_SYSCALL_H |
285 | #if HAVE_SYS_SYSCALL_H |
287 | # include <sys/syscall.h> |
286 | # include <sys/syscall.h> |
288 | #endif |
|
|
289 | |
|
|
290 | #if HAVE_SYS_PRCTL_H |
|
|
291 | # include <sys/prctl.h> |
|
|
292 | #endif |
287 | #endif |
293 | |
288 | |
294 | #if HAVE_SENDFILE |
289 | #if HAVE_SENDFILE |
295 | # if __linux |
290 | # if __linux |
296 | # include <sys/sendfile.h> |
291 | # include <sys/sendfile.h> |