Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!uhccux!munnari.oz.au!mimir!hugin!augean!chook.ua.oz!cagney From: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Newsgroups: comp.os.minix Subject: POSIX headers, which of the below are correct Keywords: POSIX Message-ID: <682@augean.OZ> Date: 1 Dec 89 02:13:31 GMT Sender: news@augean.OZ Reply-To: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Organization: Comp Sci, Uni of Adelaide, Australia Lines: 34 I've being trying to compile earl chew's stdio using the POSIX header files recently posted. Among the problems encountered there is the following: In POSIX/usr/include/fcntl.h creat is declared as: _PROTOTYPE( int creat, (char *__path, int __mode) ); ie int creat(char *__path, int __mode); Where as Earl has declared it as: int creat P((const char *, mode_t)); /* create a file */ ie int creat(const char, mode_t); The two key differences are: 1. const 2. mode_t Which is correct? I suspect that the correct one should be: _PROTOTYPE( int creat, (const char *__path, mode_t __mode) ); ie int creat (const char *__path, mode_t __mode); (Yes I know that the names __path & __mode are optional but they are still nice :-) any thoughts? Andrew Cagney cagney@cs.ua.oz.au BTW: This testing is being done using gcc. The above form of macro expansion apparently the `done thing' for doing prototype declarations. (It is different to the method originally used. Some other problems encountered were: - missing , ... (optional third arguments) etc - files incorectly or not included - declarations containing syntax errors - fiddling so that the correct compiler is used.