[LinuxPPS] select() on /dev/pps

Rodolfo Giometti giometti at enneenne.com
Mon Aug 3 17:20:11 CEST 2015


On Thu, Jul 30, 2015 at 09:39:27AM +0200, Xavier Bestel wrote:
> Hi,
> 
> for an application of mine I would need to be able to wait for
> events on a char device and on a PPS device; on the char device the
> select() call is the obvious candidate, but it doesn't seem to work
> on the PPS device. That is, select() always returns immediately
> telling some data is available, and a PPS_FETCH either returns
> immediately if flags=0 or waits for 1s if flags=PPS_TIME_INVALID;
> 
> That looks wrong to me. IMHO select() should wait for 1s and
> PPS_FETCH should "consume" the data without waiting.
> If it should work, could you tell me where is my code wrong ?

If I well remember the current implementation of the RFC2783 does not
require to use select() to block until the next timestamp is captured
(see section 3.4.3 - New functions: access to PPS timestamps).

Of course you can feel free to modify the current select() behaviour
and propose a patch! :-)

Ciao,

Rodolfo

-- 

HCE Engineering                      e-mail: giometti at hce-engineering.com
GNU/Linux Solutions                          giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Cosino Project - the quick prototyping embedded system - www.cosino.io
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it




More information about the discussions mailing list