Re: sysctl vs /proc/sys

From: YOSHIFUJI Hideaki / 吉藤英明
Date: Fri Dec 12 2003 - 19:50:59 EST


In article <20031212181517.GM15401@xxxxxxxxxxxxx> (at Fri, 12 Dec 2003 10:15:17 -0800), Mike Fedyk <mfedyk@xxxxxxxxxxxxx> says:

> On Fri, Dec 12, 2003 at 09:28:32AM -0500, James Morris wrote:
> > On Fri, 12 Dec 2003, YOSHIFUJI Hideaki / [iso-2022-jp] 吉藤英明 wrote:
> >
> > > Can we get the exact previous value from /proc/sys atomicly?
> >
> > I'm not sure what you mean by this.
>
> Read value and modify in one op?

Yes, I meant to read old value and to set new one in one system call.
The sysctl system-call does lock_kernel, so sysctl(2) sytem-call
are serialized.

How about procfs? Are there locks between multiple read-and-write?
Since It seems user-space cannot (or even should not) let kernel
hold lock(s) during read-and-write operation, procfs cannot be
the alternative.

Do I mis-understand something?

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/