This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: G++/times causes access violation on cygwin, not linux


Hi Mirko,


Mirko Vukovic wrote:
>   clock_t ElapsedSystemTime;
>   struct tms * pArg;
>   ElapsedSystemTime=times(pArg);

You're not allocating memory for the struct tms anywhere.  As it stands
you are passing an uninitialized garbage pointer to times().  I didn't
look up times() in the manual, but this should probably say

    struct tms arg;
    ElapsedSystemTime=times(&arg);

Note that I declared "arg" as a value of type struct tms, not as a
pointer.  It's also possible that you need to initialize that value,
consult the documentation of times() for that issue.


so long, benny
-- 
ISION Internet AG
Benjamin Riefenstahl
mailto:benjamin.riefenstahl@ision.net

Ruhrstrasse 61
D-22761 Hamburg
http://www.ision.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]