The latest release of glib (2.2.2) has a bug in the
g_io_channel_unix_new method. The call to getsockopt I believe should include
the optval and optlen args; currently they are NULL. The older glib 2.2.1 call
used to 'sort-of' work because the call erroneously checked SO_ERROR instead of
SOCKET_ERROR; the new release is now correctly checking socket_error. After
installing the latest release, my code broke. When I put the getsockopt call in
my code, I got a return code of -1; as expected. When I included the optval and
optlen args, the call succeeded. After checking the man pages of various unix
systems and windows, I noticed this tidbit:
The call succeeds unless:
...unix
[EFAULT] The address pointed to by optval is not in a
valid part of the process address space. For
getsockopt, this error may also be returned if optlen is not
in a valid part of the process address space.
...windows
I believe NULL is not a valid part of the
process address space.
Thanks,
Bruce
|