Re: [PATCH] alternative API for raw devices

From: H. Peter Anvin (
Date: Wed May 01 2002 - 17:52:25 EST

Followup to: <>
By author: Alexander Viro <>
In newsgroup:
> * it's _not_ a character device - stat() will give you S_IFREG.
> To check that <foo> is a new-style raw device call statfs(2) and
> compare .f_type with rawfs magic (0x726177). It doesn't conflict
> with existing check for raw devices (stat(), check that it's
> a character device and compare major with RAW_MAJOR), so existing
> software can be taught to check for raw devices in
> backwards-compatible way.

I really don't know if it's a good idea for this to be S_IFREG, which
software has a reasonable expecation to behave like a normal file,
which a raw device *definitely* doesn't.

I would really like things like this as well as a lot of the
zero-length magic files in /proc to be S_ISCHR with i_rdev ==
MK_DEV(0,0) (the latter to let user space know that this isn't a
standard device node.)


<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot."	<>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue May 07 2002 - 22:00:11 EST