Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Mar 2004 19:13:07 +0100
From:      Toni Andjelkovic <toni@soth.at>
To:        Roman Bogorodskiy <bogorodskiy@inbox.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kernel modules programming: struct proc question
Message-ID:  <20040316181307.GA6576@tv.soth.at>
In-Reply-To: <20040316163956.GD638@lame.novel.ru>
References:  <20040316163956.GD638@lame.novel.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040316181307.GA6576>