On Thu, 16 Aug 2001, Victor Yodaiken wrote:
> On Thu, Aug 16, 2001 at 04:17:48PM -0400, Calin Culianu wrote:
> > Notice that unlike the rtf_put() function in rt-linux, the read() system
> > call actually was well enough written to work with void *. It escapes me
> > why the rt-linux developers chose char * as opposed to void * for their
> > second argument to rtf_put(). All I have seen it to do to date was
> > confuse novices. Can anyone enlighten me on this fine point?
>
> Yes. The answer is "lack of thought" - rtf_put was quite early and the early
> UNIX "read" was prior to the invention of "void *" so we didn't think about
> it.
Actually it's pure aesthetics. char * works fine. And you can say that
it emphasizes that the third argument is number of bytes. The only
potential theoretical issue is if mankind ever builds a machine that runs
rt-linux and that somehow has sizeof(char *) != sizeof(void *). :)
In that case weird unexpected errors could occur. Hopefully on that
machine the compiler will be smart enough to copy the pointers correctly
anyway :).
-Calin
> Note that RTLinux now has a POSIX interface to RTF and you can do
> fd = open("/dev/rft2",O_WRONLY | O_NBLK );
>
> write(fd, voidpointer, n);
>
> To make things nicely symmetrical.
>
>
> >
> > -Calin
> >
> > >
> > > mbuff looks interesting but I have found the doc to be sparse.
> > >
> > > I am sure that many of you have had to do this, so I would like to hear your
> > > opinions. Code snippets would be appreciated to help me along.
> > >
> > > Thank-you!
> > >
> > > Oliver
> > > National Test Pilot School
> > >
> > > -- [rtl] ---
> > > To unsubscribe:
> > > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > > echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> > > --
> > > For more information on Real-Time Linux see:
> > > http://www.rtlinux.org/
> > >
> > >
> >
> > -- [rtl] ---
> > To unsubscribe:
> > echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> > echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> > --
> > For more information on Real-Time Linux see:
> > http://www.rtlinux.org/
>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/