delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/13/15:12:35

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=gtH6+sr
dm8SF9KX9etaxQ4z9yRez71OClxOwKObJF+ZH+9e0o3E7SI7aGP2ALAOYpFZtjSm
4AJz8Susk/PyZzar6lpk87wC+ldmy+1KL/NbqD9DRi2gXd43v0/F8JYbiftABEfb
TgmTvxju7LJJyjdgWMvHqQczN/DRqQHJYwL0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=SvM3vgrkN1XHu
wwqzD5/ybGGP4E=; b=yHFWAwyLVfdeX6qZZUApz8pXbhhIYNHkupJRjCYgDWaDU
0s+R5vw26vusN95rKJkbM2on+ONy6Ngpczmj9htlfLLMBg6zHpjnfByZ3BjNoBvB
B8eFvwC9eCyswALiHp0PVbBdyzIScmh957SnCGqRsDIdgFBAdNclDFHEf+xric=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=portable, HX-Languages-Length:747, HX-Spam-Relays-External:ESMTPA
X-HELO: chocolate.birch.relay.mailchannels.net
X-Sender-Id: dreamhost|x-authsender|dropbox AT opencoder DOT net
X-Sender-Id: dreamhost|x-authsender|dropbox AT opencoder DOT net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|dropbox AT opencoder DOT net
X-MailChannels-Auth-Id: dreamhost
X-Cure-Fearful: 57b03963060558cc_1568401898073_4289858146
X-MC-Loop-Signature: 1568401898073:2982215708
X-MC-Ingress-Time: 1568401898073
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opencoder.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type; s=opencoder.net; bh=6EHMo+Ayu7IQiiTeF52ZUkj+f4 I=; b=UcNZftRguIy6lHE42y5uIdixM8YRc/PIz82NZ5Oeyjd413nT8oslremB3F 9Srhh8m3KQLRjzCmtI59PUJQVg6VT3ShjBZJeXIhhXlIcjy5xzzBb9wYs3PnVq7O ycN3GxnQgg+BaIAAwsz50rHEApi9HaArViMo8PDU5UsF0A0jU=
MIME-Version: 1.0
References: <78512bbe-b912-9bf5-d6cf-9da5b982c955 AT SystematicSw DOT ab DOT ca> <016201d56a26$37271f70$a5755e50$@twcny.rr.com>
In-Reply-To: <016201d56a26$37271f70$a5755e50$@twcny.rr.com>
X-DH-BACKEND: pdx1-sub0-mail-a86
From: Wayne Davison <wayne AT opencoder DOT net>
Date: Fri, 13 Sep 2019 12:11:23 -0700
Message-ID: <CAHSx_Ssk0i6UDxoNULcG4ugv_mt7hjTP-DAUQnOUgxX3pXit0w@mail.gmail.com>
Subject: Re: Bug in TIME function
To: cygwin <cygwin AT cygwin DOT com>
X-VR-OUT-STATUS: OK
X-VR-OUT-SCORE: 0
X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrtdejgddufeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpeggfhgjhfffkffuvfgtsehttdertddttdejnecuhfhrohhmpeghrgihnhgvucffrghvihhsohhnuceofigrhihnvgesohhpvghntghouggvrhdrnhgvtheqnecukfhppedvtdelrdekhedrudeiuddrheefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdqhiifuddqfhehfedrghhoohhglhgvrdgtohhmpdhinhgvthepvddtledrkeehrdduiedurdehfedprhgvthhurhhnqdhprghthhephggrhihnvgcuffgrvhhishhonhcuoeifrgihnhgvsehophgvnhgtohguvghrrdhnvghtqedpmhgrihhlfhhrohhmpeifrgihnhgvsehophgvnhgtohguvghrrdhnvghtpdhnrhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd
X-IsSubscribed: yes

On Fri, Sep 13, 2019 at 4:27 AM wrote:
> In Linux [times()] returns a time value and return code of 0:

The Linux man page for times() mentions this special behavior, how it
isn't portable, and even advises against using the function:

"On Linux, the buf argument can be specified as NULL, with the result
that times() just returns a function result. However, POSIX does not
specify this behavior, and most other UNIX implementations require a
non-NULL value for buf."

"[...] a portable application would be wise to avoid using this value.
To measure changes in elapsed time, use clock_gettime(2)
instead."

One might argue that it would be nice to emulate the Linux behavior,
but it's not required by POSIX.

..wayne..

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019