linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Kevin Rowland <kevin.p.rowland@gmail.com>
Cc: linux-rtc@vger.kernel.org
Subject: Re: rtc: userspace alarmtimer via posix-timers or timerfd
Date: Fri, 15 Jul 2022 15:35:47 +0200	[thread overview]
Message-ID: <YtFtMzpFQPxnEbHw@mail.local> (raw)
In-Reply-To: <CAHK3GzwVbWBi8OYOmdnDq7nOxwp45qpSFU4UT+wK0=UVUNyQsw@mail.gmail.com>

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

      reply	other threads:[~2022-07-15 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  0:48 rtc: userspace alarmtimer via posix-timers or timerfd Kevin Rowland
2022-07-15 13:35 ` Alexandre Belloni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YtFtMzpFQPxnEbHw@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=kevin.p.rowland@gmail.com \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).