1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-13 11:12:19 -08:00

Update Android port

* java/org/gnu/emacs/EmacsNative.java: Declare ftruncate.

* java/org/gnu/emacs/EmacsSafThread.java (openDocument1): If
initially opening with rwt, verify the file descriptor is really
writable; if not, resort to rw and truncating the file descriptor
by hand instead.

* src/androidvfs.c (NATIVE_NAME (ftruncate)): New function.
Truncate file descriptor and return whether that was successful.
This commit is contained in:
Po Lu 2023-08-06 21:45:29 +08:00
parent 669a4b96c3
commit 7873369338
4 changed files with 57 additions and 1 deletions

View file

@ -274,6 +274,10 @@ public final class EmacsNative
operations. */
public static native void safPostRequest ();
/* Detect and return FD is writable. FD may be truncated to 0 bytes
in the process. */
public static native boolean ftruncate (int fd);
static
{
/* Older versions of Android cannot link correctly with shared