diff options
| author | Po Lu | 2023-01-20 22:15:53 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-20 22:15:53 +0800 |
| commit | 761c763dd66700f6eb5480cc55228b96d165960d (patch) | |
| tree | 3988612be68a2bb54cce373b0d880bc295983591 /src/android.c | |
| parent | 26f0dd508982b9680a3cc5d7c56d5f978e06dc8f (diff) | |
| download | emacs-761c763dd66700f6eb5480cc55228b96d165960d.tar.gz emacs-761c763dd66700f6eb5480cc55228b96d165960d.zip | |
Update Android port
* src/android.c (android_run_select_thread, android_select)
(android_ftruncate):
* src/android.h (ftruncate): Fix compilation on Android 16 and
up.
Diffstat (limited to 'src/android.c')
| -rw-r--r-- | src/android.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/android.c b/src/android.c index 47120a6b5f5..3f6e6f4576b 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -274,6 +274,7 @@ android_run_select_thread (void *data) | |||
| 274 | char byte; | 274 | char byte; |
| 275 | #else | 275 | #else |
| 276 | sigset_t signals, waitset; | 276 | sigset_t signals, waitset; |
| 277 | int sig; | ||
| 277 | #endif | 278 | #endif |
| 278 | 279 | ||
| 279 | #if __ANDROID_API__ < 16 | 280 | #if __ANDROID_API__ < 16 |
| @@ -559,7 +560,9 @@ android_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 559 | fd_set *exceptfds, struct timespec *timeout) | 560 | fd_set *exceptfds, struct timespec *timeout) |
| 560 | { | 561 | { |
| 561 | int nfds_return; | 562 | int nfds_return; |
| 563 | #if __ANDROID_API__ < 16 | ||
| 562 | static char byte; | 564 | static char byte; |
| 565 | #endif | ||
| 563 | 566 | ||
| 564 | pthread_mutex_lock (&event_queue.mutex); | 567 | pthread_mutex_lock (&event_queue.mutex); |
| 565 | 568 | ||
| @@ -4498,32 +4501,6 @@ android_project_image_nearest (struct android_image *image, | |||
| 4498 | 4501 | ||
| 4499 | 4502 | ||
| 4500 | 4503 | ||
| 4501 | /* System call wrappers for stuff missing in bionic. */ | ||
| 4502 | |||
| 4503 | #ifndef HAVE_FTRUNCATE | ||
| 4504 | |||
| 4505 | /* ftruncate wrapper for Android, for systems without ftruncate in the | ||
| 4506 | C library. | ||
| 4507 | |||
| 4508 | Such systems are always 32 bit systems, since Android 21 and later | ||
| 4509 | all support ftruncate. In addition, ARM and MIPS require registers | ||
| 4510 | used to store long long parameters to be aligned to an even | ||
| 4511 | register pair. */ | ||
| 4512 | |||
| 4513 | int | ||
| 4514 | android_ftruncate (int fd, off_t length) | ||
| 4515 | { | ||
| 4516 | #if defined __arm__ || defined __mips__ | ||
| 4517 | return syscall (SYS_ftruncate64, fd, 0, | ||
| 4518 | (unsigned int) (length & 0xffffffff), | ||
| 4519 | (unsigned int) (length >> 32)); | ||
| 4520 | #else | ||
| 4521 | return syscall (SYS_ftruncate64, fd, length); | ||
| 4522 | #endif | ||
| 4523 | } | ||
| 4524 | |||
| 4525 | #endif | ||
| 4526 | |||
| 4527 | #else /* ANDROID_STUBIFY */ | 4504 | #else /* ANDROID_STUBIFY */ |
| 4528 | 4505 | ||
| 4529 | /* X emulation functions for Android. */ | 4506 | /* X emulation functions for Android. */ |