kernel modules programming: struct proc question

Toni Andjelkovic toni at soth.at
Tue Mar 16 10:13:11 PST 2004


On Tue, Mar 16 2004 (19:39:56 +0300), Roman Bogorodskiy wrote:
[...]
> 		printf("open(2): %s pid: %i\n", name, (int)p->p_pid);
[...]
> Mar 16 19:15:44 nov kernel: open(2): /tmp/asfdasfsaf pid: -1002890624

pid_t is an unsigned number, so try "%u" in printf() instead.
There's no need to cast a pid_t to int.

Cheers,
Toni


More information about the freebsd-hackers mailing list