linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rtc: userspace alarmtimer via posix-timers or timerfd
@ 2022-07-12  0:48 Kevin Rowland
  2022-07-15 13:35 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Rowland @ 2022-07-12  0:48 UTC (permalink / raw)
  To: linux-rtc

Hello,

I'm curious if there's some mechanism in the kernel to bridge POSIX
timers (or the timerfd subsystem) and the alarmtimer feature.

The intent is to give userspace the ability to set timers that
(optionally) result in the system waking from suspend via RTC alarm.

I was thinking about hacking together something myself in
`kernel/time/posix-timers.c`, but then found `alarmtimer.c` which, as
far as I can tell, is exposed only to the rest of the kernel.

Any pointers welcome.

Best,
Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rtc: userspace alarmtimer via posix-timers or timerfd
  2022-07-12  0:48 rtc: userspace alarmtimer via posix-timers or timerfd Kevin Rowland
@ 2022-07-15 13:35 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-07-15 13:35 UTC (permalink / raw)
  To: Kevin Rowland; +Cc: linux-rtc

On 11/07/2022 17:48:49-0700, Kevin Rowland wrote:
> Hello,
> 
> I'm curious if there's some mechanism in the kernel to bridge POSIX
> timers (or the timerfd subsystem) and the alarmtimer feature.
> The intent is to give userspace the ability to set timers that
> (optionally) result in the system waking from suspend via RTC alarm.
> 
> I was thinking about hacking together something myself in
> `kernel/time/posix-timers.c`, but then found `alarmtimer.c` which, as
> far as I can tell, is exposed only to the rest of the kernel.
> 
> Any pointers welcome.
> 

alarmtimers are POSIX timers, see https://lwn.net/Articles/429925/

Simply use the CLOCK_REALTIME_ALARM clockid

> Best,
> Kevin

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-15 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12  0:48 rtc: userspace alarmtimer via posix-timers or timerfd Kevin Rowland
2022-07-15 13:35 ` Alexandre Belloni

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).