[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: getprocid C call



In <[🔎] a60354010905271136jc0f7173j312de3673fbb745c@mail.gmail.com>, Christian 
Jutras wrote:
>I have tried to find the *getprocid()* in Debian and could not find it,
> nor any equivalent. The *getproid()*  function call is a standard ANSI C,

Don't make claims you can't back up.  I just happen to have my copy of 
"ISO/IEC 9899:1999(E) -- Programming Languages -- C" and getprocid is not in 
it.  Neither is getproid.

That means they aren't ANSI C, so you can't use them in "pure" C programs.  
(Of course, the only "pure" C programs I've seen are toy programs.)

> is there any reason for Debian (and all other Linux I looked in) not to
> implement this function.

Probably because it is has a more functional equivalent in the relevant 
standards.

I looked for a replacement for you, under the assumption that you wanted 
something to "get the current process id".  Of course, ANSI C doesn't have 
the idea of a "process", so I couldn't find one there.

Perhaps by "standard ANSI C" you meant to include the Single UNIX 
Specification or POSIX extentions to the C language.  Using them is fairly 
portable.  It doesn't include MS Windows, but it does cover most other OSes.  
(I believe Mac OS 10.5 is UNIX 2003 certified, which requires being a 
conforming implementation of SUSv3 as best the test suite can tell, but I 
digress.)

Scanning my copy of SUSv2, there's no getprocid or getproid.  Whatever it is 
supposed to be, it's not very portable.  You probably mean getpid -- that 
goes back to at least the System V Interface Definitions, Issue 1 which is 
one of, if not the, first public API documentation for UNIX.
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

PS This isn't a developer list.

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: