Re: [PATCH] Support single byte reads from integers published inprocfs by kernel/sysctl.c

From: Earl Chew
Date: Sun Jan 29 2012 - 20:13:26 EST


> I suspect what we want for writes is to read the existing value into an
> internal buffer, and then allow partial writes to the internal buffer.

Oh I see. Hmm ... I get the feeling that doubles the scope of the exercise ;-)

I'll give it some more thought.

> I don't know if writable seq_files exist.

No, they don't -- at least not out-of-the-box. From fs/seq_file.c :

> /*
> * seq_files support lseek() and pread(). They do not implement
> * write() at all, but we clear FMODE_PWRITE here for historical
> * reasons.
> *
> * If a client of seq_files a) implements file.write() and b) wishes to
> * support pwrite() then that client will need to implement its own
> * file.open() which calls seq_open() and then sets FMODE_PWRITE.
> */
> file->f_mode &= ~FMODE_PWRITE;

Earl

--
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/