https://bugs.kde.org/show_bug.cgi?id=470713

--- Comment #3 from Paul Floyd <pjfl...@wanadoo.fr> ---
Ah but it's not using realpath.

https://github.com/YosysHQ/yosys/blob/5813809ad9afbe1c38f65c6aae7c3441d7614d0b/kernel/yosys.cc#L890

#elif defined(__FreeBSD__)
std::string proc_self_dirname()
{
        int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
        size_t buflen;
        char *buffer;
        std::string path;
        if (sysctl(mib, 4, NULL, &buflen, NULL, 0) != 0)
                log_error("sysctl failed: %s\n", strerror(errno));
        buffer = (char*)malloc(buflen);
        if (buffer == NULL)
                log_error("malloc failed: %s\n", strerror(errno));
        if (sysctl(mib, 4, buffer, &buflen, NULL, 0) != 0)
                log_error("sysctl failed: %s\n", strerror(errno));
        while (buflen > 0 && buffer[buflen-1] != '/')
                buflen--;
        path.assign(buffer, buflen);
        free(buffer);
        return path;
}

There are two calls to sysctl kern.proc.pathname, one to get the buffer size
and one to get the pathname.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to