From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 2 02:14:47 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 152D0C23; Sun, 2 Nov 2014 02:14:47 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id ACB18689; Sun, 2 Nov 2014 02:14:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYEAPqSVVSDaFve/2dsb2JhbABcg2JYBIMCyjcKhnlUAoEqAQEBAQF9hAIBAQEDAQEBASArIAsbGAICDRkCKQEJJgYPBAEcBIgXCQ21H5QKAQEBAQYBAQEBAQEBARqBLY8SAQEbATMHgneBVAWWaYQShHSLC4lXhBQhLweBCDmBAwEBAQ X-IronPort-AV: E=Sophos;i="5.07,295,1413259200"; d="scan'208";a="163915789" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 01 Nov 2014 22:14:45 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 027BBB3F91; Sat, 1 Nov 2014 22:14:45 -0400 (EDT) Date: Sat, 1 Nov 2014 22:14:45 -0400 (EDT) From: Rick Macklem To: Julian Elischer Message-ID: <604180572.3888597.1414894484998.JavaMail.root@uoguelph.ca> In-Reply-To: <54558778.7050500@freebsd.org> Subject: Re: how to kernel printf a int64_t? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 7.2.6_GA_2926 (ZimbraWebClient - FF3.0 (Win)/7.2.6_GA_2926) Cc: Freebsd hackers list X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 02:14:47 -0000 Julian Elischer wrote: >=20 > On 10/31/14, 1:09 PM, Tim Kientzle wrote: >=20 >=20 > On Oct 30, 2014, at 2:01 PM, Rick Macklem > wrote: >=20 > Hi, >=20 > I feel kinda dumb asking this, but... > int64_t i; >=20 > printf("%qd\n", (u_quad_t)i); >=20 > works but looks dorky, to put it technically;-). > Is there a better way to printf() a int64_t in the kernel? I often > use the following to print large integers: >=20 > printf(=E2=80=9C%jd\n=E2=80=9D, (intmax_t)i); the "cannonical' way is= to use > PRIu64 and friends, but some people seem to have a problem with > doing that. >=20 Ok, so now I need to ask another dumb question. How do you do this in the kernel? (I can see them defines in , but including that doesn't help, which isn't surprising since PRIu64 is in a string and won't be recognized as a macro.) Oh, and is intmax_t going to be int64_t on all arches? Thanks, rick >=20 >=20 > Tim >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To > unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" >=20