亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? kmod.c

?? ARM 嵌入式 系統 設計與實例開發 實驗教材 二源碼
?? C
字號:
/*	kmod, the new module loader (replaces kerneld)	Kirk Petersen	Reorganized not to be a daemon by Adam Richter, with guidance	from Greg Zornetzer.	Modified to avoid chroot and file sharing problems.	Mikael Pettersson	Limit the concurrent number of kmod modprobes to catch loops from	"modprobe needs a service that is in a module".	Keith Owens <kaos@ocs.com.au> December 1999	Unblock all signals when we exec a usermode process.	Shuu Yamaguchi <shuu@wondernetworkresources.com> December 2000*/#define __KERNEL_SYSCALLS__#include <linux/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/unistd.h>#include <linux/kmod.h>#include <linux/smp_lock.h>#include <linux/completion.h>#include <asm/uaccess.h>extern int max_threads;static inline voiduse_init_fs_context(void){	struct fs_struct *our_fs, *init_fs;	struct dentry *root, *pwd;	struct vfsmount *rootmnt, *pwdmnt;	/*	 * Make modprobe's fs context be a copy of init's.	 *	 * We cannot use the user's fs context, because it	 * may have a different root than init.	 * Since init was created with CLONE_FS, we can grab	 * its fs context from "init_task".	 *	 * The fs context has to be a copy. If it is shared	 * with init, then any chdir() call in modprobe will	 * also affect init and the other threads sharing	 * init_task's fs context.	 *	 * We created the exec_modprobe thread without CLONE_FS,	 * so we can update the fields in our fs context freely.	 */	init_fs = init_task.fs;	read_lock(&init_fs->lock);	rootmnt = mntget(init_fs->rootmnt);	root = dget(init_fs->root);	pwdmnt = mntget(init_fs->pwdmnt);	pwd = dget(init_fs->pwd);	read_unlock(&init_fs->lock);	/* FIXME - unsafe ->fs access */	our_fs = current->fs;	our_fs->umask = init_fs->umask;	set_fs_root(our_fs, rootmnt, root);	set_fs_pwd(our_fs, pwdmnt, pwd);	write_lock(&our_fs->lock);	if (our_fs->altroot) {		struct vfsmount *mnt = our_fs->altrootmnt;		struct dentry *dentry = our_fs->altroot;		our_fs->altrootmnt = NULL;		our_fs->altroot = NULL;		write_unlock(&our_fs->lock);		dput(dentry);		mntput(mnt);	} else 		write_unlock(&our_fs->lock);	dput(root);	mntput(rootmnt);	dput(pwd);	mntput(pwdmnt);}int exec_usermodehelper(char *program_path, char *argv[], char *envp[]){	int i;	struct task_struct *curtask = current;	curtask->session = 1;	curtask->pgrp = 1;	use_init_fs_context();	/* Prevent parent user process from sending signals to child.	   Otherwise, if the modprobe program does not exist, it might	   be possible to get a user defined signal handler to execute	   as the super user right after the execve fails if you time	   the signal just right.	*/	spin_lock_irq(&curtask->sigmask_lock);	sigemptyset(&curtask->blocked);	flush_signals(curtask);	flush_signal_handlers(curtask);	recalc_sigpending(curtask);	spin_unlock_irq(&curtask->sigmask_lock);	for (i = 0; i < curtask->files->max_fds; i++ ) {		if (curtask->files->fd[i]) close(i);	}	/* Drop the "current user" thing */	{		struct user_struct *user = curtask->user;		curtask->user = INIT_USER;		atomic_inc(&INIT_USER->__count);		atomic_inc(&INIT_USER->processes);		atomic_dec(&user->processes);		free_uid(user);	}	/* Give kmod all effective privileges.. */	curtask->euid = curtask->fsuid = 0;	curtask->egid = curtask->fsgid = 0;	cap_set_full(curtask->cap_effective);	/* Allow execve args to be in kernel space. */	set_fs(KERNEL_DS);	/* Go, go, go... */	if (execve(program_path, argv, envp) < 0)		return -errno;	return 0;}#ifdef CONFIG_KMOD/*	modprobe_path is set via /proc/sys.*/char modprobe_path[256] = "/sbin/modprobe";static int exec_modprobe(void * module_name){	static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };	char *argv[] = { modprobe_path, "-s", "-k", "--", (char*)module_name, NULL };	int ret;	ret = exec_usermodehelper(modprobe_path, argv, envp);	if (ret) {		printk(KERN_ERR		       "kmod: failed to exec %s -s -k %s, errno = %d\n",		       modprobe_path, (char*) module_name, errno);	}	return ret;}/** * request_module - try to load a kernel module * @module_name: Name of module * * Load a module using the user mode module loader. The function returns * zero on success or a negative errno code on failure. Note that a * successful module load does not mean the module did not then unload * and exit on an error of its own. Callers must check that the service * they requested is now available not blindly invoke it. * * If module auto-loading support is disabled then this function * becomes a no-operation. */int request_module(const char * module_name){	pid_t pid;	int waitpid_result;	sigset_t tmpsig;	int i;	static atomic_t kmod_concurrent = ATOMIC_INIT(0);#define MAX_KMOD_CONCURRENT 50	/* Completely arbitrary value - KAO */	static int kmod_loop_msg;	/* Don't allow request_module() before the root fs is mounted!  */	if ( ! current->fs->root ) {		printk(KERN_ERR "request_module[%s]: Root fs not mounted\n",			module_name);		return -EPERM;	}	/* If modprobe needs a service that is in a module, we get a recursive	 * loop.  Limit the number of running kmod threads to max_threads/2 or	 * MAX_KMOD_CONCURRENT, whichever is the smaller.  A cleaner method	 * would be to run the parents of this process, counting how many times	 * kmod was invoked.  That would mean accessing the internals of the	 * process tables to get the command line, proc_pid_cmdline is static	 * and it is not worth changing the proc code just to handle this case. 	 * KAO.	 */	i = max_threads/2;	if (i > MAX_KMOD_CONCURRENT)		i = MAX_KMOD_CONCURRENT;	atomic_inc(&kmod_concurrent);	if (atomic_read(&kmod_concurrent) > i) {		if (kmod_loop_msg++ < 5)			printk(KERN_ERR			       "kmod: runaway modprobe loop assumed and stopped\n");		atomic_dec(&kmod_concurrent);		return -ENOMEM;	}	pid = kernel_thread(exec_modprobe, (void*) module_name, 0);	if (pid < 0) {		printk(KERN_ERR "request_module[%s]: fork failed, errno %d\n", module_name, -pid);		atomic_dec(&kmod_concurrent);		return pid;	}	/* Block everything but SIGKILL/SIGSTOP */	spin_lock_irq(&current->sigmask_lock);	tmpsig = current->blocked;	siginitsetinv(&current->blocked, sigmask(SIGKILL) | sigmask(SIGSTOP));	recalc_sigpending(current);	spin_unlock_irq(&current->sigmask_lock);	waitpid_result = waitpid(pid, NULL, __WCLONE);	atomic_dec(&kmod_concurrent);	/* Allow signals again.. */	spin_lock_irq(&current->sigmask_lock);	current->blocked = tmpsig;	recalc_sigpending(current);	spin_unlock_irq(&current->sigmask_lock);	if (waitpid_result != pid) {		printk(KERN_ERR "request_module[%s]: waitpid(%d,...) failed, errno %d\n",		       module_name, pid, -waitpid_result);	}	return 0;}#endif /* CONFIG_KMOD */#ifdef CONFIG_HOTPLUG/*	hotplug path is set via /proc/sys	invoked by hotplug-aware bus drivers,	with exec_usermodehelper and some thread-spawner	argv [0] = hotplug_path;	argv [1] = "usb", "scsi", "pci", "network", etc;	... plus optional type-specific parameters	argv [n] = 0;	envp [*] = HOME, PATH; optional type-specific parameters	a hotplug bus should invoke this for device add/remove	events.  the command is expected to load drivers when	necessary, and may perform additional system setup.*/char hotplug_path[256] = "/sbin/hotplug";EXPORT_SYMBOL(hotplug_path);#endif /* CONFIG_HOTPLUG */struct subprocess_info {	struct completion *complete;	char *path;	char **argv;	char **envp;	pid_t retval;};/* * This is the task which runs the usermode application */static int ____call_usermodehelper(void *data){	struct subprocess_info *sub_info = data;	int retval;	retval = -EPERM;	if (current->fs->root)		retval = exec_usermodehelper(sub_info->path, sub_info->argv, sub_info->envp);	/* Exec failed? */	sub_info->retval = (pid_t)retval;	do_exit(0);}/* * This is run by keventd. */static void __call_usermodehelper(void *data){	struct subprocess_info *sub_info = data;	pid_t pid;	/*	 * CLONE_VFORK: wait until the usermode helper has execve'd successfully	 * We need the data structures to stay around until that is done.	 */	pid = kernel_thread(____call_usermodehelper, sub_info, CLONE_VFORK | SIGCHLD);	if (pid < 0)		sub_info->retval = pid;	complete(sub_info->complete);}/** * call_usermodehelper - start a usermode application * @path: pathname for the application * @argv: null-terminated argument list * @envp: null-terminated environment list * * Runs a user-space application.  The application is started asynchronously.  It * runs as a child of keventd.  It runs with full root capabilities.  keventd silently * reaps the child when it exits. * * Must be called from process context.  Returns zero on success, else a negative * error code. */int call_usermodehelper(char *path, char **argv, char **envp){	DECLARE_COMPLETION(work);	struct subprocess_info sub_info = {		complete:	&work,		path:		path,		argv:		argv,		envp:		envp,		retval:		0,	};	struct tq_struct tqs = {		routine:	__call_usermodehelper,		data:		&sub_info,	};	if (path[0] == '\0')		goto out;	if (current_is_keventd()) {		/* We can't wait on keventd! */		__call_usermodehelper(&sub_info);	} else {		schedule_task(&tqs);		wait_for_completion(&work);	}out:	return sub_info.retval;}/* * This is for the serialisation of device probe() functions * against device open() functions */static DECLARE_MUTEX(dev_probe_sem);void dev_probe_lock(void){	down(&dev_probe_sem);}void dev_probe_unlock(void){	up(&dev_probe_sem);}EXPORT_SYMBOL(exec_usermodehelper);EXPORT_SYMBOL(call_usermodehelper);#ifdef CONFIG_KMODEXPORT_SYMBOL(request_module);#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡在线视频中文字幕| 亚洲精品成人悠悠色影视| 精品一区免费av| 日韩欧美一卡二卡| 国产河南妇女毛片精品久久久 | 欧美不卡一区二区三区| 久久精品国产精品亚洲红杏| 精品噜噜噜噜久久久久久久久试看| 国产麻豆午夜三级精品| 一区二区中文视频| 欧美日韩一区二区三区不卡| 免费看欧美美女黄的网站| 26uuuu精品一区二区| 丁香婷婷综合激情五月色| 亚洲伦在线观看| 91精品一区二区三区在线观看| 激情深爱一区二区| 亚洲欧洲精品一区二区三区不卡| 欧美三级电影在线看| 加勒比av一区二区| 亚洲欧美一区二区三区极速播放 | 日韩毛片在线免费观看| 欧美在线观看一区| 国产在线视频一区二区| 亚洲视频 欧洲视频| 91精品国产综合久久福利| 国产成人精品综合在线观看| 亚洲午夜一二三区视频| 337p粉嫩大胆色噜噜噜噜亚洲| 色综合激情久久| 久88久久88久久久| 一区二区三区四区av| 亚洲精品一区二区三区精华液| 97久久人人超碰| 免费精品99久久国产综合精品| 国产精品久99| 精品国产91九色蝌蚪| 在线一区二区观看| 国产揄拍国内精品对白| 亚洲午夜精品17c| 中文字幕av一区二区三区高| 91精品国产麻豆国产自产在线 | 日韩女优av电影在线观看| 99久久精品免费看国产| 美腿丝袜在线亚洲一区| 亚洲综合丁香婷婷六月香| 国产目拍亚洲精品99久久精品| 91精品国产乱| 欧美日韩日本视频| 一本大道久久a久久精二百| 国产一区二三区好的| 午夜伦理一区二区| 亚洲一线二线三线久久久| 亚洲国产精品高清| 国产日韩影视精品| 亚洲精品在线观看视频| 欧美精品一卡二卡| 欧美日韩中文一区| 在线精品视频小说1| 99久久99久久精品国产片果冻| 国产精品一区二区三区网站| 日韩av一区二区在线影视| 夜色激情一区二区| 亚洲精品中文字幕乱码三区| 国产精品伦理在线| 国产精品成人午夜| 国产精品天美传媒沈樵| 国产亚洲美州欧州综合国| 欧美成人女星排行榜| 91精品国产综合久久小美女| 欧美人妖巨大在线| 欧美精品三级日韩久久| 6080亚洲精品一区二区| 欧美一区二区三区日韩| 欧美一级黄色大片| 精品日韩在线观看| 国产亚洲欧美在线| 欧美高清在线视频| 中文字幕日本乱码精品影院| 国产精品九色蝌蚪自拍| 亚洲视频免费观看| 亚洲午夜久久久久久久久久久| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲欧美日韩中文字幕一区二区三区 | 免费在线观看成人| 精品一区精品二区高清| 国产麻豆视频精品| 99久久精品国产网站| 欧美视频三区在线播放| 欧美丰满少妇xxxbbb| 日韩精品综合一本久道在线视频| 2欧美一区二区三区在线观看视频| 久久精品一级爱片| 综合久久久久久久| 亚洲国产精品综合小说图片区| 日本不卡一区二区三区| 韩国av一区二区三区在线观看| 国产不卡在线播放| 在线观看视频一区二区| 91精品国产色综合久久不卡电影 | 2023国产精品视频| 1024亚洲合集| 视频一区二区国产| 国产不卡视频在线播放| 色94色欧美sute亚洲13| 欧美一级免费观看| 欧美韩国一区二区| 亚洲一区二区免费视频| 麻豆精品蜜桃视频网站| av电影在线观看不卡| 欧美久久免费观看| 日本一区二区三区国色天香| 亚洲激情五月婷婷| 久久成人av少妇免费| caoporn国产精品| 欧美日韩一区在线| 国产日韩欧美精品电影三级在线 | 久久精品一区八戒影视| 一区二区不卡在线播放| 黑人巨大精品欧美一区| 91麻豆福利精品推荐| 精品国产一区二区精华| 一区二区欧美在线观看| 国产麻豆日韩欧美久久| 欧美日韩国产欧美日美国产精品| ww亚洲ww在线观看国产| 亚洲一区二区三区四区五区黄| 国产成人自拍网| 91精品黄色片免费大全| 亚洲精品一卡二卡| 国产精品18久久久久久久久| 欧美日韩你懂得| 亚洲人成在线观看一区二区| 精品亚洲aⅴ乱码一区二区三区| 91福利在线免费观看| 久久久久久**毛片大全| 日本vs亚洲vs韩国一区三区二区| 成人av午夜影院| 久久久蜜桃精品| 久久国产精品第一页| 欧美三级乱人伦电影| 亚洲桃色在线一区| 成人天堂资源www在线| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 高清不卡在线观看| 日韩欧美国产一区二区在线播放| 一区二区三区在线高清| 成人美女视频在线观看| 国产日韩成人精品| 精品综合免费视频观看| 91麻豆精品91久久久久久清纯| 最新日韩在线视频| 国产不卡视频一区二区三区| 精品999在线播放| 美女脱光内衣内裤视频久久影院| 欧美日韩一区二区三区四区五区| 一区二区三区国产豹纹内裤在线 | 欧美丝袜丝交足nylons| 日韩美女视频19| 91啪在线观看| 亚洲激情欧美激情| 在线日韩国产精品| 一区二区三区四区激情| 欧洲av在线精品| 亚洲午夜一区二区三区| 欧美日韩精品是欧美日韩精品| 亚洲国产综合色| 91麻豆精品国产91久久久使用方法 | 欧美日韩综合色| 天天影视涩香欲综合网| 777欧美精品| 久久精品国产久精国产| 精品成人一区二区三区四区| 国产在线精品视频| 日本一区二区三级电影在线观看| 高清日韩电视剧大全免费| 国产精品亲子乱子伦xxxx裸| 不卡在线观看av| 夜夜嗨av一区二区三区网页| 777奇米四色成人影色区| 奇米精品一区二区三区在线观看一| 日韩精品自拍偷拍| 福利一区二区在线观看| 一区二区中文视频| 欧美日韩极品在线观看一区| 日韩激情av在线| 久久影音资源网| 99久久免费视频.com| 亚洲第一福利一区| 欧美成人vps| 91在线精品一区二区| 亚洲国产日韩在线一区模特| 欧美成人aa大片| 99久久777色| 蜜桃免费网站一区二区三区 | 亚洲欧美日韩中文字幕一区二区三区 | 777午夜精品免费视频| 看国产成人h片视频| 国产亚洲婷婷免费| 欧美色电影在线|