root/fs/proc/kmsg.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. kmsg_open
  2. kmsg_release
  3. kmsg_read
  4. kmsg_select

   1 /*
   2  *  linux/fs/proc/kmsg.c
   3  *
   4  *  Copyright (C) 1992  by Linus Torvalds
   5  *
   6  */
   7 
   8 #include <linux/types.h>
   9 #include <linux/errno.h>
  10 #include <linux/sched.h>
  11 #include <linux/kernel.h>
  12 #include <linux/tty.h>
  13 
  14 #include <asm/segment.h>
  15 #include <asm/io.h>
  16 
  17 extern unsigned long log_size;
  18 extern struct wait_queue * log_wait;
  19 
  20 extern int sys_syslog(int type, char * bug, int count);
  21 
  22 static int kmsg_open(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
  23 {
  24         return sys_syslog(1,NULL,0);
  25 }
  26 
  27 static void kmsg_release(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
  28 {
  29         (void) sys_syslog(0,NULL,0);
  30 }
  31 
  32 static int kmsg_read(struct inode * inode, struct file * file,char * buf, int count)
     /* [previous][next][first][last][top][bottom][index][help] */
  33 {
  34         return sys_syslog(2,buf,count);
  35 }
  36 
  37 static int kmsg_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
     /* [previous][next][first][last][top][bottom][index][help] */
  38 {
  39         if (sel_type != SEL_IN)
  40                 return 0;
  41         if (log_size)
  42                 return 1;
  43         select_wait(&log_wait, wait);
  44         return 0;
  45 }
  46 
  47 
  48 static struct file_operations proc_kmsg_operations = {
  49         NULL,           /* kmsg_lseek */
  50         kmsg_read,
  51         NULL,           /* kmsg_write */
  52         NULL,           /* kmsg_readdir */
  53         kmsg_select,    /* kmsg_select */
  54         NULL,           /* kmsg_ioctl */
  55         NULL,           /* mmap */
  56         kmsg_open,
  57         kmsg_release
  58 };
  59 
  60 struct inode_operations proc_kmsg_inode_operations = {
  61         &proc_kmsg_operations,  /* default base directory file-ops */
  62         NULL,                   /* create */
  63         NULL,                   /* lookup */
  64         NULL,                   /* link */
  65         NULL,                   /* unlink */
  66         NULL,                   /* symlink */
  67         NULL,                   /* mkdir */
  68         NULL,                   /* rmdir */
  69         NULL,                   /* mknod */
  70         NULL,                   /* rename */
  71         NULL,                   /* readlink */
  72         NULL,                   /* follow_link */
  73         NULL,                   /* bmap */
  74         NULL,                   /* truncate */
  75         NULL                    /* permission */
  76 };

/* [previous][next][first][last][top][bottom][index][help] */