diff options
| author | Andrea Corallo | 2024-02-28 20:47:57 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2024-02-28 20:47:57 +0100 |
| commit | 1fbe56c32761efdc8d268df80a97a9102d00e109 (patch) | |
| tree | 8d8e76c8ae43c79ef9d76b0f97c12607567664b9 /src/process.c | |
| parent | 6de60f33ed5cc438e20400aee83e1e2032773811 (diff) | |
| parent | 05195e129fc933db32c9e08a155a94bfa4d75b54 (diff) | |
| download | emacs-1fbe56c32761efdc8d268df80a97a9102d00e109.tar.gz emacs-1fbe56c32761efdc8d268df80a97a9102d00e109.zip | |
Merge remote-tracking branch 'origin/master' into 'feature/type-hierarchy'
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index ddab9ed6c01..48a2c0c8e53 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5209,6 +5209,27 @@ wait_reading_process_output_1 (void) | |||
| 5209 | { | 5209 | { |
| 5210 | } | 5210 | } |
| 5211 | 5211 | ||
| 5212 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY \ | ||
| 5213 | && defined THREADS_ENABLED | ||
| 5214 | |||
| 5215 | /* Wrapper around `android_select' that exposes a calling interface with | ||
| 5216 | an extra argument for compatibility with `thread_pselect'. */ | ||
| 5217 | |||
| 5218 | static int | ||
| 5219 | android_select_wrapper (int nfds, fd_set *readfds, fd_set *writefds, | ||
| 5220 | fd_set *exceptfds, const struct timespec *timeout, | ||
| 5221 | const sigset_t *sigmask) | ||
| 5222 | { | ||
| 5223 | /* sigmask is not supported. */ | ||
| 5224 | if (sigmask) | ||
| 5225 | emacs_abort (); | ||
| 5226 | |||
| 5227 | return android_select (nfds, readfds, writefds, exceptfds, | ||
| 5228 | (struct timespec *) timeout); | ||
| 5229 | } | ||
| 5230 | |||
| 5231 | #endif /* HAVE_ANDROID && !ANDROID_STUBIFY && THREADS_ENABLED */ | ||
| 5232 | |||
| 5212 | /* Read and dispose of subprocess output while waiting for timeout to | 5233 | /* Read and dispose of subprocess output while waiting for timeout to |
| 5213 | elapse and/or keyboard input to be available. | 5234 | elapse and/or keyboard input to be available. |
| 5214 | 5235 | ||
| @@ -5701,13 +5722,19 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5701 | timeout = short_timeout; | 5722 | timeout = short_timeout; |
| 5702 | #endif | 5723 | #endif |
| 5703 | 5724 | ||
| 5704 | /* Android doesn't support threads and requires using a | 5725 | /* Android requires using a replacement for pselect in |
| 5705 | replacement for pselect in android.c to poll for | 5726 | android.c to poll for events. */ |
| 5706 | events. */ | ||
| 5707 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY | 5727 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY |
| 5728 | #ifndef THREADS_ENABLED | ||
| 5708 | nfds = android_select (max_desc + 1, | 5729 | nfds = android_select (max_desc + 1, |
| 5709 | &Available, (check_write ? &Writeok : 0), | 5730 | &Available, (check_write ? &Writeok : 0), |
| 5710 | NULL, &timeout); | 5731 | NULL, &timeout); |
| 5732 | #else /* THREADS_ENABLED */ | ||
| 5733 | nfds = thread_select (android_select_wrapper, | ||
| 5734 | max_desc + 1, | ||
| 5735 | &Available, (check_write ? &Writeok : 0), | ||
| 5736 | NULL, &timeout, NULL); | ||
| 5737 | #endif /* THREADS_ENABLED */ | ||
| 5711 | #else | 5738 | #else |
| 5712 | 5739 | ||
| 5713 | /* Non-macOS HAVE_GLIB builds call thread_select in | 5740 | /* Non-macOS HAVE_GLIB builds call thread_select in |