From owner-freebsd-stable@FreeBSD.ORG Sun Jun 29 21:26:49 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CB741065671 for ; Sun, 29 Jun 2008 21:26:49 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mx1.freebsd.org (Postfix) with ESMTP id E9A9C8FC2E for ; Sun, 29 Jun 2008 21:26:48 +0000 (UTC) (envelope-from gaijin.k@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so540470ywe.13 for ; Sun, 29 Jun 2008 14:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=LUe61o2OW1j3wr764ainPNEnn+3wMcJLC8KHAlMyZls=; b=ZaFkrH4v4RxFBG/QuMCoAA1x3TbfuMhWOvjawGA+CgnTC4JLtmjfxow6ISnA14G5pV 2SS4EpsoWIXoYYiuYHR+xriRGPaYbcCtkDR6Au/gtsgT59/vi5t8pxLtu611vPFTuo5l Hz9ZDguN6RGWyhvCYIw3V7gBECIhbGmw6V7tg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=QGesFUTNxn5GAuNQuhTv7jNXWJPOJ3da8Bfbve/3JvdxdfV8sJJ6qhGdQnO005r89E WGurjURN+QUjItGCMbqeLYGOHSBJmjpgazUCxIurWL2qg2iq0+n4AdAihl7Y23o8KHPc XHhE41fuFZB1i/N7/LtQ3pSJ7HZsfr7OqZddo= Received: by 10.150.197.8 with SMTP id u8mr7037738ybf.122.1214774798938; Sun, 29 Jun 2008 14:26:38 -0700 (PDT) Received: from ?10.0.3.231? ( [70.111.175.14]) by mx.google.com with ESMTPS id 6sm7388530ywp.3.2008.06.29.14.26.38 (version=SSLv3 cipher=RC4-MD5); Sun, 29 Jun 2008 14:26:38 -0700 (PDT) From: "Alexandre \"Sunny\" Kovalenko" To: stable@freebsd.org Content-Type: text/plain; charset=UTF-8 Date: Sun, 29 Jun 2008 16:16:25 -0400 Message-Id: <1214770585.1079.13.camel@RabbitsDen> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit Cc: Subject: expand_number(3) silently truncates numeric part of the argument to 32 bit on i386, light impact on gjournal X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2008 21:26:49 -0000 I honestly don't know whether it should or should not do it, and if it should not, what errno should be set to. Program below gives following output on RELENG_7 as of June 28th: sunny:RabbitsDen>./expand_number 5368709120k Result is 1099511627776 sunny:RabbitsDen>./expand_number 5120G Result is 5497558138880 sunny:RabbitsDen> One of the more interesting manifestations in the userland is that gjournal label -s 5368709120 -f /dev/da0s1a quietly gives you 1G of the journal in the resulting file system. Cut here>----------------------------------------------------------- #include #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } errno = 0; intmax_t result; if(expand_number(argv[1], &result) || errno) { perror("Expand number"); exit(1); } printf("Result is %jd\n", result); exit(0); } Cut here>----------------------------------------------------------- -- Alexandre "Sunny" Kovalenko (Олександр Коваленко)