/[cmucl]/src/code/unix-glibc2.lisp
ViewVC logotype

Diff of /src/code/unix-glibc2.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by emarsden, Wed Mar 5 15:54:52 2003 UTC revision 1.24 by pmai, Sat Mar 8 17:51:52 2003 UTC
# Line 33  Line 33 
33  ;; 64-bit wide versions of the data structures. The most ugly aspect  ;; 64-bit wide versions of the data structures. The most ugly aspect
34  ;; is that some of the stat functions are not available via dlsym, so  ;; is that some of the stat functions are not available via dlsym, so
35  ;; we reference them explicitly from linux-stubs.S. Another amusing  ;; we reference them explicitly from linux-stubs.S. Another amusing
36  ;; fact is that stat64() returns a struct stat with a 32-bit inode_t,  ;; fact is that on glibc 2.2, stat64() returns a struct stat with a
37  ;; whereas readdir64() returns a struct dirent that contains a 64-bit  ;; 32-bit ino_t, whereas readdir64() returns a struct dirent that
38  ;; inode_t.  ;; contains a 64-bit ino_t.  On glibc 2.1, OTOH, both stat64 and
39    ;; readdir64 use structs with 32-bit ino_t.
40    ;;
41    ;; The current version deals with this by going with the glibc 2.2
42    ;; definitions, unless the keyword :glibc2.1 also occurs on *features*,
43    ;; in addition to :glibc2, in which case we go with the glibc 2.1
44    ;; definitions.  Note that binaries compiled against glibc 2.1 do in
45    ;; fact work fine on glibc 2.2, because readdir64 is available in both
46    ;; glibc 2.1 and glibc 2.2 versions in glibc 2.2, disambiguated through
47    ;; ELF symbol versioning.  We use an entry for readdir64 in linux-stubs.S
48    ;; in order to force usage of the correct version of readdir64 at runtime.
49    ;;
50    ;; So in order to compile for glibc 2.2 and newer, just compile CMUCL
51    ;; on a glibc 2.2 system, and make sure that :glibc2.1 doesn't appear
52    ;; on the *features* list.  In order to compile for glibc 2.1 and newer,
53    ;; compile CMUCL on a glibc 2.1 system, and make sure that :glibc2.1 does
54    ;; appear on the *features* list.
55    
56  (in-package "UNIX")  (in-package "UNIX")
57  (use-package "ALIEN")  (use-package "ALIEN")
# Line 373  Line 387 
387    
388  (def-alien-type nil  (def-alien-type nil
389    (struct dirent    (struct dirent
390        #+glibc2.1
391        (d-ino ino-t)                       ; inode number of entry
392        #-glibc2.1
393      (d-ino ino64-t)                     ; inode number of entry      (d-ino ino64-t)                     ; inode number of entry
394      (d-off off-t)                       ; offset of next disk directory entry      (d-off off-t)                       ; offset of next disk directory entry
395      (d-reclen unsigned-short)           ; length of this record      (d-reclen unsigned-short)           ; length of this record

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.5