cregit-Linux how code gets into the kernel

Release 4.11 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
Linus Torvalds (pre-git)2589.29%240.00%
Kees 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
Linus Torvalds (pre-git)3090.91%350.00%
Kees 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
Linus Torvalds (pre-git)3150.82%333.33%
Andrew Morton2236.07%111.11%
Kees Cook69.84%333.33%
Mika Kukkonen11.64%111.11%
Andries E. 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
Linus Torvalds (pre-git)3778.72%337.50%
Linus Torvalds612.77%112.50%
Kees Cook36.38%337.50%
Mika 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 Dobriyan24100.00%1100.00%
Total24100.00%1100.00%

fs_initcall(proc_kmsg_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)16461.65%937.50%
Alexey Dobriyan3212.03%14.17%
Andrew Morton228.27%14.17%
Kees Cook186.77%312.50%
Art Haas83.01%14.17%
Linus Torvalds72.63%28.33%
Frédéric Weisbecker51.88%14.17%
Dave Jones31.13%14.17%
Adrian Bunk20.75%14.17%
Mika Kukkonen20.75%14.17%
Andries E. Brouwer10.38%14.17%
Paul Gortmaker10.38%14.17%
Arjan 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.
Created with cregit.