diff options
| author | Paul Eggert | 2022-08-01 00:38:32 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-08-01 01:17:13 -0700 |
| commit | e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1 (patch) | |
| tree | 6b134a3a3135215f48bc15e69670ab6b67471132 /src | |
| parent | 9d4633e934da77bc1c3617a9450ee17151f35271 (diff) | |
| download | emacs-e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1.tar.gz emacs-e3b6242938fa9bcc3aebaa0eddd6aa561136dbf1.zip | |
Fix get-internal-runtime precision
* src/sysdep.c (make_lisp_s_us): Also define if HAVE_GETRUSAGE.
(Fget_internal_run_time): Don’t generate more precision than the
underlying primitives.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index c1545622dfc..efd9638b07a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -3169,7 +3169,8 @@ list_system_processes (void) | |||
| 3169 | 3169 | ||
| 3170 | #endif /* !defined (WINDOWSNT) */ | 3170 | #endif /* !defined (WINDOWSNT) */ |
| 3171 | 3171 | ||
| 3172 | #if defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__ | 3172 | #if (HAVE_GETRUSAGE \ |
| 3173 | || defined __FreeBSD__ || defined DARWIN_OS || defined __OpenBSD__) | ||
| 3173 | 3174 | ||
| 3174 | static Lisp_Object | 3175 | static Lisp_Object |
| 3175 | make_lisp_s_us (time_t s, long us) | 3176 | make_lisp_s_us (time_t s, long us) |
| @@ -4276,7 +4277,7 @@ does the same thing as `current-time'. */) | |||
| 4276 | usecs -= 1000000; | 4277 | usecs -= 1000000; |
| 4277 | secs++; | 4278 | secs++; |
| 4278 | } | 4279 | } |
| 4279 | return make_lisp_time (make_timespec (secs, usecs * 1000)); | 4280 | return make_lisp_s_us (secs, usecs); |
| 4280 | #else /* ! HAVE_GETRUSAGE */ | 4281 | #else /* ! HAVE_GETRUSAGE */ |
| 4281 | #ifdef WINDOWSNT | 4282 | #ifdef WINDOWSNT |
| 4282 | return w32_get_internal_run_time (); | 4283 | return w32_get_internal_run_time (); |