From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 17 09:53:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDFE416A4CF for ; Wed, 17 Mar 2004 09:53:42 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E77C43D1F for ; Wed, 17 Mar 2004 09:53:42 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 7E9D354840; Wed, 17 Mar 2004 11:53:41 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 10DE36D465; Wed, 17 Mar 2004 11:53:41 -0600 (CST) Date: Wed, 17 Mar 2004 11:53:40 -0600 From: "Jacques A. Vidrine" To: Toni Andjelkovic Message-ID: <20040317175340.GA88110@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Toni Andjelkovic , Artis Caune , freebsd-hackers@freebsd.org References: <20040316163956.GD638@lame.novel.ru> <20040316181307.GA6576@tv.soth.at> <20040317142451.GC2506@lame.novel.ru> <20040317154530.GD6576@tv.soth.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040317154530.GD6576@tv.soth.at> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org cc: Artis Caune Subject: Re: kernel modules programming: struct proc question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2004 17:53:44 -0000 On Wed, Mar 17, 2004 at 04:45:30PM +0100, Toni Andjelkovic wrote: > 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. That's only correct for machines with 32-bit ints. In any case, POSIX only specifies that pid_t is a signed integer type... it could be any size supported by the implementation. For portability, you probably want to cast to the `biggest' type and use the appropriate printf specifier, e.g. printf("%ld", (long)pid_t); or printf("%jd", (intmax_t)pid_t); // C99 Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org