1/*- 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 20 unchanged lines hidden (view full) --- 29 * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 30 */ 31 32/* 33 * Error log buffer for kernel printf's. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/kern/subr_log.c 142709 2005-02-27 22:02:03Z phk $"); |
38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/conf.h> 42#include <sys/proc.h> 43#include <sys/vnode.h> 44#include <sys/filio.h> 45#include <sys/ttycom.h> --- 12 unchanged lines hidden (view full) --- 58static d_open_t logopen; 59static d_close_t logclose; 60static d_read_t logread; 61static d_ioctl_t logioctl; 62static d_poll_t logpoll; 63 64static void logtimeout(void *arg); 65 |
66static struct cdevsw log_cdevsw = { 67 .d_version = D_VERSION, 68 .d_flags = D_NEEDGIANT, 69 .d_open = logopen, 70 .d_close = logclose, 71 .d_read = logread, 72 .d_ioctl = logioctl, 73 .d_poll = logpoll, 74 .d_name = "log", |
75}; 76 77static struct logsoftc { 78 int sc_state; /* see above for possibilities */ 79 struct selinfo sc_selp; /* process waiting on select call */ 80 struct sigio *sc_sigio; /* information for async I/O */ 81 struct callout sc_callout; /* callout to wakeup syslog */ 82} logsoftc; --- 162 unchanged lines hidden (view full) --- 245 246static void 247log_drvinit(void *unused) 248{ 249 250 make_dev(&log_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "klog"); 251} 252 |
253SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,log_drvinit,NULL) |