Function report |
Source Code:kernel\printk\printk.c |
Create Date:2022-07-28 10:06:29 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:do_syslog
Proto:int do_syslog(int type, char __user *buf, int len, int source)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
int | type | |
char __user * | buf | |
int | len | |
int | source |
1505 | bool clear = false |
1509 | error = check_syslog_permissions(type, source) |
1514 | Case type == Close the log. Currently a NOP. |
1515 | Break |
1516 | Case type == Open the log. Currently a NOP. |
1517 | Break |
1518 | Case type == Read from the log. |
1521 | If Not len Then Return 0 |
1529 | error = syslog_print(buf, len) |
1530 | Break |
1533 | clear = true |
1536 | Case type == Read all messages remaining in the ring buffer. |
1539 | If Not len Then Return 0 |
1543 | error = syslog_print_all(buf, len, clear) |
1544 | Break |
1546 | Case type == Clear ring buffer. |
1547 | syslog_clear() |
1548 | Break |
1550 | Case type == Disable printk's to console |
1551 | If saved_console_loglevel == default (or last) loglevel Then saved_console_loglevel = console_loglevel |
1554 | Break |
1556 | Case type == Enable printk's to console |
1563 | Case type == Set level of messages printed to console |
1566 | If len < minimum_console_loglevel Then len = minimum_console_loglevel |
1568 | console_loglevel = len |
1571 | Break |
1573 | Case type == Return number of unread characters in the log buffer |
1577 | he next printk record to read by syslog(READ) or /proc/kmsg = dex and sequence number of the first record stored in the buffer |
1578 | syslog_idx = log_first_idx |
1579 | syslog_partial = 0 |
1581 | If source == SYSLOG_FROM_PROC Then |
1588 | Else |
1590 | idx = syslog_idx |
1591 | time = If syslog_partial Then syslog_time Else printk_time |
1602 | error -= syslog_partial |
1604 | logbuf_unlock_irq() |
1605 | Break |
1607 | Case type == Return size of the log buffer |
1608 | error = log_buf_len |
1609 | Break |
1610 | Default |
1615 | Return error |
Name | Describe |
---|---|
SYSCALL_DEFINE3 |
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 |