Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!ncar!gatech!hubcap!ncrcae!ncrlnk!uunet!mcvax!cernvax!ethz!forty2!poole From: poole@forty2.UUCP (Simon Poole) Newsgroups: comp.os.minix Subject: POSIX question (was: Patches for BSD more for ST-Minix 1.1) Message-ID: <583@forty2.UUCP> Date: 10 Jan 89 17:07:28 GMT References: <579@forty2.UUCP> Reply-To: poole@forty2.UUCP (Simon Poole) Organization: Exp. Physics University Zuerich Lines: 41 In article <579@forty2.UUCP> poole@forty2.UUCP (Simon Poole) writes: >X - `more' reads from file descriptor 2 (stderr), but >X the standard ST-Minix `init' opens stdout and stdin >X only for writing: >X Fix: change the modes in the open calls in >X /usr/src/sttools/init.c to 2. >X - the `execv' libary call doesn't pass the enviroment >X of the current process to `execve' (this breaks the >X `v' and `!' commands): Being inquisitive, I consulted IEEE 1003.1 (POSIX, I've only got access to a 1986 copy of the trial draft standard, is there anything more recent?) on the above two problems, the second one being easy: quoted from section 3.1.2 Execute a File 'For those forms not containing an envp pointer (execl(), execv(), execlp(), and execvp()) the enviroment is taken from the external variable environ.' I was however quite suprised to find out that POSIX (well at least the copy of the standard I've got) does not address the subject of `pre- opened' files (in Unix normally the files with filehandles 0, 1 and 2) at all (except that they are inherited over exec's). Now considering the importance of the `tool' concept in Unix (which depends on some kind of standard for passing preopened files for input and output to a program), I'm really amazed that there is no reference at all to this subject. [As far as I can see, the only work around is to use stdio (which presumely knows what is customary under the hosts operating system) and get the filehandle for stdout etc. with fileno(3)] Is this a problem or am I just stupid (more likely)? -- ---------------------------------------------------------------------------- UUCP: ...mcvax!cernvax!forty2!poole Simon Poole BITNET: K538915@CZHRZU1A ----------------------------------------------------------------------------