kernel modules programming: struct proc question

Toni Andjelkovic toni at soth.at
Wed Mar 17 07:45:38 PST 2004


On Wed, Mar 17 2004 (17:00:02 +0200), Artis Caune wrote:
> "pid_t" is signed int type, or am I missing something?

You are right, pid_t is __int32_t, which is signed, so "%d"
is the correct format.

I assumed that in this case, the signed integer overflowed,
so maybe interpreting it as an unsigned integer would make
more sense.

However, I don't know what could cause a pid_t to become that
large. On 5.x, fork1() tries to find an unused pid for a new
process and checks if it lies between 100 and PID_MAX.

Cheers,
Toni


More information about the freebsd-hackers mailing list