[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

performous FTBFS, it needs code to find the own executable


performous currently FTBFS on Hurd (and my are you people fast at
figuring out the right line from the build log and letting it show
up on buildd.d.o), I already fixed one issue and pushed it upstream
but now there’s an OS-dependent question.

It basically does this (I’m ignoring the boring stuff like Windows):

	int mib[4];
	mib[0] = CTL_KERN;
	mib[1] = KERN_PROC;
	mib[3] = -1;
	char buf[1024];
	size_t maxchars = sizeof(buf) - 1;
	size_t size = maxchars;
	sysctl(mib, 4, buf, &size, NULL, 0);
	if (size == 0 || size >= maxchars) return fs::path();
	buf[size] = '\0';
	return buf;
	char buf[1024];
	ssize_t maxchars = sizeof(buf) - 1;
	ssize_t size = readlink("/proc/self/exe", buf, sizeof(buf));
	if (size <= 0 || size >= maxchars) return fs::path();
	buf[size] = '\0';
	return buf;
	return fs::path(); // which fails on Hurd

Two questions arise:

① Is one of the two right for Hurd, and if so, which,
  or is different code needed, and if so, which?
	(They hardcode 1024 for path length
	but this could be adapted.)

② What BOOST_OS_* is/are defined on Debian/Hurd?

Thanks in advance,
PS: Please Cc me as I’m not subscribed.
[16:04:33] bkix: "veni vidi violini"
[16:04:45] bkix: "ich kam, sah und vergeigte"...

Reply to: