gettimeofday(struct timeval *tp) but is in 2.4 gettimeofday(tp,tzp)

gettimeofday(struct timeval *tp) but is in 2.4 gettimeofday(tp,tzp)

Post by Damon W. Atki » Wed, 30 Aug 1995 04:00:00



Solaris 2.4 (have to tryed with 2.3) gives back an error of
two few argumants when using gettimeofday(struct timeval *tp)
when using CC
 
 
 

gettimeofday(struct timeval *tp) but is in 2.4 gettimeofday(tp,tzp)

Post by Guy Harr » Wed, 30 Aug 1995 04:00:00



Quote:>Solaris 2.4 (have to tryed with 2.3) gives back an error of
>two few argumants when using gettimeofday(struct timeval *tp)
>when using CC

The <sys/time.h> header file prototypes it as

        int gettimeofday(struct timeval *, void *);

and requires two arguments.

There's a bit of history behind this.  "gettimeofday()" first appeared
in 4.2BSD; it took two arguments there, a "struct timeval *" and a
"struct timezone *", and, if an argument was non-NULL, it filled in the
structure to which it pointed.  The only way to get time zone
information in 4.2BSD was to get it with "gettimeofday()" (or something
that used "gettimeofday()"; the second argument had to be non-NULL in
calls to get time zone information.

In System V, you get time zone information by calling "tzset()" and
fetching it from various global variables; SVR4 picked up
"gettimeofday()", but changed its calling sequence so that it only took
*one* argument, and didn't give back time zone information.

They prototyped it as

        int gettimeofday(struct timeval *);

rather than

        int gettimeofday(struct timeval *, ...);

which meant that BSDish calls would get compiler errors.

The group working on the "Single UNIX spec" put a bunch of BSDisms into
the spec, to make it easier to port BSDish code to systems implementing
the Single UNIX spec; one such BSDism was the notion of "gettimeofday()"
taking two arguments, although I think the Single UNIX spec says that
one should *ALWAYS* pass a NULL pointer as the second argument, and that
one has no guarantee whatsoever that such an OS will bother to fill in a
"struct timezone" whose address is passed as a second argument.

 
 
 

gettimeofday(struct timeval *tp) but is in 2.4 gettimeofday(tp,tzp)

Post by Gilad Benjamin » Thu, 31 Aug 1995 04:00:00



Quote:>Solaris 2.4 (have to tryed with 2.3) gives back an error of
>two few argumants when using gettimeofday(struct timeval *tp)
>when using CC

The bug is in the man page.

If you check /usr/include/sys/time.h you'll find:
int gettimeofday(struct timeval *, void *) ;

I think the second argument used to be : struct timezone *.

In any case you can just make it NULL, and everything will work fine.

 
 
 

1. 3C507-TP (EtherLink 16 TP) ???

So, has anyone here gotten this card (3C507-TP EtherLink 16 TP) to
work? I tried it on 2.2.7, then upgraded with my 2.2.8 subscription
CD, but still I get:

        Dec 23 21:05:12  /kernel: ie0: unknown board_id: f000
        Dec 23 21:05:12  /kernel: ie0 not found at 0x300

I even tried changing the '0x300' entry to '0x360' as seen in LINT
(without changing the irq entry), but still the device is unknown:

        Dec 23 22:20:19  /kernel: ie0: unknown board_id: f000
        Dec 23 22:20:19  /kernel: ie0 not found at 0x360

The cards are both printed and stamped with the above 3Com
identifiers (3C507-TP / EtherLink 16 TP).

Any suggestions?

It should work, right?

Please Advise.

Barry Masterson

--
   FreeBSD   2.2.8
<---<---<---<---<---<

2. ATI Radeon and 3D Support

3. gettimeofday prototype in /usr/include/sys/time.h on Solaris 2.4

4. Need help with nic ... please

5. gettimeofday Multi-thread, Linux RH7.2, libc2.2.4

6. Linux on an IBM Aptiva?

7. calling value from timeval struct

8. Help: Cirrus Logic cl6420 chipset config

9. incomplete struct/union/enum timeval: ru_utime

10. a question about struct "timeval"

11. How to access seconds field in struct timeval

12. hrtime_t -> struct timeval

13. struct timeval problem