summaryrefslogtreecommitdiff
path: root/native/android/sharedmem.cpp
AgeCommit message (Collapse)Author
2020-04-13Include what you use: <fcntl.h>Tom Cherry
This was transitively included, but no longer is, so it must be explicitly included. Exempt-From-Owner-Approval: Janitorial Test: build Change-Id: Id88ee5113aa9f0a223dfabfc164ce17747727647
2019-01-14sharedmem.cpp: replace dup() with fcntl(F_DUPFD_CLOEXEC)Nick Kralevich
Replace calls to dup() with fcntl(F_DUPFD_CLOEXEC). The only difference between the two is that O_CLOEXEC is set on the newly duped file descriptor. This helps address file descriptor leaks crossing an exec() boundary. Test: compiles and boots Change-Id: I95218331382b7a3432d31a46c173009dc4df1a6b
2017-08-07SharedMemory API changesJohn Reck
Hides getFd & getFileDescriptor due to lifecycle concenrs. Adds ASharedMemory_dupFromJava to allow sharing a shared memory region between Java & Native as safe as possible. Mis-use results in an FD leak instead of double-close. Bug: 64394076 Test: SharedMemory CTS tests Change-Id: I01a5eb978fc4e99559a79baac75754c32f13bdc4
2017-02-24Added implementation of shared memory NDK APIPeng Xu
Implemeneted the following APIs: * int ASharedMemory_create(const char *name, size_t size); * size_t ASharedMemory_getSize(int fd); * int ASharedMemory_setProt(int fd, int prot); Test: cts-tradefed run cts --module CtsSensorTestCases \ --test android.hardware.cts.SensorNativeTest Bug: 5995644, 30985702 Change-Id: I645b35e67293673efce9bb90f042ec0d3b83aa42