summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2011-02-27 21:51:35 +0200
committerEli Zaretskii <eliz@gnu.org>2011-02-27 21:51:35 +0200
commit4824410fa8236c8c005107d24898e48c762e83c6 (patch)
treef281f350b17a34b5b8dae65f8395e8944e53beee
parent0f7bb05d28a57975fca586d7b3aa5e72edf56897 (diff)
parent40be44e2a95cd703e49022c8f8aa0ce5b9b29ea6 (diff)
downloademacs-4824410fa8236c8c005107d24898e48c762e83c6.tar.gz
Implement stub emulation of `readlink' for MS-DOS.
src/msdos.c (readlink) [DJGPP < 2.04]: New stub function. src/msdos.h: (readlink) [DJGPP < 2.04]: Declare prototype.
-rw-r--r--src/ChangeLog4
-rw-r--r--src/msdos.c12
-rw-r--r--src/msdos.h5
3 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f3710495c4a..a7c9d4c7e3c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2011-02-27 Eli Zaretskii <eliz@gnu.org>
+ * msdos.c (readlink) [DJGPP < 2.04]: New stub function.
+
+ * msdos.h: (readlink) [DJGPP < 2.04]: Declare prototype.
+
* w32.c (symlink, readlink): New stub functions.
2011-02-27 Paul Eggert <eggert@cs.ucla.edu>
diff --git a/src/msdos.c b/src/msdos.c
index df51c5fdb88..261a09ac859 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -3920,6 +3920,18 @@ croak (char *badfunc)
*/
int setpgrp (void) {return 0; }
int setpriority (int x, int y, int z) { return 0; }
+
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
+ssize_t
+readlink (const char *name, char *dummy1, size_t dummy2)
+{
+ /* `access' is much faster than `stat' on MS-DOS. */
+ if (access (name, F_OK) == 0)
+ errno = EINVAL;
+ return -1;
+}
+#endif
+
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
diff --git a/src/msdos.h b/src/msdos.h
index 6b076c1722b..4bbe9b134de 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -40,6 +40,11 @@ void mouse_init (void);
void mouse_on (void);
void mouse_off (void);
void mouse_moveto (int, int);
+
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
+int readlink (const char *, char *, size_t);
+#endif
+
#ifndef HAVE_X_WINDOWS
/* Dummy types. */