kfifo_to_user_rec — gets data from the FIFO and write it to user space
__must_check unsigned int kfifo_to_user_rec ( | struct kfifo * fifo, |
| void __user * to, | |
| unsigned int n, | |
| unsigned int recsize, | |
unsigned int * total); |
fifothe fifo to be used.
towhere the data must be copied.
nthe size of the destination buffer.
recsizesize of record field
totalpointer where the total number of to copied bytes should stored
This function copies at most n bytes from the FIFO to the to.
In case of an error, the function returns the number of bytes which cannot
be copied.
If the returned value is equal or less the n value, the copy_to_user
functions has failed. Otherwise the record doesn't fit into the to buffer.
Note that with only one concurrent reader and one concurrent writer, you don't need extra locking to use these functions.