kernel modules programming: struct proc question

Artis Caune ac-lists at latnet.lv
Wed Mar 17 07:00:46 PST 2004


"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 at 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


More information about the freebsd-hackers mailing list