1 // Copyright (C) 2008 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef _CUTILS_ASHMEM_H 16 #define _CUTILS_ASHMEM_H 17 18 #include <stddef.h> 19 20 #if defined(__BIONIC__) 21 #include <linux/ashmem.h> 22 #endif 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 int ashmem_valid(int fd); 29 int ashmem_create_region(const char *name, size_t size); 30 int ashmem_set_prot_region(int fd, int prot); 31 int ashmem_pin_region(int fd, size_t offset, size_t len); 32 int ashmem_unpin_region(int fd, size_t offset, size_t len); 33 int ashmem_get_size_region(int fd); 34 35 #ifdef __cplusplus 36 } 37 #endif 38 39 #endif /* _CUTILS_ASHMEM_H */ 40