Proposal: Fix abstract unix sockets (#1699)
kolmodin at dtek.chalmers.se
Fri Oct 5 12:09:52 EDT 2007
Ian Lynagh wrote:
> Hi Lennart,
> On Sun, Sep 16, 2007 at 10:16:40AM +0100, Lennart Kolmodin wrote:
>> I've added proposal #1699 to fix abstract unix sockets on Linux for the
>> network library.
> You haven't suggested a deadline; between the GHC release and ICFP et al,
> perhaps 15 Oct would make sense?
>> The patch is so far only tested under Linux (2.6.15), but should not
>> affect Windows or other OSes which does not have AUS.
> So if I understand correctly, with this patch certain paths would be
> treated differently, but only on Linux machines? If someone tries to use
> AUS on a non-Linux system, will things break horribly? i.e. would it be
> better to have a separate package/module for this Linux-specific
I expect an exception will be thrown by 'connect' if you try to use a
AUS on a non-linux box.
The user only difference for the users is that they can now prefix their
UnixPath with a zero. So no change of the API, iirc.
A technique previously used is to create a new constructor for AUS and
simply not expose it on systems that doesn't support it. This requires
the portability-aware devs to #ifdef on the target platform.
>> Also, due to much more socklen usage:
>> * Switch Network.Socket to use CSockLen instead of CInt.
>> * Cleanup surrounding code.
> It would be better for code fixes and cleanup to be in a separate patch
> from new functionality; this part sounds like it should definitely be
Right, yes. The reason I didn't was because I discovered things needed
to be fixed once I already had changed other stuff... aye, lazy, yes...
"The only thing that interferes with my learning is my education."
-- Albert Einstein
More information about the Libraries