Article View: comp.std.c
Article #4197Re: gettimeofday
From: Stan Ryckman
Date: Sat, 07 Oct 1995 13:53
Date: Sat, 07 Oct 1995 13:53
21 lines
1048 bytes
1048 bytes
In article <453r0e$d7g@news.intelsat.int>,
<suresh@pc4h29.adm.intelsat.int> wrote:
>Why is it that gettitmeofday fuction returns correct answers when the timeval
>and timezone parameters are passed as addresses rather than as pointe
>variables. i.e getitimeofday(&tp, &tzp) works. where as gettimeofday(tp, tzp)
>where tp and tzp are declared as
> struct timeval *tp; struct timezone *tzp; does not work.
Most likely you forgot to have tp and tzp point to something valid;
e.g.,
tp = malloc( sizeof *tp);
tzp = malloc( sizeof *tzp);
Probably a comp.lang.c question.
Cheers,
Stan.
--
HELP! I'M BEING HELD PRISONER IN A .SIGNATURE FACTORY!
Stan Ryckman sgr@alden.com
Technical Details
Message-ID:
<4560od$l1f@ae-sun01.alden.com>Path:
arc1-ca.pugleaf.net!alden.com!not-for-mailReferences:
<453r0e$d7g@news.intelsat.int>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!alden.com!not-for-mail From: sgr@ae-sun01.alden.com (Stan Ryckman) Newsgroups: comp.std.c Subject: Re: gettimeofday Date: 7 Oct 1995 09:53:17 -0400 Organization: Amber & Sneakers Fan Club Message-ID: <4560od$l1f@ae-sun01.alden.com> References: <453r0e$d7g@news.intelsat.int> NNTP-Posting-Host: ae-sun01.alden.com