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


On 8/2/10, Aurelien Jarno <aurelien@aurel32.net> wrote:
> Thinking a bit more about what there is to do, the NFS userland
> utilities are still missing in the archive and only available in
> freebsd-hackedutils. It is probably something we would like to be fixed
> in freebsd-utils (the sources are already there).

I tried today, mount_nfs is not an easy one. I fixed a few minor
problems, then found that getosreldate() is not implemented, so I
wrote a small getosreldate.c (attached), but I'm not sure if it should
go in mount_nfs or some library (libbsd?).

It still fails to link because of missing getnetconfig().
getnetconfig.c fails to build because of the kfreebsd-kernel-headers
bug I just reported.
#include <stdlib.h>
#include <unistd.h>
#include <sys/sysctl.h>

getosreldate ()
	int osreldate;
	size_t osreldate_size = sizeof(osreldate);
	char *osversion;

	osversion = getenv("OSVERSION");
	if (osversion)
		return atoi(osversion);

	if (sysctlbyname("kern.osreldate", &osreldate, &osreldate_size, NULL, 0) != 0)
		osreldate = -1;

	return osreldate;

Reply to: