Robert Collins wrote:
On Fri, 2004-10-15 at 15:33 +1000, Michael Kraus wrote:
I'm developing a database application that uses the inserting processes
pid. Problem is that I'm wondering how big this pid should be?
sizeof(pid_t) IIRC. Its system specific.
Technically, PID is also signed since
pid_t f;
f = fork();
can return -1 on error.
Personally I'd go with a signed 32bit integer, since that is what
the GNU C library uses for pid_t. And its really the C library's
definition, rather than the kernel's, which counts.
Any kernel in it's right mind is going to avoid negative PIDs as
that isn't the user's expectation; I note the Amos' message saying
that the Linux kernel currently allows PID values 1 to 4,194,303.
--
Glen Turner Tel: (08) 8303 3936 or +61 8 8303 3936
Australia's Academic & Research Network www.aarnet.edu.au
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html