bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] readlink and mingw32


From: Bruno Haible
Subject: [Bug-gnulib] readlink and mingw32
Date: Wed, 25 Jun 2003 12:35:30 +0200
User-agent: KMail/1.5

Hi,

It was reported to me that mingw32 has no readlink() function. The xreadlink
module does not take care of this yet. Jim, in the coreutils, uses a stub

int
readlink (const char *filename, char *buffer, size_t size)
{
  errno = EINVAL;
  return -1;
}

in an extra file. But since the purpose of xreadlink.c is that everyone
uses only xreadlink() and not the low-level readlink(), I'd propose this
more lightweight change.

Opinions?

Bruno


*** m4/ChangeLog        11 Jun 2003 10:42:09 -0000      1.456
--- m4/ChangeLog        25 Jun 2003 10:33:54 -0000
***************
*** 1,3 ****
--- 1,15 ----
+ 2003-06-25  Bruno Haible  <address@hidden>
+ 
+       Portability to mingw32.
+       * xreadlink.m4 (gl_XREADLINK): Also check for readlink().
+ 
+ 2003-06-22  Bruno Haible  <address@hidden>
+ 
+       Portability to mingw32.
+       * ssize_t.m4: New file, from GNU gettext.
+       * safe-read.m4 (gl_PREREQ_SAFE_READ): Require gt_TYPE_SSIZE_T.
+       * xreadlink.m4 (gl_XREADLINK): Require gt_TYPE_SSIZE_T.
+ 
  2003-06-11  Bruno Haible  <address@hidden>
  
        * sysexits.m4: New file.
*** m4/xreadlink.m4     25 Jun 2003 09:20:53 -0000      1.3
--- m4/xreadlink.m4     25 Jun 2003 10:33:54 -0000
***************
*** 1,4 ****
! # xreadlink.m4 serial 3
  dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
--- 1,4 ----
! # xreadlink.m4 serial 4
  dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
***************
*** 11,14 ****
--- 11,15 ----
    dnl Prerequisites of lib/xreadlink.c.
    AC_REQUIRE([gt_TYPE_SSIZE_T])
    AC_CHECK_HEADERS_ONCE(stdlib.h sys/types.h unistd.h)
+   AC_CHECK_FUNCS(readlink)
  ])
*** lib/ChangeLog       20 Jun 2003 20:55:34 -0000      1.497
--- lib/ChangeLog       25 Jun 2003 10:33:55 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2003-06-25  Bruno Haible  <address@hidden>
+ 
+       * xreadlink.c (xreadlink): Define as a stub when readlink() does not
+       exist.
+ 
  2003-06-20  Bruno Haible  <address@hidden>
  
        Assume C89, so PARAMS isn't needed.
*** lib/xreadlink.c     29 May 2003 07:21:59 -0000      1.9
--- lib/xreadlink.c     25 Jun 2003 10:33:55 -0000
***************
*** 29,34 ****
--- 29,36 ----
  extern int errno;
  #endif
  
+ #if HAVE_READLINK
+ 
  #include <limits.h>
  #if HAVE_SYS_TYPES_H
  # include <sys/types.h>
***************
*** 88,90 ****
--- 90,106 ----
        xalloc_die ();
      }
  }
+ 
+ #else
+ 
+ /* Substitute for systems that don't have readlink(), like DJGPP 2.03 and
+    mingw.  */
+ 
+ char *
+ xreadlink (char const *filename)
+ {
+   errno = EINVAL;
+   return NULL;
+ }
+ 
+ #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]