Bug 215745 - O_ASYNC does not work linux timers
Summary: O_ASYNC does not work linux timers
Status: NEW
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: AIO (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Badari Pulavarty
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-26 13:40 UTC by janezz55
Modified: 2022-03-26 13:40 UTC (History)
0 users

See Also:
Kernel Version: 5.16.16-arch1-1
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description janezz55 2022-03-26 13:40:18 UTC
setting the O_ASYNC flag via fcntl() on a linux timer fd will not report an error, but no signals will be sent. I asked a question on SO about it:

https://stackoverflow.com/questions/71619056/linux-timers-with-o-async

and no one seems to know anything. I know that POSIX timers fill this niche (timer_create(), ...) and they work well, but POSIX timers do not conform to linux/unix file-centric tradition (i.e. POSIX timer handles are NOT file descriptors, but linux timer handles are - I believe this is the reason why linux timers were implemented). I am convinced O_ASYNC should be supported with linux timers, or an error should be returned, if the user wants to set the O_ASYNC flag on a linux timer fd via fcntl() (but I'd prefer the former, as I like to see the unix traditions upheld).

As for code:
https://github.com/user1095108/cr/blob/master/loop.hpp

I tried to handle the linux timers just like sockets, setting O_ASYNC and then waiting for signals, but no signals came, so I had to switch to POSIX timers.

Note You need to log in before you can comment on or make changes to this bug.