delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/06/08/23:17:11

Date: Mon, 8 Jun 1998 20:13:42 -0700 (PDT)
From: Nate Eldredge <nate AT cartsys DOT com>
To: djgpp-workers AT delorie DOT com
Subject: Stat modes different from Unix systems
Message-ID: <Pine.LNX.3.96.980608200125.633A-100000@unixbox.bitbucket.org>
MIME-Version: 1.0

While porting `mkisofs' to DJGPP, I found a problem.  DJGPP's numerical
stat mode values are different from those on Unix boxen.  For example, our
flag for directories is 0x3000, while the Unix systems I saw (Linux, IRIX
and FreeBSD) all have 0x4000 (040000 octal).  Worse yet, regular files
have an absence of special flags for us, while Unices have 0x8000!

This was a problem because the Rock Ridge directory entries (which
have Unix long file names and permission/file type info) contain the
literal `st_mode' value obtained from `stat', and those are interpreted
verbatim by the system that reads the image.  Thus, when I tried to mount
an ISO image created by my port, Linux saw bogus modes, and nothing
worked.

I was able to work around by explicitly modifying the `st_mode' field
inside of `mkisofs', but I wonder what the Right Thing is.  I don't know
if this is just a case of `mkisofs' being non-portable, or the Rock Ridge
format being a kludge, or Linux being stupid (I doubt the latter).  It's
suspicious that the SGI IRIX headers refer to those values as "de facto
standard".

Is it worth it for us to change our numbers to be compatible?  What else
are we likely to break?


Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019