Subject: Re: can I open RAM?
To: Chris Wareham <chris.wareham@iosystems.co.uk>
From: village idiot <village_ldi0t@yahoo.com>
List: netbsd-help
Date: 05/01/2002 08:45:46
Chris,
thanks for helping me on my way.
I think I can do something like this, for my sender
side: (?)
static int ElfFD = 0;/* file descriptor */
static size_t ElfExeSize = 0;
static unsigned char *ElfStart = NULL; /* mapped
addr*/
unsigned char *
MapTargetFile(int fd)
{
ElfFD = fd;
ElfExeSize = lseek(ElfFD, 0, SEEK_END);
if (ElfExeSize == (size_t) - 1)
{
perror("Input file error seek");
exit(-1);
}
lseek(ElfFD, 0, SEEK_SET); /* seek back to start*/
ElfStart = (unsigned char *)
mmap(NULL,
ElfExeSize,
MAP_FILE | MAP_SHARED,
PROT_READ,
ElfFD,
0x00);
return ElfStart;
}
But what can I do on receiver side? Du I need to make
a file first? I do not know how large that file will
be. I am not updating, but making a new file. I would
like to dump that to RAM instead of to the disk.
Can I reserve a fixed size of RAM, and have a file
pointer to it? Something like a RAM disk would be
wicked here, like on old windows systems.
What exactly does your system do? Does it write over
pre existing files? Is this something you have made
yourself?
Have you tested it for latency?
Please have a great day.
Cheers!
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com