cregit-Linux how code gets into the kernel

Release 4.10 fs/proc/kmsg.c

Directory: fs/proc
/*
 *  linux/fs/proc/kmsg.c
 *
 *  Copyright (C) 1992  by Linus Torvalds
 *
 */

#include <linux/types.h>
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/fs.h>
#include <linux/syslog.h>

#include <linux/uaccess.h>
#include <asm/io.h>

extern wait_queue_head_t log_wait;


static int kmsg_open(struct inode * inode, struct file * file) { return do_syslog(SYSLOG_ACTION_OPEN, NULL, 0, SYSLOG_FROM_PROC); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git2589.29%240.00%
kees cookkees cook310.71%360.00%
Total28100.00%5100.00%


static int kmsg_release(struct inode * inode, struct file * file) { (void) do_syslog(SYSLOG_ACTION_CLOSE, NULL, 0, SYSLOG_FROM_PROC); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git3090.91%350.00%
kees cookkees cook39.09%350.00%
Total33100.00%6100.00%


static ssize_t kmsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { if ((file->f_flags & O_NONBLOCK) && !do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) return -EAGAIN; return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC); }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git3150.82%333.33%
andrew mortonandrew morton2236.07%111.11%
kees cookkees cook69.84%333.33%
mika kukkonenmika kukkonen11.64%111.11%
andries brouwerandries brouwer11.64%111.11%
Total61100.00%9100.00%


static unsigned int kmsg_poll(struct file *file, poll_table *wait) { poll_wait(file, &log_wait, wait); if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) return POLLIN | POLLRDNORM; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git3778.72%337.50%
linus torvaldslinus torvalds612.77%112.50%
kees cookkees cook36.38%337.50%
mika kukkonenmika kukkonen12.13%112.50%
Total47100.00%8100.00%

static const struct file_operations proc_kmsg_operations = { .read = kmsg_read, .poll = kmsg_poll, .open = kmsg_open, .release = kmsg_release, .llseek = generic_file_llseek, };
static int __init proc_kmsg_init(void) { proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
alexey dobriyanalexey dobriyan24100.00%1100.00%
Total24100.00%1100.00%

fs_initcall(proc_kmsg_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
pre-gitpre-git16461.65%937.50%
alexey dobriyanalexey dobriyan3212.03%14.17%
andrew mortonandrew morton228.27%14.17%
kees cookkees cook186.77%312.50%
art haasart haas83.01%14.17%
linus torvaldslinus torvalds72.63%28.33%
frederic weisbeckerfrederic weisbecker51.88%14.17%
dave jonesdave jones31.13%14.17%
mika kukkonenmika kukkonen20.75%14.17%
adrian bunkadrian bunk20.75%14.17%
paul gortmakerpaul gortmaker10.38%14.17%
andries brouwerandries brouwer10.38%14.17%
arjan van de venarjan van de ven10.38%14.17%
Total266100.00%24100.00%
Directory: fs/proc
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.