예제 #1
0
static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	size_t lenp_bef = *lenp;
	int oldval;
	int rc;

	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);
	oldval = *((int *)(ipc_table.data));

	rc = proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);

	if (write && !rc && lenp_bef == *lenp) {
		int newval = *((int *)(ipc_table.data));
		/*
                                                   
                                                               
                       
   */
		if (newval != oldval)
			ipc_auto_callback(newval);
	}

	return rc;
}
예제 #2
0
static int proc_ipcauto_dointvec_minmax(struct ctl_table *table, int write,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	size_t lenp_bef = *lenp;
	int oldval;
	int rc;

	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);
	oldval = *((int *)(ipc_table.data));

	rc = proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);

	if (write && !rc && lenp_bef == *lenp) {
		int newval = *((int *)(ipc_table.data));
		/*
		 * The file "auto_msgmni" has correctly been set.
		 * React by (un)registering the corresponding tunable, if the
		 * value has changed.
		 */
		if (newval != oldval)
			ipc_auto_callback(newval);
	}

	return rc;
}
static int proc_ipc_dointvec(ctl_table *table, int write, struct file *filp,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);

	return proc_dointvec(&ipc_table, write, filp, buffer, lenp, ppos);
}
예제 #4
0
static int proc_ipc_doulongvec_minmax(ctl_table *table, int write,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);

	return proc_doulongvec_minmax(&ipc_table, write, buffer,
					lenp, ppos);
}
예제 #5
0
파일: ipc_sysctl.c 프로젝트: 274914765/C
static int proc_ipc_callback_dointvec(ctl_table *table, int write,
    struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos)
{
    struct ctl_table ipc_table;
    size_t lenp_bef = *lenp;
    int rc;

    memcpy(&ipc_table, table, sizeof(ipc_table));
    ipc_table.data = get_ipc(table);

    rc = proc_dointvec(&ipc_table, write, filp, buffer, lenp, ppos);

    if (write && !rc && lenp_bef == *lenp)
        tunable_set_callback(*((int *)(ipc_table.data)));

    return rc;
}
예제 #6
0
파일: ipc_sysctl.c 프로젝트: 274914765/C
static int sysctl_ipc_registered_data(ctl_table *table, int __user *name,
        int nlen, void __user *oldval, size_t __user *oldlenp,
        void __user *newval, size_t newlen)
{
    int rc;

    rc = sysctl_ipc_data(table, name, nlen, oldval, oldlenp, newval,
        newlen);

    if (newval && newlen && rc > 0) {
        /*
         * Tunable has successfully been changed from userland
         */
        int *data = get_ipc(table);

        tunable_set_callback(*data);
    }

    return rc;
}
예제 #7
0
static int proc_ipc_callback_dointvec(ctl_table *table, int write,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	size_t lenp_bef = *lenp;
	int rc;

	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);

	rc = proc_dointvec(&ipc_table, write, buffer, lenp, ppos);

	if (write && !rc && lenp_bef == *lenp)
		/*
                                                               
                                                             
                                              
   */
		unregister_ipcns_notifier(current->nsproxy->ipc_ns);

	return rc;
}
예제 #8
0
static int proc_ipc_callback_dointvec_minmax(struct ctl_table *table, int write,
	void __user *buffer, size_t *lenp, loff_t *ppos)
{
	struct ctl_table ipc_table;
	size_t lenp_bef = *lenp;
	int rc;

	memcpy(&ipc_table, table, sizeof(ipc_table));
	ipc_table.data = get_ipc(table);

	rc = proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);

	if (write && !rc && lenp_bef == *lenp)
		/*
		 * Tunable has successfully been changed by hand. Disable its
		 * automatic adjustment. This simply requires unregistering
		 * the notifiers that trigger recalculation.
		 */
		unregister_ipcns_notifier(current->nsproxy->ipc_ns);

	return rc;
}
/* The generic sysctl ipc data routine. */
static int sysctl_ipc_data(ctl_table *table, int __user *name, int nlen,
		void __user *oldval, size_t __user *oldlenp,
		void __user *newval, size_t newlen)
{
	size_t len;
	void *data;

	/* Get out of I don't have a variable */
	if (!table->data || !table->maxlen)
		return -ENOTDIR;

	data = get_ipc(table);
	if (!data)
		return -ENOTDIR;

	if (oldval && oldlenp) {
		if (get_user(len, oldlenp))
			return -EFAULT;
		if (len) {
			if (len > table->maxlen)
				len = table->maxlen;
			if (copy_to_user(oldval, data, len))
				return -EFAULT;
			if (put_user(len, oldlenp))
				return -EFAULT;
		}
	}

	if (newval && newlen) {
		if (newlen > table->maxlen)
			newlen = table->maxlen;

		if (copy_from_user(data, newval, newlen))
			return -EFAULT;
	}
	return 1;
}
예제 #10
0
}

#ifdef CONFIG_PROC_SYSCTL
static int proc_ipc_dointvec(ctl_table *table, int write,
                             void __user *buffer, size_t *lenp, loff_t *ppos)
{
    struct ctl_table ipc_table;
    <<<<<<< HEAD
    <<<<<<< HEAD

    =======
        >>>>>>> 73a10a64c2f389351ff1594d88983f47c8de08f0
        =======
            >>>>>>> ae1773bb70f3d7cf73324ce8fba787e01d8fa9f2
            memcpy(&ipc_table, table, sizeof(ipc_table));
    ipc_table.data = get_ipc(table);

    return proc_dointvec(&ipc_table, write, buffer, lenp, ppos);
}

<<<<<<< HEAD
<<<<<<< HEAD
static int proc_ipc_dointvec_minmax(ctl_table *table, int write,
                                    void __user *buffer, size_t *lenp, loff_t *ppos)
{
    struct ctl_table ipc_table;

    memcpy(&ipc_table, table, sizeof(ipc_table));
    ipc_table.data = get_ipc(table);

    return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);