+#elif OS(QNX)
+ memset(®s, 0, sizeof(regs));
+ regs.tid = platformThread;
+ // FIXME: If we find this hurts performance, we can consider caching the fd and keeping it open.
+ int fd = open("/proc/self/as", O_RDONLY);
+ if (fd == -1) {
+ LOG_ERROR("Unable to open /proc/self/as (errno: %d)", errno);
+ CRASH();
+ }
+ int rc = devctl(fd, DCMD_PROC_TIDSTATUS, ®s, sizeof(regs), 0);
+ if (rc != EOK) {
+ LOG_ERROR("devctl(DCMD_PROC_TIDSTATUS) failed (error: %d)", rc);
+ CRASH();
+ }
+ close(fd);
+ return sizeof(struct _debug_thread_info);