[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trying to run a Mumble Server



On Thu, 2013-09-19 at 02:33 +0200, Samuel Thibault wrote:
> Jens Mühlenhoff, le Thu 19 Sep 2013 02:18:28 +0200, a écrit :
> > >Yes. SOCK_CLOEXEC is not currently supported, the TCP/IP stack thinks
> > >the caller is inventing a new proto type numbered 4194305.  You would
> > >get the same behavior on Linux when building the application against a
> > >recent libc, but running it against an old kernel without SOCK_CLOEXEC
> > >support.
> > 
> > Ok, so libc is reporting a feature the Hurd doesn't support.
> 
> Yes, just like in the Linux case.
> 
> > I was wondering why the Qt code is using (fd != -1 || errno != EINVAL) to determine success?
> 
> Because Linux probably returns EINVAL instead of EPROTOTYPE in such an
> error case.

You can solve this problem with a code construct like (from a pending
upstream glib2.0 patch. Recent dbus upstream patches use the same
technique):

#ifdef SOCK_CLOEXEC
  fd = socket (domain, type | SOCK_CLOEXEC, protocol);
  if (fd != -1)
    return fd;

  /* It's possible that libc has SOCK_CLOEXEC but the kernel does not */
  if (fd < 0 && (errno == EINVAL || errno == EPROTOTYPE))
#endif
    fd = socket (domain, type, protocol);

  if (fd < 0)
    ...

Maybe file a bug report to Qt upstream?


Reply to: