1 /* 2 __ 3 / _| 4 __ _ _ _ _ __ ___ _ __ __ _ | |_ ___ ___ ___ 5 / _` | | | | '__/ _ \| '__/ _` | | _/ _ \/ __/ __| 6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \ 7 \__,_|\__,_|_| \___/|_| \__,_| |_| \___/|___/___/ 8 9 Copyright (C) 2017 The Android Open Source Project. 10 Copyright (C) 2018-2019 Aurora Free Open Source Software. 11 12 This file is part of the Aurora Free Open Source Software. This 13 organization promote free and open source software that you can 14 redistribute and/or modify under the terms of the GNU Lesser General 15 Public License Version 3 as published by the Free Software Foundation or 16 (at your option) any later version approved by the Aurora Free Open Source 17 Software Organization. The license is available in the package root path 18 as 'LICENSE' file. Please review the following information to ensure the 19 GNU Lesser General Public License version 3 requirements will be met: 20 https://www.gnu.org/licenses/lgpl.html . 21 22 Alternatively, this file may be used under the terms of the GNU General 23 Public License version 3 or later as published by the Free Software 24 Foundation. Please review the following information to ensure the GNU 25 General Public License requirements will be met: 26 https://www.gnu.org/licenses/gpl-3.0.html. 27 28 NOTE: All products, services or anything associated to trademarks and 29 service marks used or referenced on this file are the property of their 30 respective companies/owners or its subsidiaries. Other names and brands 31 may be claimed as the property of others. 32 33 For more info about intellectual property visit: aurorafoss.org or 34 directly send an email to: contact (at) aurorafoss.org . 35 36 This file has bindings for an existing code, part of The Android Open Source 37 Project implementation. Check it out at android.googlesource.com . 38 */ 39 40 module aurorafw.android.platform.sharedmem_jni; 41 42 /** 43 * @addtogroup Memory 44 * @{ 45 */ 46 47 /** 48 * @file aurorafw/android/platform/sharedmem_jni.d 49 * @brief Shared memory buffers that can be shared across process. 50 */ 51 52 version (Android): 53 extern (C): 54 @system: 55 nothrow: 56 @nogc: 57 58 /****************************************************************** 59 * 60 * IMPORTANT NOTICE: 61 * 62 * This file is part of Android's set of stable system headers 63 * exposed by the Android NDK (Native Development Kit). 64 * 65 * Third-party source AND binary code relies on the definitions 66 * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. 67 * 68 * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) 69 * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS 70 * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY 71 * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES 72 */ 73 74 /** 75 * Returns a dup'd FD from the given Java android.os.SharedMemory object. The returned file 76 * descriptor has all the same properties & capabilities as the FD returned from 77 * ASharedMemory_create(), however the protection flags will be the same as those of the 78 * android.os.SharedMemory object. 79 * 80 * Use close() to release the shared memory region. 81 * 82 * Available since API level 27. 83 * 84 * \param env The JNIEnv* pointer 85 * \param sharedMemory The Java android.os.SharedMemory object 86 * \return file descriptor that denotes the shared memory; -1 if the shared memory object is 87 * already closed, if the JNIEnv or jobject is NULL, or if there are too many open file 88 * descriptors (errno=EMFILE) 89 */ 90 int ASharedMemory_dupFromJava (JNIEnv* env, jobject sharedMemory); 91 92 // __ANDROID_API__ >= 27 93 94 // ANDROID_SHARED_MEMORY_JNI_H 95 96 /** @} */