X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..HEAD:/gen/FreeBSD/time.c?ds=sidebyside diff --git a/gen/FreeBSD/time.c b/gen/FreeBSD/time.c index 4ab4238..d77e38a 100644 --- a/gen/FreeBSD/time.c +++ b/gen/FreeBSD/time.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/time.c,v 1.5 2007/01/09 00:27:55 imp Exp $" #include #include +#include time_t time(t) @@ -42,12 +43,21 @@ time(t) { struct timeval tt; time_t retval; +#ifdef FE_DFL_ENV + fenv_t fenv; +#endif /* FE_DFL_ENV */ +#ifdef FE_DFL_ENV + fegetenv(&fenv); /* 3965505 - need to preserve floating point enviroment */ +#endif /* FE_DFL_ENV */ if (gettimeofday(&tt, (struct timezone *)0) < 0) retval = -1; else retval = tt.tv_sec; if (t != NULL) *t = retval; +#ifdef FE_DFL_ENV + fesetenv(&fenv); +#endif /* FE_DFL_ENV */ return (retval); }