Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!longway!std-unix From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.unix Subject: Re: ANSI vs POSIX on Message-ID: <717@longway.TIC.COM> Date: 4 Jun 90 17:04:29 GMT References: <711@longway.TIC.COM> <712@longway.TIC.COM> <714@longway.TIC.COM> Sender: std-unix@longway.TIC.COM Reply-To: std-unix@uunet.uu.net Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 44 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman) From: Doug Gwyn In article <714@longway.TIC.COM> From: Andy Tanenbaum >If one replaced the *_t types by their definitions everywhere, then a >decision to change pid_t from, say, int, to, say, long, would require >a real expert to dig through all the code to find those int's that really >are pid_t's. You miss an important point -- we're talking about system code provided by the IMPLEMENTOR, not application code. Presumably the implementor IS a real expert, and furthermore is in charge of the decision about what specific typedefs will be used. I suspect that many implementors will provide (for implementation use only) additional headers, say , that define identifiers such as __pid_t that are just like the POSIX ones but taken from the name space reserved for use by implementations. Then, for example, could contain: /* : */ #include #define pid_t __pid_t and could contain: /* : */ #include #ifdef _POSIX_SOURCE extern int kill(__pid_t, int); #endif which addresses the maintenance issue that the implementor might be faced with. (Applications are oblivious to all this substructure, which is the way things SHOULD be.) >This then raises the question of how to make pid_t known. In the example >implementation given, is included in raise.c. If this is >indeed legal, then that is clearly one way to do it, as presumably all the >names introduced by are not present in the object file, >raise.o, and thus do not pollute the name space. Yes, that was one of the points of the example. >However, why do you urge not to put #include into >under protection of #ifdef _POSIX_SOURCE? Because I don't think that use of _POSIX_SOURCE should pollute the name space beyond the minimum required for POSIX. Volume-Number: Volume 20, Number 26