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

performous FTBFS, it needs code to find the own executable



Hi,

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):

#if (BOOST_OS_BSD)
	int mib[4];
	mib[0] = CTL_KERN;
	mib[1] = KERN_PROC;
	mib[2] = KERN_PROC_PATHNAME;
	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;
#elif (BOOST_OS_LINUX)
	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;
#else
	return fs::path(); // which fails on Hurd
#endif

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,
//mirabilos
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: