diff options
| author | Eli Zaretskii | 2011-02-27 21:48:31 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-02-27 21:48:31 +0200 |
| commit | 0f7bb05d28a57975fca586d7b3aa5e72edf56897 (patch) | |
| tree | 808ec29fd466d37a0f90b3818a39567a5cd85249 | |
| parent | d05e7e6721bc02b910965293752198e9c73e2208 (diff) | |
| download | emacs-0f7bb05d28a57975fca586d7b3aa5e72edf56897.tar.gz emacs-0f7bb05d28a57975fca586d7b3aa5e72edf56897.zip | |
Implement stubs of `readlink' and `symlink' for MS-Windows.
src/w32.c (symlink, readlink): New stub functions.
nt/inc/unistd.h (readlink, symlink): Declare prototypes.
| -rw-r--r-- | nt/ChangeLog | 4 | ||||
| -rw-r--r-- | nt/inc/unistd.h | 8 | ||||
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/w32.c | 19 |
4 files changed, 35 insertions, 0 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index bfaba610bf2..e55fc52a487 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-02-27 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * inc/unistd.h (readlink, symlink): Declare prototypes. | ||
| 4 | |||
| 1 | 2011-02-26 Eli Zaretskii <eliz@gnu.org> | 5 | 2011-02-26 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * config.nt (nlink_t): Define. | 7 | * config.nt (nlink_t): Define. |
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h index 7e77f95da4c..fb1f1c4b3bf 100644 --- a/nt/inc/unistd.h +++ b/nt/inc/unistd.h | |||
| @@ -1,2 +1,10 @@ | |||
| 1 | /* Fake unistd.h: config.h already provides most of the relevant things. */ | 1 | /* Fake unistd.h: config.h already provides most of the relevant things. */ |
| 2 | 2 | ||
| 3 | #ifndef _UNISTD_H | ||
| 4 | #define _UNISTD_H | ||
| 5 | |||
| 6 | extern ssize_t readlink (const char *, char *, size_t); | ||
| 7 | extern int symlink (char const *, char const *); | ||
| 8 | |||
| 9 | #endif /* _UNISTD_H */ | ||
| 10 | |||
diff --git a/src/ChangeLog b/src/ChangeLog index 1929c3fc98a..f3710495c4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-02-27 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32.c (symlink, readlink): New stub functions. | ||
| 4 | |||
| 1 | 2011-02-27 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2011-02-27 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 6 | ||
| 3 | * scroll.c (CHECK_BOUNDS): #define only if GLYPH_DEBUG. | 7 | * scroll.c (CHECK_BOUNDS): #define only if GLYPH_DEBUG. |
| @@ -3614,6 +3614,25 @@ utime (const char *name, struct utimbuf *times) | |||
| 3614 | } | 3614 | } |
| 3615 | 3615 | ||
| 3616 | 3616 | ||
| 3617 | /* Symlink-related functions that always fail. Used in fileio.c to | ||
| 3618 | avoid #ifdef's. */ | ||
| 3619 | int | ||
| 3620 | symlink (char const *dummy1, char const *dummy2) | ||
| 3621 | { | ||
| 3622 | errno = ENOSYS; | ||
| 3623 | return -1; | ||
| 3624 | } | ||
| 3625 | |||
| 3626 | ssize_t | ||
| 3627 | readlink (const char *name, char *dummy1, size_t dummy2) | ||
| 3628 | { | ||
| 3629 | /* `access' is much faster than `stat' on MS-Windows. */ | ||
| 3630 | if (sys_access (name, 0) == 0) | ||
| 3631 | errno = EINVAL; | ||
| 3632 | return -1; | ||
| 3633 | } | ||
| 3634 | |||
| 3635 | |||
| 3617 | /* Support for browsing other processes and their attributes. See | 3636 | /* Support for browsing other processes and their attributes. See |
| 3618 | process.c for the Lisp bindings. */ | 3637 | process.c for the Lisp bindings. */ |
| 3619 | 3638 | ||