diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index f8a0ecb02d9..f72c1b5a2cc 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -502,6 +502,24 @@ #else /* _LP64 */ #define GPR_ARCH_32 1 #endif /* _LP64 */ +#elif defined(__QNX__) || defined(__QNXNTO__) +#define GPR_PLATFORM_STRING "qnx" +#define GPR_CPU_POSIX 1 +#define GPR_GCC_ATOMIC 1 +#define GPR_POSIX_LOG 1 +#define GPR_POSIX_ENV 1 +#define GPR_POSIX_TMPFILE 1 +#define GPR_POSIX_STAT 1 +#define GPR_POSIX_STRING 1 +#define GPR_POSIX_SYNC 1 +#define GPR_POSIX_TIME 1 +#define GPR_HAS_PTHREAD_H 1 +#define GPR_GETPID_IN_UNISTD_H 1 +#ifdef _LP64 +#define GPR_ARCH_64 1 +#else /* _LP64 */ +#define GPR_ARCH_32 1 +#endif /* _LP64 */ #else #error "Could not auto-detect platform" #endif diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index 732c00e1323..3385408309b 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -209,6 +209,20 @@ #define GRPC_POSIX_SOCKET 1 #define GRPC_POSIX_SOCKETUTILS 1 #define GRPC_POSIX_WAKEUP_FD 1 +#elif defined(__QNX__) || defined(__QNXNTO__) +#define GRPC_HAVE_ARPA_NAMESER 1 +#define GRPC_HAVE_IFADDRS 1 +#define GRPC_HAVE_IPV6_RECVPKTINFO 1 +#define GRPC_HAVE_IP_PKTINFO 1 +#define GRPC_HAVE_MSG_NOSIGNAL 1 +#define GRPC_HAVE_UNIX_SOCKET 1 +// TODO(rbyshliaha): Find a way to understand if VSOCK package is installed in +// a toolchain to enable GRPC_HAVE_VSOCK. +#define GRPC_POSIX_SOCKET 1 +#define GRPC_POSIX_WAKEUP_FD 1 +#define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1 +#define GRPC_POSIX_SOCKETUTILS 1 +#define GRPC_POSIX_SYSCONF 1 #elif !defined(GPR_NO_AUTODETECT_PLATFORM) #error "Platform not recognized" #endif