Date: Wed, 10 Dec 1997 08:34:25 +0900 From: Shigio Yamaguchi <shigio@wafu.netgate.net> To: John Polstra <jdp@polstra.com> Cc: shigio@wafu.netgate.net, hackers@freebsd.org Subject: Re: [RFC] path converting functions. Message-ID: <199712091552.PAA11445@wafu.netgate.net> In-Reply-To: Message from John Polstra <jdp@polstra.com> of "Tue, 09 Dec 1997 07:41:18 PST." <199712091541.HAA00577@austin.polstra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Since your functions write into the user-supplied buffer "result",
> you should add an argument that specifies how big it is.  See the
> gethostname() and snprintf() interfaces, for example.
> 
The result argument must refer to a buffer capable of storing at least
MAXPATHLEN characters. This is the way of realpath(3).
SYNOPSIS
     #include <sys/param.h>
     char *
     abs2rel(const char *path, const char *base, char result[MAXPATHLEN])
If generated path name becomes longer than MAXPATHLEN - 1, abs2rel and
rel2abs returns -1 and set errno = ENAMETOOLONG.
--
Shigio Yamaguchi (Freelance programmer)
	Mail: shigio@wafu.netgate.net, WWW: http://wafu.netgate.net/tama/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712091552.PAA11445>
