Summary:
The port reuse feature and 'SO_REUSEPORT' flag are not supported by a few linux
In case of linux kernel, it supported from v 3.9
(https://kernelnewbies.org/Linux_3.9)
On the lower version of kernel, compile is failed
Reviewers: barbieri, jayji
Reviewed By: jayji
Subscribers: akanad, id213sin, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4256
fd = efl_loop_fd_get(o);
if (fd < 0) return EINA_TRUE; /* postpone until fd_set() */
+#ifdef SO_REUSEPORT
value = reuse_port;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &value, sizeof(value)) < 0)
{
pd->reuse_port = old;
return EINA_FALSE;
}
-
return EINA_TRUE;
+#else
+ pd->reuse_port = EINA_FALSE;
+ return EINA_FALSE;
+#endif
}
EOLIAN static Eina_Bool
/* if there is a fd, always query it directly as it may be modified
* elsewhere by nasty users.
*/
+#ifdef SO_REUSEPORT
valuelen = sizeof(value);
if (getsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &value, &valuelen) < 0)
{
pd->reuse_port = !!value; /* sync */
return pd->reuse_port;
+#else
+ return EINA_FALSE;
+#endif
}
EOLIAN static void