47#include <sys/ttycom.h>
48#include <sys/msgbuf.h>
49#include <sys/signalvar.h>
50#include <sys/kernel.h>
52#include <sys/filedesc.h>
53#include <sys/sysctl.h>
55#define LOG_RDPRI (PZERO + 1)
69 .d_version = D_VERSION,
104 "How often (times per second) to check for /dev/log waiters.");
112 printf(
"syslog wakeup is less than one. Adjusting to 1.\n");
156 if (
flag & IO_NDELAY) {
158 return (EWOULDBLOCK);
166 while (uio->uio_resid > 0) {
167 l = imin(
sizeof(
buf), uio->uio_resid);
173 if (error || uio->uio_resid == 0)
183logpoll(
struct cdev *dev,
int events,
struct thread *td)
187 if (events & (POLLIN | POLLRDNORM)) {
190 revents |= events & (POLLIN | POLLRDNORM);
202 if (kn->kn_filter != EVFILT_READ)
220 return (kn->kn_data != 0);
248 printf(
"syslog wakeup is less than one. Adjusting to 1.\n");
308 GID_WHEEL, 0600,
"klog");
void cv_init(struct cv *cvp, const char *desc)
void cv_broadcastpri(struct cv *cvp, int pri)
struct cdev * make_dev_credf(int flags, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt,...)
int fsetown(pid_t pgid, struct sigio **sigiop)
void funsetown(struct sigio **sigiop)
pid_t fgetown(struct sigio **sigiop)
void knlist_remove(struct knlist *knl, struct knote *kn, int islocked)
void knlist_add(struct knlist *knl, struct knote *kn, int islocked)
void knote(struct knlist *list, long hint, int lockflags)
void knlist_init_mtx(struct knlist *knl, struct mtx *lock)
void pgsigio(struct sigio **sigiop, int sig, int checkctty)
struct callout sc_callout
static int log_wakeups_per_second
SYSCTL_INT(_kern, OID_AUTO, log_wakeups_per_second, CTLFLAG_RW, &log_wakeups_per_second, 0, "How often (times per second) to check for /dev/log waiters.")
SYSINIT(logdev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, log_drvinit, NULL)
static d_close_t logclose
static struct cv log_wakeup
static void logkqdetach(struct knote *note)
static int logkqread(struct knote *note, long hint)
static void logtimeout(void *arg)
static d_ioctl_t logioctl
MTX_SYSINIT(msgbuf_lock, &msgbuf_lock, "msgbuf lock", MTX_DEF)
static struct logsoftc logsoftc
static struct filterops log_read_filterops
static void log_drvinit(void *unused)
static d_kqfilter_t logkqfilter
static struct cdevsw log_cdevsw
int msgbuf_getcount(struct msgbuf *mbp)
int msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen)
int printf(const char *fmt,...)
int uiomove(void *cp, int n, struct uio *uio)
void selwakeuppri(struct selinfo *sip, int pri)
void selrecord(struct thread *selector, struct selinfo *sip)