From 0be03f320b674f387da392d9e4fece5b67a79ae1 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 20 Apr 2010 10:16:44 +0000 Subject: Slightly modernize realpath(3). SUSv4 requires that implementation returns EINVAL if supplied path is NULL, and ENOENT if path is empty string [1]. Bring prototype in conformance with SUSv4, adding restrict keywords. Allow the resolved path buffer pointer be NULL, in which case realpath(3) allocates storage with malloc(). PR: kern/121897 [1] MFC after: 2 weeks --- include/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/stdlib.h') diff --git a/include/stdlib.h b/include/stdlib.h index b8cd1a3..b833203 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -201,7 +201,7 @@ int posix_openpt(int); char *ptsname(int); int putenv(char *); long random(void); -char *realpath(const char *, char resolved_path[]); +char *realpath(const char * __restrict, char * __restrict); unsigned short *seed48(unsigned short[3]); #ifndef _SETKEY_DECLARED -- cgit v1.1