Date: Wed, 17 Mar 2004 17:00:02 +0200 From: Artis Caune <ac-lists@latnet.lv> To: freebsd-hackers@freebsd.org Subject: Re: kernel modules programming: struct proc question Message-ID: <opr40hacqdcpfy5d@mail.latnet.lv> In-Reply-To: <20040317142451.GC2506@lame.novel.ru> References: <20040316163956.GD638@lame.novel.ru> <20040316181307.GA6576@tv.soth.at> <20040317142451.GC2506@lame.novel.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
"pid_t" is signed int type, or am I missing something? try this one: static int new_open (struct proc *p, register struct open_args *uap) { pid_t pid; pid = p->p_pid; printf("open(2): pid: %d\n", pid); return (open(p,uap)); } On Wed, 17 Mar 2004 17:24:51 +0300, Roman Bogorodskiy <bogorodskiy@inbox.ru> wrote: > Toni wrote: > >> pid_t is an unsigned number, so try "%u" in printf() instead. >> There's no need to cast a pid_t to int. > > Doesn't help. It shows wrong pid's again... > > -Roman Bogorodskiy > -- Artis
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?opr40hacqdcpfy5d>