diff options
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/hurd.scm | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/hurd-streamio-select.patch | 88 |
3 files changed, 90 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index ea9fc47ad78..ba2245d1e9c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1602,6 +1602,7 @@ dist_patch_DATA = \ | |||
| 1602 | %D%/packages/patches/hurd-refcounts-assert.patch \ | 1602 | %D%/packages/patches/hurd-refcounts-assert.patch \ |
| 1603 | %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ | 1603 | %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ |
| 1604 | %D%/packages/patches/hurd-startup.patch \ | 1604 | %D%/packages/patches/hurd-startup.patch \ |
| 1605 | %D%/packages/patches/hurd-streamio-select.patch \ | ||
| 1605 | %D%/packages/patches/hurd-proc-zombies.patch \ | 1606 | %D%/packages/patches/hurd-proc-zombies.patch \ |
| 1606 | %D%/packages/patches/hwloc-1-test-btrfs.patch \ | 1607 | %D%/packages/patches/hwloc-1-test-btrfs.patch \ |
| 1607 | %D%/packages/patches/i3lock-blur-fix-build-on-gcc-10.patch \ | 1608 | %D%/packages/patches/i3lock-blur-fix-build-on-gcc-10.patch \ |
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 84ae9a4a2c9..2428dcb0fd1 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm | |||
| @@ -347,6 +347,7 @@ Hurd-minimal package which are needed for both glibc and GCC.") | |||
| 347 | (patches (search-patches "hurd-refcounts-assert.patch" | 347 | (patches (search-patches "hurd-refcounts-assert.patch" |
| 348 | "hurd-rumpdisk-no-hd.patch" | 348 | "hurd-rumpdisk-no-hd.patch" |
| 349 | "hurd-startup.patch" | 349 | "hurd-startup.patch" |
| 350 | "hurd-streamio-select.patch" | ||
| 350 | "hurd-proc-zombies.patch")))) | 351 | "hurd-proc-zombies.patch")))) |
| 351 | (version (package-version hurd-headers)) | 352 | (version (package-version hurd-headers)) |
| 352 | (arguments | 353 | (arguments |
diff --git a/gnu/packages/patches/hurd-streamio-select.patch b/gnu/packages/patches/hurd-streamio-select.patch new file mode 100644 index 00000000000..4bd8e48a13d --- /dev/null +++ b/gnu/packages/patches/hurd-streamio-select.patch | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | Upstream status: https://lists.gnu.org/archive/html/bug-hurd/2025-12/msg00043.html | ||
| 2 | |||
| 3 | From ffe82c73f89d12393c62d5ba35b06552af40e029 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Yelninei <yelninei@tutamail.com> | ||
| 5 | Date: Sun, 28 Dec 2025 10:59:56 +0000 | ||
| 6 | Subject: [PATCH 1/2] streamio (io_select_common): Don't return in case of | ||
| 7 | O_NONBLOCK. | ||
| 8 | |||
| 9 | select should block even when opened with O_NONBLOCK. | ||
| 10 | --- | ||
| 11 | trans/streamio.c | 6 ------ | ||
| 12 | 1 file changed, 6 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/trans/streamio.c b/trans/streamio.c | ||
| 15 | index d21dc937..2a48d793 100644 | ||
| 16 | --- a/trans/streamio.c | ||
| 17 | +++ b/trans/streamio.c | ||
| 18 | @@ -589,12 +589,6 @@ io_select_common (struct trivfs_protid *cred, | ||
| 19 | return 0; | ||
| 20 | } | ||
| 21 | |||
| 22 | - if (cred->po->openmodes & O_NONBLOCK) | ||
| 23 | - { | ||
| 24 | - pthread_mutex_unlock (&global_lock); | ||
| 25 | - return EWOULDBLOCK; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | ports_interrupt_self_on_port_death (cred, reply); | ||
| 29 | err = pthread_hurd_cond_timedwait_np (&select_alert, &global_lock, tsp); | ||
| 30 | if (err) | ||
| 31 | -- | ||
| 32 | 2.52.0 | ||
| 33 | |||
| 34 | From 090062ef555ffc29bcb7afcaad5bb46dad5973e9 Mon Sep 17 00:00:00 2001 | ||
| 35 | From: Yelninei <yelninei@tutamail.com> | ||
| 36 | Date: Sun, 28 Dec 2025 11:03:57 +0000 | ||
| 37 | Subject: [PATCH 2/2] streamio (io_select_common): Request data if none is | ||
| 38 | available. | ||
| 39 | |||
| 40 | If no data is available immediately start new read/write requests. | ||
| 41 | --- | ||
| 42 | trans/streamio.c | 23 +++++++++++++++++++++++ | ||
| 43 | 1 file changed, 23 insertions(+) | ||
| 44 | |||
| 45 | diff --git a/trans/streamio.c b/trans/streamio.c | ||
| 46 | index 2a48d793..f7cd442f 100644 | ||
| 47 | --- a/trans/streamio.c | ||
| 48 | +++ b/trans/streamio.c | ||
| 49 | @@ -190,6 +190,8 @@ error_t dev_write (const void *buf, size_t len, size_t *amount, int nowait); | ||
| 50 | will wait for any activity to cease. */ | ||
| 51 | error_t dev_sync (int wait); | ||
| 52 | |||
| 53 | +static error_t start_input (int nowait); | ||
| 54 | +static error_t start_output (int nowait); | ||
| 55 | |||
| 56 | |||
| 57 | static struct argp_option options[] = | ||
| 58 | @@ -589,6 +591,27 @@ io_select_common (struct trivfs_protid *cred, | ||
| 59 | return 0; | ||
| 60 | } | ||
| 61 | |||
| 62 | + if (*type & SELECT_READ) | ||
| 63 | + { | ||
| 64 | + err = start_input(1); | ||
| 65 | + if (err) | ||
| 66 | + { | ||
| 67 | + *type = 0; | ||
| 68 | + pthread_mutex_unlock (&global_lock); | ||
| 69 | + return err; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + if (*type & SELECT_WRITE) | ||
| 73 | + { | ||
| 74 | + err = start_output(1); | ||
| 75 | + if (err) | ||
| 76 | + { | ||
| 77 | + *type = 0; | ||
| 78 | + pthread_mutex_unlock (&global_lock); | ||
| 79 | + return err; | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | ports_interrupt_self_on_port_death (cred, reply); | ||
| 84 | err = pthread_hurd_cond_timedwait_np (&select_alert, &global_lock, tsp); | ||
| 85 | if (err) | ||
| 86 | -- | ||
| 87 | 2.52.0 | ||
| 88 | |||
