ualarm.c\unistd\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/unistd/ualarm.c
blob: 2985855c72afd3e4b88fca07a1179634b1bf1af6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/time.h>
unsigned ualarm(unsigned value, unsigned interval)
{
	struct itimerval it = {
		.it_interval.tv_usec = interval,
		.it_value.tv_usec = value
	}, it_old;
	setitimer(ITIMER_REAL, &it, &it_old);
	return it_old.it_value.tv_sec*1000000 + it_old.it_value.tv_usec;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月06日 19:29:29 +0000

AltStyle によって変換されたページ (->オリジナル) /