kfifo_to_user_rec

Langue: en

Version: October 2010 (fedora - 01/12/10)

Section: 9 (Appels noyau Linux)

NAME

kfifo_to_user_rec - gets data from the FIFO and write it to user space

SYNOPSIS

__must_check unsigned int kfifo_to_user_rec(struct kfifo * fifo, void __user * to, unsigned int n, unsigned int recsize, unsigned int * total);

ARGUMENTS

fifo

the fifo to be used.

to

where the data must be copied.

n

the size of the destination buffer.

recsize

size of record field

total

pointer where the total number of to copied bytes should stored

DESCRIPTION

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.