* @brief Sends a log message to the system log. * * This system call sends a message to the system log for recording or debugging purposes. * * @param[in] type The type of the log message, typically representing the severity * or category (e.g., debug, info, warning, error). This should be * a valid predefined log type. * @param[in] buf A pointer to a bu
| 2535 | * @warning Sending excessively large or frequent log messages may impact system performance. |
| 2536 | */ |
| 2537 | sysret_t sys_syslog(int type, char *buf, int len) |
| 2538 | { |
| 2539 | char *tmp; |
| 2540 | int ret = -1; |
| 2541 | |
| 2542 | if (!lwp_user_accessable((void *)buf, len)) |
| 2543 | { |
| 2544 | return -EFAULT; |
| 2545 | } |
| 2546 | |
| 2547 | tmp = (char *)rt_malloc(len); |
| 2548 | if (!tmp) |
| 2549 | { |
| 2550 | return -ENOMEM; |
| 2551 | } |
| 2552 | |
| 2553 | ret = syslog_ctrl(type, tmp, len); |
| 2554 | lwp_put_to_user(buf, tmp, len); |
| 2555 | rt_free(tmp); |
| 2556 | |
| 2557 | return ret; |
| 2558 | } |
| 2559 | |
| 2560 | /** |
| 2561 | * @brief Creates a message queue. |
nothing calls this directly
no test coverage detected