mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-23 21:34:18 +08:00
224 lines
6.3 KiB
Diff
224 lines
6.3 KiB
Diff
diff -ruwN source-old/gio/gcredentialsprivate.h source/gio/gcredentialsprivate.h
|
|
--- source-old/gio/gcredentialsprivate.h 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/gcredentialsprivate.h 2025-11-07 15:26:45.587855360 -0700
|
|
@@ -104,7 +104,7 @@
|
|
*/
|
|
#undef G_CREDENTIALS_HAS_PID
|
|
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__redox__)
|
|
#define G_CREDENTIALS_SUPPORTED 1
|
|
#define G_CREDENTIALS_USE_LINUX_UCRED 1
|
|
#define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_LINUX_UCRED
|
|
diff -ruwN source-old/gio/glocalfile.c source/gio/glocalfile.c
|
|
--- source-old/gio/glocalfile.c 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/glocalfile.c 2025-11-07 15:26:45.592150212 -0700
|
|
@@ -77,6 +77,10 @@
|
|
|
|
#include "glib-private.h"
|
|
|
|
+#if defined(__redox__)
|
|
+#undef AT_FDCWD
|
|
+#endif
|
|
+
|
|
#ifdef G_OS_WIN32
|
|
#include <windows.h>
|
|
#include <io.h>
|
|
diff -ruwN source-old/gio/gnetworking.h.in source/gio/gnetworking.h.in
|
|
--- source-old/gio/gnetworking.h.in 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/gnetworking.h.in 2025-11-07 15:26:45.592531678 -0700
|
|
@@ -40,13 +40,17 @@
|
|
#include <netdb.h>
|
|
#include <netinet/in.h>
|
|
#include <netinet/tcp.h>
|
|
+#if !defined(__redox__)
|
|
#include <resolv.h>
|
|
+#endif
|
|
#include <sys/socket.h>
|
|
#include <sys/un.h>
|
|
#include <net/if.h>
|
|
|
|
#include <arpa/inet.h>
|
|
+#if !defined(__redox__)
|
|
#include <arpa/nameser.h>
|
|
+#endif
|
|
@NAMESER_COMPAT_INCLUDE@
|
|
|
|
#ifndef __GI_SCANNER__
|
|
diff -ruwN source-old/gio/gthreadedresolver.c source/gio/gthreadedresolver.c
|
|
--- source-old/gio/gthreadedresolver.c 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/gthreadedresolver.c 2025-11-07 15:26:45.592812736 -0700
|
|
@@ -579,8 +579,26 @@
|
|
return g_task_propagate_pointer (G_TASK (result), error);
|
|
}
|
|
|
|
+#if defined(__redox__)
|
|
+gint
|
|
+g_resolver_record_type_to_rrtype (GResolverRecordType type)
|
|
+{
|
|
+ g_return_val_if_reached (-1);
|
|
+}
|
|
|
|
-#if defined(G_OS_UNIX)
|
|
+GList *
|
|
+g_resolver_records_from_res_query (const gchar *rrname,
|
|
+ gint rrtype,
|
|
+ const guint8 *answer,
|
|
+ gssize len,
|
|
+ gint herr,
|
|
+ GError **error)
|
|
+{
|
|
+ return NULL;
|
|
+}
|
|
+#endif
|
|
+
|
|
+#if defined(G_OS_UNIX) && !defined(__redox__)
|
|
|
|
#if defined __BIONIC__ && !defined BIND_4_COMPAT
|
|
/* Copy from bionic/libc/private/arpa_nameser_compat.h
|
|
@@ -1308,7 +1326,10 @@
|
|
for (;;)
|
|
{
|
|
g_byte_array_set_size (answer, len * 2);
|
|
-#if defined(HAVE_RES_NQUERY)
|
|
+#if defined(__redox__)
|
|
+ //TODO: implement on redox
|
|
+ len = -1;
|
|
+#elif defined(HAVE_RES_NQUERY)
|
|
len = res_nquery (&res, rrname, C_IN, rrtype, answer->data, answer->len);
|
|
#else
|
|
len = res_query (rrname, C_IN, rrtype, answer->data, answer->len);
|
|
diff -ruwN source-old/gio/gunixconnection.c source/gio/gunixconnection.c
|
|
--- source-old/gio/gunixconnection.c 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/gunixconnection.c 2025-11-07 15:41:56.572549299 -0700
|
|
@@ -496,7 +496,7 @@
|
|
GSocket *socket;
|
|
gint n;
|
|
gssize num_bytes_read;
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__redox__)
|
|
gboolean turn_off_so_passcreds;
|
|
#endif
|
|
|
|
@@ -512,7 +512,7 @@
|
|
* already. We also need to turn it off when we're done. See
|
|
* #617483 for more discussion.
|
|
*/
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__redox__)
|
|
{
|
|
gint opt_val;
|
|
|
|
@@ -626,7 +626,7 @@
|
|
|
|
out:
|
|
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__redox__)
|
|
if (turn_off_so_passcreds)
|
|
{
|
|
if (!g_socket_set_option (socket,
|
|
diff -ruwN source-old/gio/gunixmounts.c source/gio/gunixmounts.c
|
|
--- source-old/gio/gunixmounts.c 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/gunixmounts.c 2025-11-07 15:26:45.593497732 -0700
|
|
@@ -1135,6 +1135,37 @@
|
|
return NULL;
|
|
}
|
|
|
|
+/* Redox OS {{{2 */
|
|
+#elif defined (__redox__)
|
|
+
|
|
+static char *
|
|
+get_mtab_monitor_file (void)
|
|
+{
|
|
+ /* TODO: Not implemented */
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
+static GUnixMountEntry **
|
|
+_g_unix_mounts_get_from_file (const char *table_path,
|
|
+ uint64_t *time_read_out,
|
|
+ size_t *n_entries_out)
|
|
+{
|
|
+ /* Not implemented, as per _g_get_unix_mounts() below */
|
|
+ if (time_read_out != NULL)
|
|
+ *time_read_out = 0;
|
|
+ if (n_entries_out != NULL)
|
|
+ *n_entries_out = 0;
|
|
+
|
|
+ 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
|
|
@@ -1745,6 +1776,28 @@
|
|
if (time_read_out != NULL)
|
|
*time_read_out = 0;
|
|
if (n_points_out != NULL)
|
|
+ *n_points_out = 0;
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
+#elif defined(__redox__)
|
|
+
|
|
+static GList *
|
|
+_g_get_unix_mount_points (void)
|
|
+{
|
|
+ /* Not implemented */
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
+static GUnixMountPoint **
|
|
+_g_unix_mount_points_get_from_file (const char *table_path,
|
|
+ uint64_t *time_read_out,
|
|
+ size_t *n_points_out)
|
|
+{
|
|
+ /* Not implemented */
|
|
+ if (time_read_out != NULL)
|
|
+ *time_read_out = 0;
|
|
+ if (n_points_out != NULL)
|
|
*n_points_out = 0;
|
|
return NULL;
|
|
}
|
|
diff -ruwN source-old/gio/meson.build source/gio/meson.build
|
|
--- source-old/gio/meson.build 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/meson.build 2025-11-07 15:26:45.594120270 -0700
|
|
@@ -18,7 +18,7 @@
|
|
|
|
gnetworking_h_nameser_compat_include = ''
|
|
|
|
-if host_system not in ['windows', 'android']
|
|
+if host_system not in ['windows', 'android', 'redox']
|
|
# Don't check for C_IN on Android since it does not define it in public
|
|
# headers, we define it ourselves wherever necessary
|
|
if not cc.compiles('''#include <sys/types.h>
|
|
@@ -39,7 +39,7 @@
|
|
|
|
network_libs = [ ]
|
|
network_args = [ ]
|
|
-if host_system != 'windows'
|
|
+if host_system not in ['windows', 'redox']
|
|
# res_query()
|
|
res_query_test = '''#include <resolv.h>
|
|
int main (int argc, char ** argv) {
|
|
diff -ruwN source-old/gio/xdgmime/xdgmimecache.c source/gio/xdgmime/xdgmimecache.c
|
|
--- source-old/gio/xdgmime/xdgmimecache.c 2025-02-20 06:08:16.000000000 -0700
|
|
+++ source/gio/xdgmime/xdgmimecache.c 2025-11-07 15:26:45.594369348 -0700
|
|
@@ -22,7 +22,7 @@
|
|
#include <fnmatch.h>
|
|
#include <assert.h>
|
|
|
|
-#include <netinet/in.h> /* for ntohl/ntohs */
|
|
+#include <arpa/inet.h> /* for ntohl/ntohs */
|
|
|
|
#ifdef HAVE_MMAP
|
|
#include <sys/mman.h>
|