On Wed, 2 Dec 2026 10:54:20 -0800
Scott Mitchell <[email protected]> wrote:
> +/* Helper: Count this process's io_uring SQPOLL threads (comm
> "iou-sqp-<pid>"), or -1. */
> +static int
> +count_sqpoll_threads(void)
> +{
> + char path[PATH_MAX], comm[32];
> + struct dirent *de;
> + DIR *dir;
> + FILE *f;
> + int n = 0;
> +
> + dir = opendir("/proc/self/task");
> + if (dir == NULL)
> + return -1;
> + while ((de = readdir(dir)) != NULL) {
> + if (de->d_name[0] == '.')
> + continue;
> + snprintf(path, sizeof(path), "/proc/self/task/%s/comm",
> de->d_name);
> + f = fopen(path, "r");
> + if (f == NULL)
> + continue;
> + if (fgets(comm, sizeof(comm), f) != NULL && strncmp(comm,
> "iou-sqp-", 8) == 0)
> + n++;
> + fclose(f);
> + }
> + closedir(dir);
> + return n;
> +}
NAK
Depending on internals like this is recipe for future disaster.
The test should not be looking at how ring is implemented.