[omniORB] ftime()

Frédéric Prin frederic.prin@silvaco.com
Fri, 26 Oct 2001 17:00:07 +0200


The first version should crash too !

you have to allocate your tp variable else ftime would write data on a piece
of memory not allocated :

/* just suppress the * and add & at ftime call */
struct timeb tp;

ftime(&tp);

Hope it helps

| Frédéric Prin - Senior software engineer
| Tel 04 56 38 10 33
| S I L V A C O    G . R E . C E

----- Original Message -----
From: <Francesco.Chicchiricco@nokia.com>
To: <omniorb-list@uk.research.att.com>
Sent: Friday, October 26, 2001 2:58 PM
Subject: [omniORB] ftime()


> Hello,
> is there anyone who knows why this piece of code works greatly:
>
> #include <sys/timeb.h>
>
> struct timeb *tp;
>
> ftime(tp);
>
> and this ends with a beautiful segmentation fault:
>
> #include <sys/timeb.h>
>
> CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4"); // or
> omniORB3, it's the same
>   struct timeb *tp;
>
> ftime(tp);
>
> Please let me know. BR.
>
> ##############################################
>              Per aspera ad sidera
> ##############################################
>