From owner-cvs-src@FreeBSD.ORG Sat Jan 20 22:53:13 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 53E0416A400; Sat, 20 Jan 2007 22:53:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 03FBA13C459; Sat, 20 Jan 2007 22:53:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l0KMo2JB047315; Sat, 20 Jan 2007 15:50:03 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 20 Jan 2007 15:50:02 -0700 (MST) Message-Id: <20070120.155002.74705552.imp@bsdimp.com> To: scottl@samsco.org From: Warner Losh In-Reply-To: <45B28A31.4080604@samsco.org> References: <45B275F0.9030904@errno.com> <20070120222148.4f700711@Magellan.Leidinger.net> <45B28A31.4080604@samsco.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 20 Jan 2007 15:50:03 -0700 (MST) Cc: sam@errno.com, src-committers@FreeBSD.org, netchild@FreeBSD.org, cvs-all@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/linprocfs linprocfs.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jan 2007 22:53:13 -0000 From: Scott Long Subject: Re: cvs commit: src/sys/compat/linprocfs linprocfs.c Date: Sat, 20 Jan 2007 14:31:29 -0700 > Alexander Leidinger wrote: > > Quoting Sam Leffler (Sat, 20 Jan 2007 12:05:04 -0800): > > > >> Scott Long wrote: > >>> Alexander Leidinger wrote: > >>>> netchild 2007-01-20 19:32:23 UTC > >>>> > >>>> FreeBSD src repository > >>>> > >>>> Modified files: > >>>> sys/compat/linprocfs linprocfs.c Log: > >>>> Fix tinderbox build on amd64. > >>>> Revision Changes Path > >>>> 1.104 +2 -2 src/sys/compat/linprocfs/linprocfs.c > >>> Try the following instead: > > > > I try tomorrow. Thanks! > > > >>> --- linprocfs.c 20 Jan 2007 19:32:23 -0000 1.104 > >>> +++ linprocfs.c 20 Jan 2007 19:46:29 -0000 > >>> @@ -474,8 +474,8 @@ > >>> state = 'R'; > >>> > >>> if (ratelimit == 0) { > >>> - printf("linprocfs: don't know how to handle > >>> unknown FreeBSD state %d/%jd, mapping to R\n", > >>> - kp.ki_stat, (intmax_t)sizeof(linux_state)); > >>> + printf("linprocfs: don't know how to handle > >>> unknown FreeBSD state %d/%zd, mapping to R\n", > >>> + kp.ki_stat, sizeof(linux_state)); > >>> ++ratelimit; > >>> } > >>> } else > >>> > >>> > >> Are the kernel prinf extensions documented anywhere (don't see 'em in > >> printf(9))? I always forget and have to resort to the code... > > > > In the reply to the tinderbox mail I asked if there are some docs which > > provide info which printf-identifier to use in which (common) > > situation. I think this would be very useful (and can be provided in > > the wiki if it doesn't fit into a man page). > > > > Bye, > > Alexander. > > > > I use printf.3 for reference. The kernel printf is only a subset, but > it implements enough for the userland docs to be useful. For backup, I > recommend using bde@ printf.9 should list the exceptions, but other than floating point, there's not much. The following table should be enlightening: o An optional length modifier, that specifies the size of the argument. The following length modifiers are valid for the d, i, n, o, u, x, or X conversion: Modifier d, i o, u, x, X n hh signed char unsigned char signed char * h short unsigned short short * l (ell) long unsigned long long * ll (ell ell) long long unsigned long long long long * j intmax_t uintmax_t intmax_t * t ptrdiff_t (see note) ptrdiff_t * z (see note) size_t (see note) q (deprecated) quad_t u_quad_t quad_t * Warner