2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: showTime.c,v 1.1 1998/04/10 10:54:53 simonm Exp $
6 * ClockTime.showsPrec Runtime Support
12 #if TIME_WITH_SYS_TIME
13 # include <sys/time.h>
17 # include <sys/time.h>
24 showTime(I_ size, StgByteArray d, StgByteArray buf)
31 return (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: out of range");
36 t = - (time_t) ((StgInt *)d)[0];
39 (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: out of range");
42 t = (time_t) ((StgInt *)d)[0];
44 return (StgAddr) strcpy(buf, "ClockTime.show{LibTime}: out of range");
48 if (tm != NULL && strftime(buf, 32 /*Magic number*/, "%a %b %d %T %Z %Y", tm) > 0)
50 return (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: internal error");