From e14f2f9f208cb0b39465dcad5e922ca75d802b6f Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 14 Apr 2023 01:06:35 +0000 Subject: [PATCH] Nullability check for sendfile module. Bugs: b/245972273 Test: adb shell Change-Id: I47d116b1faf7d53ac51589e393a3df96874a4f37 --- libc/include/sys/sendfile.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h index 60bbde8b8..4b00d5dc8 100644 --- a/libc/include/sys/sendfile.h +++ b/libc/include/sys/sendfile.h @@ -40,7 +40,7 @@ __BEGIN_DECLS /* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ #if defined(__USE_FILE_OFFSET64) -ssize_t sendfile(int __out_fd, int __in_fd, off_t* __offset, size_t __count) __RENAME(sendfile64) __INTRODUCED_IN(21); +ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64) __INTRODUCED_IN(21); #else /** * [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html) copies data directly @@ -50,13 +50,13 @@ ssize_t sendfile(int __out_fd, int __in_fd, off_t* __offset, size_t __count) __R * * Available since API level 21. */ -ssize_t sendfile(int __out_fd, int __in_fd, off_t* __offset, size_t __count); +ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count); #endif /** * Like sendfile() but allows using a 64-bit offset * even from a 32-bit process without `__FILE_OFFSET_BITS=64`. */ -ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* __offset, size_t __count) __INTRODUCED_IN(21); +ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* _Nullable __offset, size_t __count) __INTRODUCED_IN(21); __END_DECLS