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

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

?? sysctl.c

?? 如果您在研究linux內核
?? C
?? 第 1 頁 / 共 3 頁
字號:
 * The members of the &ctl_table structure are used as follows: * * ctl_name - This is the numeric sysctl value used by sysctl(2). The number *            must be unique within that level of sysctl * * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not *            enter a sysctl file * * data - a pointer to data for use by proc_handler * * maxlen - the maximum size in bytes of the data * * mode - the file permissions for the /proc/sys file, and for sysctl(2) * * child - a pointer to the child sysctl table if this entry is a directory, or *         %NULL. * * proc_handler - the text handler routine (described below) * * strategy - the strategy routine (described below) * * de - for internal use by the sysctl routines * * extra1, extra2 - extra pointers usable by the proc handler routines * * Leaf nodes in the sysctl tree will be represented by a single file * under /proc; non-leaf nodes will be represented by directories. * * sysctl(2) can automatically manage read and write requests through * the sysctl table.  The data and maxlen fields of the ctl_table * struct enable minimal validation of the values being written to be * performed, and the mode field allows minimal authentication. * * More sophisticated management can be enabled by the provision of a * strategy routine with the table entry.  This will be called before * any automatic read or write of the data is performed. * * The strategy routine may return * * < 0 - Error occurred (error is passed to user process) * * 0   - OK - proceed with automatic read or write. * * > 0 - OK - read or write has been done by the strategy routine, so *       return immediately. * * There must be a proc_handler routine for any terminal nodes * mirrored under /proc/sys (non-terminals are handled by a built-in * directory handler).  Several default handlers are available to * cover common cases - * * proc_dostring(), proc_dointvec(), proc_dointvec_jiffies(), * proc_dointvec_minmax(), proc_doulongvec_ms_jiffies_minmax(), * proc_doulongvec_minmax() * * It is the handler's job to read the input buffer from user memory * and process it. The handler should return 0 on success. * * This routine returns %NULL on a failure to register, and a pointer * to the table header on success. */struct ctl_table_header *register_sysctl_table(ctl_table * table, 					       int insert_at_head){	struct ctl_table_header *tmp;	tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL);	if (!tmp)		return NULL;	tmp->ctl_table = table;	INIT_LIST_HEAD(&tmp->ctl_entry);	if (insert_at_head)		list_add(&tmp->ctl_entry, &root_table_header.ctl_entry);	else		list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry);#ifdef CONFIG_PROC_FS	register_proc_table(table, proc_sys_root);#endif	return tmp;}/** * unregister_sysctl_table - unregister a sysctl table heirarchy * @header: the header returned from register_sysctl_table * * Unregisters the sysctl table and all children. proc entries may not * actually be removed until they are no longer used by anyone. */void unregister_sysctl_table(struct ctl_table_header * header){	list_del(&header->ctl_entry);#ifdef CONFIG_PROC_FS	unregister_proc_table(header->ctl_table, proc_sys_root);#endif	kfree(header);}/* * /proc/sys support */#ifdef CONFIG_PROC_FS/* Scan the sysctl entries in table and add them all into /proc */static void register_proc_table(ctl_table * table, struct proc_dir_entry *root){	struct proc_dir_entry *de;	int len;	mode_t mode;		for (; table->ctl_name; table++) {		/* Can't do anything without a proc name. */		if (!table->procname)			continue;		/* Maybe we can't do anything with it... */		if (!table->proc_handler && !table->child) {			printk(KERN_WARNING "SYSCTL: Can't register %s\n",				table->procname);			continue;		}		len = strlen(table->procname);		mode = table->mode;		de = NULL;		if (table->proc_handler)			mode |= S_IFREG;		else {			mode |= S_IFDIR;			for (de = root->subdir; de; de = de->next) {				if (proc_match(len, table->procname, de))					break;			}			/* If the subdir exists already, de is non-NULL */		}		if (!de) {			de = create_proc_entry(table->procname, mode, root);			if (!de)				continue;			de->data = (void *) table;			if (table->proc_handler) {				de->proc_fops = &proc_sys_file_operations;				de->proc_iops = &proc_sys_inode_operations;			}		}		table->de = de;		if (de->mode & S_IFDIR)			register_proc_table(table->child, de);	}}/* * Unregister a /proc sysctl table and any subdirectories. */static void unregister_proc_table(ctl_table * table, struct proc_dir_entry *root){	struct proc_dir_entry *de;	for (; table->ctl_name; table++) {		if (!(de = table->de))			continue;		if (de->mode & S_IFDIR) {			if (!table->child) {				printk (KERN_ALERT "Help - malformed sysctl tree on free\n");				continue;			}			unregister_proc_table(table->child, de);			/* Don't unregister directories which still have entries.. */			if (de->subdir)				continue;		}		/* Don't unregister proc entries that are still being used.. */		if (atomic_read(&de->count))			continue;		table->de = NULL;		remove_proc_entry(table->procname, root);	}}static ssize_t do_rw_proc(int write, struct file * file, char * buf,			  size_t count, loff_t *ppos){	int op;	struct proc_dir_entry *de;	struct ctl_table *table;	size_t res;	ssize_t error;		de = (struct proc_dir_entry*) file->f_dentry->d_inode->u.generic_ip;	if (!de || !de->data)		return -ENOTDIR;	table = (struct ctl_table *) de->data;	if (!table || !table->proc_handler)		return -ENOTDIR;	op = (write ? 002 : 004);	if (ctl_perm(table, op))		return -EPERM;		res = count;	/*	 * FIXME: we need to pass on ppos to the handler.	 */	error = (*table->proc_handler) (table, write, file, buf, &res);	if (error)		return error;	return res;}static ssize_t proc_readsys(struct file * file, char * buf,			    size_t count, loff_t *ppos){	return do_rw_proc(0, file, buf, count, ppos);}static ssize_t proc_writesys(struct file * file, const char * buf,			     size_t count, loff_t *ppos){	return do_rw_proc(1, file, (char *) buf, count, ppos);}static int proc_sys_permission(struct inode *inode, int op){	return test_perm(inode->i_mode, op);}/** * proc_dostring - read a string sysctl * @table: the sysctl table * @write: %TRUE if this is a write to the sysctl file * @filp: the file structure * @buffer: the user buffer * @lenp: the size of the user buffer * * Reads/writes a string from/to the user buffer. If the kernel * buffer provided is not large enough to hold the string, the * string is truncated. The copied string is %NULL-terminated. * If the string is being read by the user process, it is copied * and a newline '\n' is added. It is truncated if the buffer is * not large enough. * * Returns 0 on success. */int proc_dostring(ctl_table *table, int write, struct file *filp,		  void *buffer, size_t *lenp){	size_t len;	char *p, c;		if (!table->data || !table->maxlen || !*lenp ||	    (filp->f_pos && !write)) {		*lenp = 0;		return 0;	}		if (write) {		len = 0;		p = buffer;		while (len < *lenp) {			if(get_user(c, p++))				return -EFAULT;			if (c == 0 || c == '\n')				break;			len++;		}		if (len >= table->maxlen)			len = table->maxlen-1;		if(copy_from_user(table->data, buffer, len))			return -EFAULT;		((char *) table->data)[len] = 0;		filp->f_pos += *lenp;	} else {		len = strlen(table->data);		if (len > table->maxlen)			len = table->maxlen;		if (len > *lenp)			len = *lenp;		if (len)			if(copy_to_user(buffer, table->data, len))				return -EFAULT;		if (len < *lenp) {			if(put_user('\n', ((char *) buffer) + len))				return -EFAULT;			len++;		}		*lenp = len;		filp->f_pos += len;	}	return 0;}/* *	Special case of dostring for the UTS structure. This has locks *	to observe. Should this be in kernel/sys.c ???? */ static int proc_doutsstring(ctl_table *table, int write, struct file *filp,		  void *buffer, size_t *lenp){	int r;	if (!write) {		down_read(&uts_sem);		r=proc_dostring(table,0,filp,buffer,lenp);		up_read(&uts_sem);	} else {		down_write(&uts_sem);		r=proc_dostring(table,1,filp,buffer,lenp);		up_write(&uts_sem);	}	return r;}#define OP_SET	0#define OP_AND	1#define OP_OR	2#define OP_MAX	3#define OP_MIN	4static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,		  void *buffer, size_t *lenp, int conv, int op){	int *i, vleft, first=1, neg, val;	size_t left, len;		#define TMPBUFLEN 20	char buf[TMPBUFLEN], *p;		if (!table->data || !table->maxlen || !*lenp ||	    (filp->f_pos && !write)) {		*lenp = 0;		return 0;	}		i = (int *) table->data;	vleft = table->maxlen / sizeof(int);	left = *lenp;		for (; left && vleft--; i++, first=0) {		if (write) {			while (left) {				char c;				if(get_user(c,(char *) buffer))					return -EFAULT;				if (!isspace(c))					break;				left--;				((char *) buffer)++;			}			if (!left)				break;			neg = 0;			len = left;			if (len > TMPBUFLEN-1)				len = TMPBUFLEN-1;			if(copy_from_user(buf, buffer, len))				return -EFAULT;			buf[len] = 0;			p = buf;			if (*p == '-' && left > 1) {				neg = 1;				left--, p++;			}			if (*p < '0' || *p > '9')				break;			val = simple_strtoul(p, &p, 0) * conv;			len = p-buf;			if ((len < left) && *p && !isspace(*p))				break;			if (neg)				val = -val;			buffer += len;			left -= len;			switch(op) {			case OP_SET:	*i = val; break;			case OP_AND:	*i &= val; break;			case OP_OR:	*i |= val; break;			case OP_MAX:	if(*i < val)						*i = val;					break;			case OP_MIN:	if(*i > val)						*i = val;					break;			}		} else {			p = buf;			if (!first)				*p++ = '\t';			sprintf(p, "%d", (*i) / conv);			len = strlen(buf);			if (len > left)				len = left;			if(copy_to_user(buffer, buf, len))				return -EFAULT;			left -= len;			buffer += len;		}	}	if (!write && !first && left) {		if(put_user('\n', (char *) buffer))			return -EFAULT;		left--, buffer++;	}	if (write) {		p = (char *) buffer;		while (left) {			char c;			if(get_user(c, p++))				return -EFAULT;			if (!isspace(c))				break;			left--;		}	}	if (write && first)		return -EINVAL;	*lenp -= left;	filp->f_pos += *lenp;	return 0;}/** * proc_dointvec - read a vector of integers * @table: the sysctl table * @write: %TRUE if this is a write to the sysctl file * @filp: the file structure * @buffer: the user buffer * @lenp: the size of the user buffer * * Reads/writes up to table->maxlen/sizeof(unsigned int) integer * values from/to the user buffer, treated as an ASCII string.  * * Returns 0 on success. */int proc_dointvec(ctl_table *table, int write, struct file *filp,		     void *buffer, size_t *lenp){    return do_proc_dointvec(table,write,filp,buffer,lenp,1,OP_SET);}/* *	init may raise the set. */ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,			void *buffer, size_t *lenp){	if (!capable(CAP_SYS_MODULE)) {		return -EPERM;	}	return do_proc_dointvec(table,write,filp,buffer,lenp,1,				(current->pid == 1) ? OP_SET : OP_AND);}/** * proc_dointvec_minmax - read a vector of integers with min/max values * @table: the sysctl table * @write: %TRUE if this is a write to the sysctl file * @filp: the file structure * @buffer: the user buffer * @lenp: the size of the user buffer * * Reads/writes up to table->maxlen/sizeof(unsigned int) integer * values from/to the user buffer, treated as an ASCII string. * * This routine will ensure the values are within the range specified by * table->extra1 (min) and table->extra2 (max). * * Returns 0 on success. */int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,		  void *buffer, size_t *lenp){	int *i, *min, *max, vleft, first=1, neg, val;	size_t len, left;	#define TMPBUFLEN 20	char buf[TMPBUFLEN], *p;		if (!table->data || !table->maxlen || !*lenp ||	    (filp->f_pos && !write)) {		*lenp = 0;		return 0;	}		i = (int *) table->data;	min = (int *) table->extra1;	max = (int *) table->extra2;	vleft = table->maxlen / sizeof(int);	left = *lenp;		for (; left && vleft--; i++, first=0) {		if (write) {			while (left) {				char c;				if(get_user(c, (char *) buffer))					return -EFAULT;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产123| 国产精品国产成人国产三级| 成人免费av资源| 日本大胆欧美人术艺术动态| 国产欧美一区二区在线观看| 欧美伦理视频网站| 91丨porny丨最新| 国产传媒日韩欧美成人| 日韩av一区二区在线影视| 亚洲人妖av一区二区| 国产日韩欧美一区二区三区乱码| 在线不卡中文字幕| 欧美色网站导航| 91麻豆蜜桃一区二区三区| 国产69精品久久久久777| 老司机免费视频一区二区| 偷拍一区二区三区| 亚洲影视在线播放| 亚洲另类在线制服丝袜| 国产精品免费人成网站| 国产欧美一区二区三区在线看蜜臀 | 狠狠色丁香久久婷婷综合_中| 一区二区三区四区国产精品| 国产精品久久久久久久久图文区 | 国产麻豆精品theporn| 婷婷成人激情在线网| 夜夜嗨av一区二区三区中文字幕 | 久久国内精品自在自线400部| 丝袜亚洲精品中文字幕一区| 一区二区三区精密机械公司| 亚洲丝袜自拍清纯另类| 中文字幕亚洲区| 中文字幕日韩欧美一区二区三区| 国产精品蜜臀av| 中文字幕亚洲一区二区va在线| 欧美极品另类videosde| 国产欧美日韩在线| 亚洲国产精华液网站w| 亚洲国产精品v| 亚洲欧洲日本在线| 亚洲精品视频一区| 亚洲最大的成人av| 亚洲午夜私人影院| 日日夜夜精品免费视频| 日本伊人午夜精品| 奇米色一区二区| 国产在线精品一区二区| 国产剧情av麻豆香蕉精品| 国产99精品国产| 99视频一区二区| 在线观看国产精品网站| 欧美日韩综合不卡| 日韩免费高清av| 久久久蜜桃精品| 亚洲天堂2016| 亚洲成人免费av| 美女任你摸久久| 成人午夜电影网站| 色偷偷久久人人79超碰人人澡| 欧美日韩一二三区| 日韩视频中午一区| 亚洲国产精品99久久久久久久久| 亚洲欧美另类图片小说| 日韩国产欧美一区二区三区| 国产精品综合二区| 91免费国产视频网站| 91精品一区二区三区在线观看| 欧美精品一区男女天堂| 亚洲欧洲性图库| 日韩av在线播放中文字幕| 国产白丝网站精品污在线入口| 色伊人久久综合中文字幕| 欧美乱妇一区二区三区不卡视频| 2017欧美狠狠色| 一区二区三国产精华液| 美国三级日本三级久久99| 大白屁股一区二区视频| 欧美性大战久久久久久久| 日韩精品在线一区| 亚洲美女视频一区| 国模冰冰炮一区二区| 在线影视一区二区三区| 精品免费国产二区三区| 一区二区国产视频| 国产剧情一区二区| 717成人午夜免费福利电影| 亚洲国产成人在线| 奇米色一区二区三区四区| 99re这里只有精品视频首页| 欧美一级欧美三级| 综合网在线视频| 国内久久精品视频| 欧美日韩三级在线| √…a在线天堂一区| 久久av资源网| 欧美日韩久久不卡| 亚洲天堂免费看| 国产老妇另类xxxxx| 91精品国产手机| 一区二区三区欧美在线观看| 国产成人在线视频网站| 日韩情涩欧美日韩视频| 一区二区三区蜜桃| 粉嫩aⅴ一区二区三区四区五区| 日韩一区二区中文字幕| 亚洲国产一区二区视频| av日韩在线网站| 国产日韩精品一区二区三区| 视频在线观看国产精品| 色素色在线综合| 中文字幕第一区| 国产乱淫av一区二区三区| 日韩精品一区在线| 青娱乐精品视频在线| 在线观看一区不卡| 亚洲丝袜精品丝袜在线| 成人毛片老司机大片| 久久久五月婷婷| 国产一区二区精品久久91| 精品久久久久99| 久久爱www久久做| 欧美成人性战久久| 久久超碰97中文字幕| 日韩三级在线免费观看| 日韩和欧美一区二区三区| 欧美日韩在线播放一区| 亚洲高清三级视频| 欧美三级日韩在线| 亚洲成av人**亚洲成av**| 91久久香蕉国产日韩欧美9色| 一色屋精品亚洲香蕉网站| 99九九99九九九视频精品| 国产精品乱码一区二区三区软件| 国产高清久久久| 国产精品久久久久毛片软件| aaa欧美色吧激情视频| 1区2区3区精品视频| 色婷婷精品久久二区二区蜜臀av| 亚洲精品中文在线观看| 欧美日韩中字一区| 青青草伊人久久| 精品入口麻豆88视频| 国产一区二区三区四区五区入口 | 欧美日韩电影在线| 日韩国产精品久久久久久亚洲| 欧美一区二区视频网站| 青青草97国产精品免费观看无弹窗版| 欧美精品第1页| 久久精品久久久精品美女| 久久亚洲二区三区| av午夜一区麻豆| 亚洲一区二区精品3399| 欧美一区二区免费视频| 久久激五月天综合精品| 国产亚洲欧美一区在线观看| 成人av高清在线| 亚洲国产精品综合小说图片区| 69堂亚洲精品首页| 国产精品夜夜爽| 亚洲精品成人精品456| 欧美另类久久久品| 国产精品一区二区在线看| 日韩一区日韩二区| 欧美精品三级日韩久久| 国产精选一区二区三区| 亚洲欧美电影一区二区| 欧美一卡二卡在线| 国产成人久久精品77777最新版本| 亚洲欧美国产毛片在线| 日韩一区二区精品葵司在线 | 大白屁股一区二区视频| 亚洲自拍偷拍综合| 精品国产免费视频| 91免费在线播放| 蜜臀久久99精品久久久画质超高清 | 91视频在线看| 日精品一区二区| 日本一区二区不卡视频| 欧美卡1卡2卡| 国产大陆亚洲精品国产| 午夜久久久久久电影| 久久精品人人做| 欧美日本在线播放| 成人午夜视频在线| 日本不卡免费在线视频| 国产精品狼人久久影院观看方式| 9191久久久久久久久久久| 成人av在线看| 久久99精品国产91久久来源| 亚洲三级视频在线观看| 欧美v日韩v国产v| 欧美优质美女网站| 成人h动漫精品一区二| 日本麻豆一区二区三区视频| 中文字幕佐山爱一区二区免费| 欧美大片顶级少妇| 欧美日韩一区二区三区在线看| 国产成人精品一区二 | 色哟哟欧美精品| 国产传媒一区在线|