#endif
#endif
+#include "util/os_file.h"
+
#include "radv_private.h"
#include "vk_util.h"
const VkImportMemoryFdInfoKHR import_info = {
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
- .fd = dup(dma_buf),
+ .fd = os_dupfd_cloexec(dma_buf),
};
/* Find the first VRAM memory type, or GART for PRIME images. */
VkResult semaphore_result = VK_SUCCESS, fence_result = VK_SUCCESS;
if (semaphore != VK_NULL_HANDLE) {
- int semaphore_fd = nativeFenceFd >= 0 ? dup(nativeFenceFd) : nativeFenceFd;
+ int semaphore_fd = nativeFenceFd >= 0 ? os_dupfd_cloexec(nativeFenceFd) : nativeFenceFd;
semaphore_result = radv_ImportSemaphoreFdKHR(device,
&(VkImportSemaphoreFdInfoKHR) {
.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
}
if (fence != VK_NULL_HANDLE) {
- int fence_fd = nativeFenceFd >= 0 ? dup(nativeFenceFd) : nativeFenceFd;
+ int fence_fd = nativeFenceFd >= 0 ? os_dupfd_cloexec(nativeFenceFd) : nativeFenceFd;
fence_result = radv_ImportFenceFdKHR(device,
&(VkImportFenceFdInfoKHR) {
.sType = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR,