home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * linux.c -- device dependent stuff for Linux GCC
- *
- * (c) 1993, 1994 by Han Wen Nienhuys <hanwen@stack.urc.tue.nl>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <signal.h>
-
- #include "ray.h"
- #include "proto.h"
- #include "extern.h"
-
- /* check for an abort condition, such as keypress */
- PUBLIC void
- check_abort(void)
- {
- return;
- }
-
- PRIVATE clock_t ts;
-
- /* start the timer. Using clock ticks isn't exactly elegant, but it works */
- PUBLIC void
- timer_start(void)
- {
- ts = clock();
- }
-
- /*
- * stop the timer, and return the number of seconds from last call to
- * timer_start() in 10ths of secs.
- */
- PUBLIC long
- timer_stop(void)
- {
- clock_t st;
-
- st = clock();
- return (long) ((10 * (st - ts)) / CLOCKS_PER_SEC);
- }
-
- PUBLIC void
- init_machine(void)
- {
- /* ignore floating point errors */
- signal(SIGFPE, SIG_IGN);
- signal(SIGINT, abort_trace);
-
- if (silent_mode)
- signal(SIGHUP, SIG_IGN);
-
- return;
- }
-