Merge "Document that ASharedMemory_create fds may or may not be CLOEXEC." am: 9e499bc47f am: 6b7a48e022 am: 3767a044ff
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1419344
Change-Id: I715f24c79e0cf1833f35f04a8b76fedb21504cbe
diff --git a/include/android/sharedmem.h b/include/android/sharedmem.h
index 6efa4f7..5f74682 100644
--- a/include/android/sharedmem.h
+++ b/include/android/sharedmem.h
@@ -65,6 +65,10 @@
* another process. File descriptors may also be sent to other processes over a Unix domain
* socket with sendmsg and SCM_RIGHTS. See sendmsg(3) and cmsg(3) man pages for more information.
*
+ * If you intend to share this file descriptor with a child process after
+ * calling exec(3), note that you will need to use fcntl(2) with FD_SETFD
+ * to clear the FD_CLOEXEC flag for this to work on all versions of Android.
+ *
* Available since API level 26.
*
* \param name an optional name.