diff options
author | Andrei Homescu <ahomescu@google.com> | 2023-11-03 22:08:34 +0000 |
---|---|---|
committer | Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2023-11-09 05:20:18 +0000 |
commit | aa9dd33f6ba8ccf2f6c4506086511c7b8b213374 (patch) | |
tree | 1eb3289ae2cec936d0f55c7029394e9ddf06dda7 | |
parent | 9e7d4e6dd1c64d8e66006c4275b90705c679b31c (diff) | |
download | libc-aa9dd33f6ba8ccf2f6c4506086511c7b8b213374.tar.gz |
Add close() system call for Trusty
std calls libc::close() so we need to add it.
Bug: 242243245
(cherry picked from https://android-review.googlesource.com/q/commit:c4ff3c4d9e68164e87c453e8f44a1ae57869d1a1)
Merged-In: Ia273a2ae451d913e362047b047a65fbfed072f92
Change-Id: Ia273a2ae451d913e362047b047a65fbfed072f92
-rw-r--r-- | patches/trusty-003.patch | 23 | ||||
-rw-r--r-- | src/trusty.rs | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/patches/trusty-003.patch b/patches/trusty-003.patch new file mode 100644 index 00000000..a848fe1d --- /dev/null +++ b/patches/trusty-003.patch @@ -0,0 +1,23 @@ +commit b0659bcf79d2f5a5ba2ed8690bc98441fed4f0eb +Author: Andrei Homescu <ahomescu@google.com> +Date: Fri Nov 3 22:08:34 2023 +0000 + + Add close() system call for Trusty + + std calls libc::close() so we need to add it. + + Bug: 242243245 + Change-Id: Ia273a2ae451d913e362047b047a65fbfed072f92 + +diff --git a/src/trusty.rs b/src/trusty.rs +index e1508119..140fa6df 100644 +--- a/src/trusty.rs ++++ b/src/trusty.rs +@@ -58,6 +58,7 @@ extern "C" { + pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int; + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t; + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; ++ pub fn close(fd: ::c_int) -> ::c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn getauxval(type_: c_ulong) -> c_ulong; + pub fn mmap( diff --git a/src/trusty.rs b/src/trusty.rs index e1508119..140fa6df 100644 --- a/src/trusty.rs +++ b/src/trusty.rs @@ -58,6 +58,7 @@ extern "C" { pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int; pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t; pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn close(fd: ::c_int) -> ::c_int; pub fn strlen(cs: *const c_char) -> size_t; pub fn getauxval(type_: c_ulong) -> c_ulong; pub fn mmap( |