Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!bruce!cechew From: cechew@bruce.OZ (Earl Chew) Newsgroups: comp.os.minix Subject: Re: POSIX headers, which of the below are correct Message-ID: <1734@bruce.OZ> Date: 4 Dec 89 22:23:45 GMT References: <22014@princeton.Princeton.EDU> Organization: Monash Uni. Computer Science, Australia Lines: 45 From article <22014@princeton.Princeton.EDU>, by nfs@notecnirp.Princeton.EDU (Norbert Schlenker): > :Where as Earl has declared it as: > : int creat P((const char *, mode_t)); /* create a file */ I must confess that I didn't refer to the standard very carefully when I wrote that line :-( > What should be done? I believe that the correct thing is that POSIX > should be modified to reflect the non-modifiability of the pathname. > After all, programs use creat() to create files, not to mangle pathnames. > But knowing that the standard is virtually set in stone at this point, > I think the correct thing is out of the question. From my reading of open(), the standard doesn't say that open() *will* mangle path names. If it did, you wouldn't be able to say things like: fd = open("/etc/termcap", O_RDONLY); since "strings" are supposed to be regarded as non-modifiable. On the other hand, the standard doesn't say then open() *will not* mangle the path name but I do not seriously think that open(), creat(), access(), etc will modify the path name since that would cause programs passing string constants to fail. That would break a fair amount of current software. Furthermore, I refer you to B.1.4, which says, of function parameter lists, "Function parameter type lists were not used because the Working Group was aware that some vendors would wish to implement POSIX in terms of a binding to an historical variant of the C language instead of to the C Standard, since compilers for the latter would initially not be widespread." This is probably also the reason that const and volatile, etc, are not used in the standard. > What will be done? I am considering changing my code to handle this, From the above, I don't seriously think that it is worth while. open() mangling path names will break more code than just stdio. Earl -- Earl Chew, Dept of Computer Science, Monash University, Australia 3168 ARPA: cechew%bruce.cs.monash.oz.au@uunet.uu.net ACS : cechew@bruce.oz ----------------------------------------------------------------------