lkml.org 
[lkml]   [2006]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [HW_RNG] How to use generic rng in kernel space
From
Date
Ar Maw, 2006-08-01 am 12:09 +0000, ysgrifennodd moreau francis:
> Another question about the implementation. If O_NONBLOCK
> flag is passed when opening /dev/hw_random, how does the
> read method ensure that the caller won't sleep since it calls
> mutex_lock_interruptible() function unconditiannaly ? I must
> miss something but don't know what...

O_NONBLOCK doesn't necessarily imply "never sleep", it implies "don't
sleep waiting for an event/long time". So where the mutex is just
serializing access to hardware that will be very brief it is fine not to
check O_NONBLOCK/FNDELAY.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-01 15:13    [W:0.253 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site