diff options
Diffstat (limited to 'third_party/ashmem/ashmem.h')
-rw-r--r-- | third_party/ashmem/ashmem.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/third_party/ashmem/ashmem.h b/third_party/ashmem/ashmem.h index 3ef9f73c80..7a26a18ae3 100644 --- a/third_party/ashmem/ashmem.h +++ b/third_party/ashmem/ashmem.h @@ -15,3 +15,18 @@ // third_party/ashmem is Android shared memory. Instead of clone it here, // use cutils/ashmem.h directly. #include <cutils/ashmem.h> + +#ifdef __cplusplus +extern "C" { +#endif + +inline int ashmem_get_prot_region(int fd) { + int ret = ashmem_valid(fd); + if (ret < 0) + return ret; + return TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_GET_PROT_MASK)); +} + +#ifdef __cplusplus +} +#endif |