Use getexecpath() on OpenBSD for get_process_name() #257
This should be moved into the added section for OpenBSD.
What if PATH_MAX is not large enough? Is there an upper bound for path size on OpenBSD?
Yes, PATH_MAX. It is internally limited to PATH_MAX - 1 and NUL terminated.
I asked because getexecpath docs say that the path may exceed PATH_MAX, and there isn't an obvious way to obtain the actual length of the path. So I was wondering if there was a larger actual limit for the path size.
Before this change, the branch below was used, calling read_symlink on one of the proc files. Assuming that one of those files exist on OpenBSD, that code would use readlink with an exponentially increasing buffer size, up to a limit, here. If you want to use getexecpath instead of that code path, I think, a similar logic around getexecpath needs to be implemented here.
No, OpenBSD does not use the /proc filesystem. Its like the code builds but we've never had a proper API and that's always been an issue.
No, internally it is capped at PATH_MAX in the kernel.
https://github.com/openbsd/src/commit/4dde6567f895c6faa36acbacd4cdf62954a70399
libc function
https://github.com/openbsd/src/commit/026846f111232f45cd1f4883414c190c8ff722a7
I see, thanks for the information.
Thank you.
Lastique
brad0
No description provided by author.