ashmem.h 787 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* cutils/ashmem.h
  2. **
  3. ** Copyright 2008 The Android Open Source Project
  4. **
  5. ** This file is dual licensed. It may be redistributed and/or modified
  6. ** under the terms of the Apache 2.0 License OR version 2 of the GNU
  7. ** General Public License.
  8. */
  9. #ifndef _CUTILS_ASHMEM_H
  10. #define _CUTILS_ASHMEM_H
  11. #include <stddef.h>
  12. #if defined(__BIONIC__)
  13. #include <linux/ashmem.h>
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. int ashmem_valid(int fd);
  19. int ashmem_create_region(const char *name, size_t size);
  20. int ashmem_set_prot_region(int fd, int prot);
  21. int ashmem_pin_region(int fd, size_t offset, size_t len);
  22. int ashmem_unpin_region(int fd, size_t offset, size_t len);
  23. int ashmem_get_size_region(int fd);
  24. void ashmem_init();
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif /* _CUTILS_ASHMEM_H */