Function report |
Source Code:arch\x86\kernel\apm_32.c |
Create Date:2022-07-28 08:22:28 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:do_read
Proto:static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
Type:ssize_t
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct file * | fp | |
| char __user * | buf | |
| size_t | count | |
| loff_t * | ppos |
| 1469 | If check_apm_user(as, "read") Then Return -EIO |
| 1471 | If count < sizeof(apm_event_t) Then Return -EINVAL |
| 1473 | If queue_empty(as) && f_flags & O_NONBLOCK Then Return -EAGAIN |
| 1477 | When i >= size of event && Not queue_empty(as) cycle |
| 1478 | event = get_queued_event(as) |
| 1479 | If copy_to_user(buf, & event, size of event ) Then |
| 1482 | Return -EFAULT |
| 1485 | Case event == APM_SYS_SUSPEND |
| 1486 | Case event == APM_USER_SUSPEND |
| 1487 | suspends_read++ |
| 1488 | Break |
| 1490 | Case event == Events (results of Get PM Event) |
| 1491 | Case event == APM_USER_STANDBY |
| 1492 | standbys_read++ |
| 1493 | Break |
| 1502 | Return 0 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |