3b1 shared library problems

Rahul Dhesi dhesi at bsu-cs.UUCP
Fri Apr 15 02:52:56 AEST 1988


In article <103 at dms3b1.UUCP> dave at dms3b1.UUCP (Dave Hanna) writes:
>The problem is that, when linking the shared libraries,
>the symbol "daylight", which, according to the manual  CTIME(3C) is
>an external int defined in  ctime, is not defined in the shared 
>library ifile. 

I've seen patches to shlib.i (or a similarly-named file), but my fix
was to use code that doesn't use "daylight" at all but can still find
out timezone.  The following is from the zoo source code.  The
tm->tm_isdst field tells you if daylight savings time is in effect.

extern long timezone;   /* defined by library routine */
long time ();
struct tm *localtime ();

/* Function gettz(), returns the offset from GMT in seconds of the
local time, taking into account daylight savings time */
long gettz()
{
   struct tm *tm;
   long clock;
   clock = time ((long *) 0);
   tm = localtime (&clock);
   return (timezone - tm->tm_isdst*3600);
}
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!dhesi



More information about the Comp.sys.att mailing list