mailing list of musl libc
 help / color / mirror / code / Atom feed
4651dacbdf181b936ecb3eedb7f11290b14a1f49 blob 917 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
#include "time32.h"
#include <time.h>
#include <sys/time.h>

int __setitimer_time32(int which, const struct itimerval32 *restrict new32, struct itimerval32 *restrict old32)
{
	struct itimerval old;
	int r = setitimer(which, (&(struct itimerval){
		.it_interval.tv_sec = new32->it_interval.tv_sec,
		.it_interval.tv_usec = new32->it_interval.tv_usec,
		.it_value.tv_sec = new32->it_value.tv_sec,
		.it_value.tv_usec = new32->it_value.tv_usec}), &old);
	if (r) return r;
	/* The above call has already committed to success by changing the
	 * timer setting, so we can't fail on out-of-range old value.
	 * Since these are relative times, values large enough to overflow
	 * don't make sense anyway. */
	old32->it_interval.tv_sec = old.it_interval.tv_sec;
	old32->it_interval.tv_usec = old.it_interval.tv_usec;
	old32->it_value.tv_sec = old.it_value.tv_sec;
	old32->it_value.tv_usec = old.it_value.tv_usec;
	return 0;
}
debug log:

solving 4651dacb ...
found 4651dacb in https://git.vuxu.org/mirror/musl/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).