Re: Bug in TIME function

2019-09-16 Thread Brian Inglis
On 2019-09-13 16:14, Kaz Kylheku wrote: > On 2019-09-13 12:11, Wayne Davison wrote: >> 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 adv

Re: Bug in TIME function

2019-09-15 Thread Achim Gratz
tl...@twcny.rr.com writes: > The code below returns -1. It shouldn't. This is hopefully fixed in the 3.1.0-05 test release of Cygwin. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2: http://Synth.Strome

Re: Bug in TIME function

2019-09-13 Thread Kaz Kylheku
On 2019-09-13 12:11, Wayne Davison wrote: 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

Re: Bug in TIME function

2019-09-13 Thread Wayne Davison
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

RE: Bug in TIME function

2019-09-13 Thread tlake
: cygwin@cygwin.com Subject: Re: Bug in TIME function On 2019-09-12 12:05, tl...@twcny.rr.com wrote: > The code below returns -1. It shouldn't. > #include > #include > int main(int argc, char *argv[]) > { > printf("return value %ld\n", (long)times((struct tms*)

Re: Bug in TIME function

2019-09-12 Thread Kaz Kylheku
On 2019-09-12 11:16, Kaz Kylheku wrote: So even in light of the goal of Cygwin providing GNU/Linux compatibility beyond POSIX, there is no justification for supporting times(0). What I wrote here is not true; on Linux, this is a system call, which provides detection of some kinds of bad pointe

Re: Bug in TIME function

2019-09-12 Thread Brian Inglis
On 2019-09-12 12:05, tl...@twcny.rr.com wrote: > The code below returns -1. It shouldn't. > #include > #include > int main(int argc, char *argv[]) > { > printf("return value %ld\n", (long)times((struct tms*)0)); > return 0; > } It should. The times(3) function requires a pointer to object st

Re: Bug in TIME function

2019-09-12 Thread Kaz Kylheku
On 2019-09-12 11:05, tl...@twcny.rr.com wrote: The code below returns -1. It shouldn't. Says who? I don't see anything in the specification which says that a null pointer argument is allowed: https://pubs.opengroup.org/onlinepubs/9699919799/functions/times.html Passing a null pointer to an

Bug in TIME function

2019-09-12 Thread tlake
The code below returns -1. It shouldn't. #include #include int main(int argc, char *argv[]) { printf("return value %ld\n", (long)times((struct tms*)0)); return 0; } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Docume