博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
syslog()用法
阅读量:4324 次
发布时间:2019-06-06

本文共 575 字,大约阅读时间需要 1 分钟。

#include 
#include
#include
#include
int main(void) {
int fd; char filename[] = "/root/wenhao"; /* file is not exist */ if ((fd = open(filename, O_RDONLY)) == -1) {
syslog(LOG_ERR | LOG_LOCAL0, "open %s: %m\n", filename); exit(1); } return 0; }

[root@localhost ex15_syslog]# tail -n 1 /var/log/messages

Sep  6 14:17:46 localhost syslog: open /root/wenhao: No such file or directory 

转自:

转载于:https://www.cnblogs.com/hnrainll/archive/2011/09/06/2168701.html

你可能感兴趣的文章
6.11 spring框架
查看>>
Python--eval()函数
查看>>
【转载】Linux下的crontab定时执行任务命令
查看>>
STM32 HAL库的定时器中断回调函数跟串口中断回调函数
查看>>
vs2010找不到ado.net 实体数据模型解决办法
查看>>
(转)深入理解javascript连续赋值表达式
查看>>
用户场景分析
查看>>
MySQL创建数据库及用户
查看>>
Springboot静态页面放在static路径下还是访问不到
查看>>
centos7 重启网卡失败
查看>>
springboot(一)注解
查看>>
07 Mybatis的多表查询1----1对多和多对1
查看>>
debian和ubuntu的sh dash bash
查看>>
java9-8 局部内部类
查看>>
数据库分页
查看>>
Centos6.8源码编译安装PHP7
查看>>
012 debug调试工具的指令
查看>>
慕课网消息的接收与响应3
查看>>
第三十二讲:UML类图(下)
查看>>
linux下更改时区
查看>>