lkml.org 
[lkml]   [2004]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: loopback on block device
From
On Wed, Oct 27, 2004 at 02:42:48PM -0500, Lei Yang wrote:
> Why /dev/ram0 is a file? Can you get into more details? For example, if
> I want to do some system level programming and write to a /dev/ram0, how
> do I do it?
>

I don't think you need an example. You can open it in exactly
the same way as you open regular files like /etc/resolv.conf.

ie.
FILE *f = fopen("/dev/ram0", "rw");
Then use fseek, fwrite and fread as usual.

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

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.042 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site