This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using _FILE_OFFSET_BITS=64 with a non-gcc compiler


Ulrich Drepper writes:
> the application namespace is changed.

Here is a different patch. It makes 'dirent64' a #define of 'dirent',
not the other way around. This patch makes the warnings disappear,
like the other one.

Since the symbols 'dirent64' and 'rlimit64' are not mentioned by
POSIX, this patch doesn't violate POSIX namespacing.

About the fact that defining _FILE_OFFSET_BITS=64 introduces symbols
like 'readdir64', 'dirent64' etc. at all: this is already a
consequence of the following snippets in <features.h>

    /* If we don't have __REDIRECT, prototypes will be missing if
       __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
    # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
    #  define __USE_LARGEFILE       1
    #  define __USE_LARGEFILE64     1
    # endif

and in <bits/dirent.h>

    #ifdef __USE_LARGEFILE64
    struct dirent64
      { ...};
    #endif

This patch thus only changes the way 'dirent64' is defined, not
whether it is defined at all.


2001-11-12  Bruno Haible  <haible@clisp.cons.org>

	* dirent/dirent.h (dirent64): Define as dirent if __USE_FILE_OFFSET64
	and !__REDIRECT.
	* resource/sys/resource.h (rlimit64): Define as rlimit if
	__USE_FILE_OFFSET64 and !__REDIRECT.

*** glibc-20011110/dirent/dirent.h.bak	Tue Jul 10 22:57:41 2001
--- glibc-20011110/dirent/dirent.h	Tue Nov 13 00:39:07 2001
***************
*** 61,66 ****
--- 61,74 ----
  
  #include <bits/dirent.h>
  
+ /* If __USE_FILE_OFFSET64 and we don't have __REDIRECT, we #define readdir
+    to readdir64, and its prototype returns a 'struct dirent64 *', but the
+    user's code expects to be able to designate it by 'struct dirent *'.
+    Similarly for scandir's second argument.  */
+ #if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+ # define dirent64 dirent
+ #endif
+ 
  #if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
  # define d_ino	d_fileno		 /* Backward compatibility.  */
  #endif
*** glibc-20011110/resource/sys/resource.h.bak	Tue Jul 10 22:59:48 2001
--- glibc-20011110/resource/sys/resource.h	Tue Nov 13 00:38:18 2001
***************
*** 1,4 ****
! /* Copyright (C) 1992, 94, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
--- 1,4 ----
! /* Copyright (C) 1992, 94, 1996-1999, 2000, 2001 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
  
     The GNU C Library is free software; you can redistribute it and/or
***************
*** 24,29 ****
--- 24,36 ----
  /* Get the system-dependent definitions of structures and bit values.  */
  #include <bits/resource.h>
  
+ /* If __USE_FILE_OFFSET64 and we don't have __REDIRECT, we #define getrlimit
+    to getrlimit64, and its prototype uses a 'struct rlimit64 *', but the
+    user's code expects to be able to designate it by 'struct rlimit *'.  */
+ #if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+ # define rlimit64 rlimit
+ #endif
+ 
  #ifndef __id_t_defined
  typedef __id_t id_t;
  # define __id_t_defined


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]