aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2023-11-17 21:27:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-11-17 21:27:25 +0000
commiteb376b046e99f50166ad009ca2c022dfb5f84978 (patch)
tree5c4b78b17fa8a3ab703540743c6cf62138d0f9ef
parentf73ae172d996ed148ec8fbed5eb88d7e40ed8f04 (diff)
parentaa9dd33f6ba8ccf2f6c4506086511c7b8b213374 (diff)
downloadlibc-eb376b046e99f50166ad009ca2c022dfb5f84978.tar.gz
Merge "Add close() system call for Trusty" into main
-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(