Linux 的 syslog_r?

发布于 2024-07-27 04:53:20 字数 103 浏览 1 评论 0原文

各位,我找不到适用于 Linux 的 syslog() 的可重入版本...有吗? 如果没有,你会怎么做? 显而易见的答案是将日志记录工具移至单独的线程中并序列化对系统日志的访问......

Folks, I can't find the re-entrant version of syslog() for Linux...is there one? And if no, what do you? The obvious answer is to move logging facility into separate thread and serialise access to syslog...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

峩卟喜欢 2024-08-03 04:53:20

根据 POSIX 规范,syslog 函数已经是线程化的安全,因此在 Linux 中实现。 所以 syslog_r 是不必要的 - 如果您需要可重入记录器功能,请使用 syslog。

According to the POSIX specification, the syslog function is already thread-safe, and so implemented in Linux. So syslog_r is unnecessary - use syslog if you need a reentrant logger function.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文