diff --git a/gio/gsocket.c b/gio/gsocket.c index 3a02dccde..52a198378 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -4486,6 +4486,15 @@ g_socket_condition_timed_wait (GSocket *socket, #ifndef G_OS_WIN32 +#ifdef HAVE_QNX +/* QNX has this weird upper limit, or at least used to back in the 6.x days. + * This was discovered empirically and doesn't appear to be mentioned in any + * of the official documentation. */ +# define G_SOCKET_CONTROL_BUFFER_SIZE_BYTES 2016 +#else +# define G_SOCKET_CONTROL_BUFFER_SIZE_BYTES 2048 +#endif + /* Unfortunately these have to be macros rather than inline functions due to * using alloca(). */ #define output_message_to_msghdr(message, prev_message, msg, prev_msg, error) \ @@ -4632,7 +4641,7 @@ G_STMT_START { \ } \ else \ { \ - _msg->msg_controllen = 2048; \ + _msg->msg_controllen = G_SOCKET_CONTROL_BUFFER_SIZE_BYTES; \ _msg->msg_control = g_alloca (_msg->msg_controllen); \ } \ \ diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c index 2aac6419a..32b936259 100644 --- a/gio/gunixmounts.c +++ b/gio/gunixmounts.c @@ -956,6 +956,23 @@ _g_get_unix_mounts (void) return return_list; } +/* QNX {{{2 */ +#elif defined (HAVE_QNX) + +static char * +get_mtab_monitor_file (void) +{ + /* TODO: Not implemented */ + return NULL; +} + +static GList * +_g_get_unix_mounts (void) +{ + /* TODO: Not implemented */ + return NULL; +} + /* Common code {{{2 */ #else #error No _g_get_unix_mounts() implementation for system @@ -1479,6 +1496,14 @@ _g_get_unix_mount_points (void) return _g_get_unix_mounts (); } +/* QNX {{{2 */ +#elif defined (HAVE_QNX) +static GList * +_g_get_unix_mount_points (void) +{ + return _g_get_unix_mounts (); +} + /* Common code {{{2 */ #else #error No g_get_mount_table() implementation for system diff --git a/gio/meson.build b/gio/meson.build index e0a190cd6..8e039b68c 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -50,6 +50,9 @@ if host_system != 'windows' elif cc.links(res_query_test, args : '-lbind', name : 'res_query() in -lbind') network_libs += [ cc.find_library('bind') ] network_args += [ '-lbind' ] + elif cc.links(res_query_test, args : '-lsocket', name : 'res_query() in -lsocket') + network_libs += [ cc.find_library('socket') ] + network_args += [ '-lsocket' ] else error('Could not find res_query()') endif diff --git a/meson.build b/meson.build index d0c531659..476a93855 100644 --- a/meson.build +++ b/meson.build @@ -98,6 +98,10 @@ build_tests = get_option('tests') and (not meson.is_cross_build() or (meson.is_c add_project_arguments('-D_GNU_SOURCE', language: 'c') +if host_system == 'qnx' + add_project_arguments('-D_QNX_SOURCE', language: 'c') +endif + # Disable strict aliasing; # see https://bugzilla.gnome.org/show_bug.cgi?id=791622 if cc.has_argument('-fno-strict-aliasing') @@ -773,6 +777,10 @@ if host_system == 'darwin' add_project_link_arguments(osx_ldflags, language : ['objc', 'c']) endif +if host_system == 'qnx' + glib_conf.set('HAVE_QNX', 1) +endif + # Check for futex(2) if cc.links('''#include #include