[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] pnetC: mman.h & co.
From: |
Rhys Weatherley |
Subject: |
Re: [Pnet-developers] pnetC: mman.h & co. |
Date: |
Thu, 14 Aug 2003 08:28:13 +1000 |
User-agent: |
KMail/1.4.3 |
On Wednesday 13 August 2003 07:09 am, Mario D.Santana wrote:
> I tried tackling expat first and hit some errors. Looks like it needs
> stuff from sys/mman.h so I grabbed glibc and started figuring that all
> out. But the glibc stuff for mman.h (grep PROT_READ) seems to be
> platform-dependent and, having never implemented a C library before, I
> wanted to get some direction before I borked up the platform-dependent
> bits of pnetClib. I also hit some syntax errors I'll submit as bugs to
> savannah.
The mman.h stuff (mmap, munmap, etc), doesn't make much sense in the pnet
environment. There's no way to memory-map a file in the C# library, for
example. And the /dev/zero memory allocation thing is just plain evil.
I suggest creating a set of dummy system calls that always return an error
indication. Hopefully expat is smart enough to back off to a non-mmap
implementation if the call fails. If not, you'll need to fix expat - an mmap
using application that cannot back off is broken, by definition, since mmap
won't work over pipes and sockets.
> Meanwhile, I'll go try and tackle the socket stuff. (So you may hear
> from me again real soon.)
That will certainly be easier. For ideas as to how it needs to be done, look
at "pnetC/libc/unistd/unistd_glue.cs". Basically, all socket-related
functions need to be redirected through to "System.Net.Sockets.Socket" in
"System.dll".
Cheers,
Rhys.