Article View: gnu.ghostscript.bug
Article #180patches for gs 2.4.1 for SysVr2
From: Andy Fyfe
Date: Tue, 04 Aug 1992 05:19
Date: Tue, 04 Aug 1992 05:19
80 lines
3270 bytes
3270 bytes
I compiled gs for my AT&T 3b1. I doesn't have X, so I deleted the
references to the X device from the Makefile. I picked pbm, pbmraw
dfaxhigh and dfaxlow as the devices compiled in.
I found a couple of problems. The 3b1 has no gettimeofday. Thus I
modified the routine that returns the time to simple use time() and
ignore the milliseconds (the 3b1 isn't fast enough for this to be a
problem!). The stat structure does not have a blocksize, so I made
a change for that. Diffs for these are enclosed. The only other
thing is there is no rename() function. I have a library with a few
miscellaneous routines in it one of which is rename, so I didn't
modify gs itself for this one. A simple link/unlink would probably
suffice.
Andy Fyfe andy@cs.caltech.edu
diff -u2 gs241/gp_unix.c /usr/tmp/andy/gs241/gp_unix.c
--- gs241/gp_unix.c Tue Apr 7 22:21:34 1992
+++ /usr/tmp/andy/gs241/gp_unix.c Thu Jul 30 19:50:40 1992
@@ -50,9 +50,15 @@
gp_get_clock(long *pdt)
{ long secs_since_1980;
+#if !defined(__SVR2)
struct timeval tp;
struct timezone tzp;
+#else
+ time_t secs_since_1970;
+ extern long timezone;
+#endif
time_t tsec;
struct tm *tm, *localtime();
+#if !defined(__SVR2)
if ( gettimeofday(&tp, &tzp) == -1 )
{ perror("Ghostscript: gettimeofday failed:");
@@ -72,4 +78,11 @@
tsec = tp.tv_sec;
tm = localtime(&tsec);
+#else
+ time(&secs_since_1970);
+ secs_since_1980 = secs_since_1970 - (long)(60 * 60 * 24 * 365.25 * 10);
+ tsec = secs_since_1970;
+ tm = localtime(&tsec);
+ secs_since_1980 -= timezone;
+#endif
if ( tm->tm_isdst )
secs_since_1980 += (60 * 60);
@@ -78,5 +91,9 @@
pdt[0] = secs_since_1980 / (60 * 60 * 24);
/* modulo + microsecs/1000 gives number of millisecs since midnight */
+#if !defined(__SVR2)
pdt[1] = (secs_since_1980 % (60 * 60 * 24)) * 1000 + tp.tv_usec / 1000;
+#else
+ pdt[1] = (secs_since_1980 % (60 * 60 * 24)) * 1000;
+#endif
#ifdef DEBUG_CLOCK
printf("tp.tv_sec = %d tp.tv_usec = %d pdt[0] = %ld pdt[1] = %ld\n",
diff -u2 gs241/stat_.h /usr/tmp/andy/gs241/stat_.h
--- gs241/stat_.h Wed Dec 11 00:41:14 1991
+++ /usr/tmp/andy/gs241/stat_.h Thu Jul 30 15:22:44 1992
@@ -23,5 +23,5 @@
/* System V doesn't define the st_blocks member of a stat structure. */
-#if defined(__SVR3)
+#if defined(__SVR3) || defined(__SVR2)
# define stat_blocks(psbuf) (((psbuf)->st_size + 1023) >> 1)
#else
diff -u2 gs241/time_.h /usr/tmp/andy/gs241/time_.h
--- gs241/time_.h Tue Mar 24 00:16:20 1992
+++ /usr/tmp/andy/gs241/time_.h Thu Jul 30 15:26:06 1992
@@ -21,5 +21,8 @@
/* Generic substitute for Unix sys/time.h */
-#include <sys/time.h>
+#if !defined(__SVR2)
+#include "sys/time.h"
+#endif
+
#if defined(_IBMR2) || defined(SYSV) || defined(SVR4) /* IBM RS/6000, AIX 3.n, System V.4 */
# include <time.h>
Technical Details
Message-ID:
<9208040519.AA00685@kodiak.cs.caltech.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!scp.caltech.edu!andyShow Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!scp.caltech.edu!andy From: andy@scp.caltech.edu (Andy Fyfe) Subject: patches for gs 2.4.1 for SysVr2 Message-ID: <9208040519.AA00685@kodiak.cs.caltech.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Tue, 4 Aug 1992 05:19:19 GMT Approved: bug-ghostscript@prep.ai.mit.edu Lines: 81