Skip to main content.
Navigation:
DENX
>
Training2
>
LddReadAndWrite
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
Training2
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
Training2 Home
Changes
Index
Search
Go
List of pages in Training2
Search
%SECTION0{LddReadAndWrite}% The read and write system calls * read and write data to device * return values: * = count: the requested amount of bytes were read/written * < count: count bytes were read/written (no error!) * = 0: read: EOF, write: unspecified (old: equals EAGAIN) * < 0: error * =stdio= library handles partial reads/writes * carefull with userspace pointers! * could be unmapped in kernel space * could be swapped out * could be invalid! ---++API *read and write file operations:* <verbatim> ssize_t read(struct file *filp, char __user *buff, size_t count, loff_t *f_pos); ssize_t write(struct file *filp, const char __user *buff, size_t count, loff_t *f_pos); </verbatim> *userspace access:* <verbatim> unsigned long copy_to_user(void __user *to, const void *from, unsigned long count); unsigned long copy_from_user(void *to, const void __user *from, unsigned long count); </verbatim>
5.3.4. The open and release methods
1. Denx Training Topics
5.3.6. Non-Blocking IO
Prev
Home
Next