Bug 5339530: Set socket creating folder to /tmp for QNX

This commit is contained in:
shawnz 2025-06-13 16:03:05 +08:00
parent a47b422205
commit e674cc36fe
10 changed files with 27 additions and 11 deletions

View File

@ -222,10 +222,10 @@ int ipcOpenSocket(ipcHandle *&handle) {
memset(&cliaddr, 0, sizeof(cliaddr)); memset(&cliaddr, 0, sizeof(cliaddr));
cliaddr.sun_family = AF_UNIX; cliaddr.sun_family = AF_UNIX;
char temp[10]; char temp[20];
// Create unique name for the socket. // Create unique name for the socket.
sprintf(temp, "%u", getpid()); sprintf(temp, "%s%u", SOCK_FOLDER, getpid());
strcpy(cliaddr.sun_path, temp); strcpy(cliaddr.sun_path, temp);
if (bind(sock, (struct sockaddr *)&cliaddr, sizeof(cliaddr)) < 0) { if (bind(sock, (struct sockaddr *)&cliaddr, sizeof(cliaddr)) < 0) {
@ -361,8 +361,8 @@ int ipcSendShareableHandle(ipcHandle *handle,
// Construct client address to send this SHareable handle to // Construct client address to send this SHareable handle to
memset(&cliaddr, 0, sizeof(cliaddr)); memset(&cliaddr, 0, sizeof(cliaddr));
cliaddr.sun_family = AF_UNIX; cliaddr.sun_family = AF_UNIX;
char temp[10]; char temp[20];
sprintf(temp, "%u", process); sprintf(temp, "%s%u", SOCK_FOLDER, process);
strcpy(cliaddr.sun_path, temp); strcpy(cliaddr.sun_path, temp);
len = sizeof(cliaddr); len = sizeof(cliaddr);

View File

@ -54,6 +54,13 @@
#endif #endif
#include <vector> #include <vector>
// Define "/tmp" as socket creating folder for QNX
#if defined(__QNX__)
#define SOCK_FOLDER "/tmp/"
#else
#define SOCK_FOLDER ""
#endif
typedef struct sharedMemoryInfo_st { typedef struct sharedMemoryInfo_st {
void *addr; void *addr;
size_t size; size_t size;

View File

@ -49,7 +49,7 @@ endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -51,7 +51,7 @@ endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -48,7 +48,7 @@ endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -48,7 +48,7 @@ endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -53,7 +53,7 @@ endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -17,6 +17,15 @@ else()
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 110 120) set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 110 120)
endif() endif()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Wno-deprecated-gpu-targets")
if(ENABLE_CUDA_DEBUG)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (may significantly affect performance on some targets)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -maxrregcount=64") # Limit register usage to 64 for the 'big_bitonicsort kernel
else()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo") # add line information to all builds for debug tools (exclusive to -G option)
endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) include_directories(../../../Common)

View File

@ -51,7 +51,7 @@ set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/memMapIpc_kernel.cu")
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()

View File

@ -44,7 +44,7 @@ set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/ptxjit_kernel.cu")
if(CMAKE_SYSTEM_NAME STREQUAL "QNX") if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST) set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}") list(APPEND INCLUDES_LIST "-I${dir}")
endforeach() endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}") string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif() endif()