aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2023-11-17 22:15:11 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-11-17 22:15:11 +0000
commit6898a93a96b2f4e33799664a0b339e7c7e7a7356 (patch)
tree5c4b78b17fa8a3ab703540743c6cf62138d0f9ef
parent22442215148f08dabed08b0de06583a4dbd878b8 (diff)
parenteb376b046e99f50166ad009ca2c022dfb5f84978 (diff)
downloadlibc-6898a93a96b2f4e33799664a0b339e7c7e7a7356.tar.gz
Merge "Add close() system call for Trusty" into main am: eb376b046e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/libc/+/2823471 Change-Id: Ifa8b23e27a2d48944f38fc1521969d8ffe22e63c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--patches/trusty-003.patch23
-rw-r--r--src/trusty.rs1
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(