Add realpath Prototype
Joel Sherrill
joel.sherrill@oarcorp.com
Mon Nov 18 18:24:00 GMT 2013
Hi
I added the realpath() prototype more or less where
glibc has it in stdlib.h.
Also added restrict to Linux implementation.
Does this look ok to commit?
2013-11-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/stdlib.h: Add prototype of realpath().
* libc/sys/linux/realpath.c: Add restrict keyword.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
-------------- next part --------------
Index: libc/include/stdlib.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdlib.h,v
retrieving revision 1.46
diff -u -r1.46 stdlib.h
--- libc/include/stdlib.h 18 Nov 2013 17:26:51 -0000 1.46
+++ libc/include/stdlib.h 18 Nov 2013 18:19:50 -0000
@@ -118,6 +118,8 @@
int _EXFUN(_mkstemps_r, (struct _reent *, char *, int));
char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
#endif
+char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path));
+_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar));
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar));
int _EXFUN(rand,(_VOID));
_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));
Index: libc/sys/linux/realpath.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/linux/realpath.c,v
retrieving revision 1.1
diff -u -r1.1 realpath.c
--- libc/sys/linux/realpath.c 9 Dec 2000 01:20:32 -0000 1.1
+++ libc/sys/linux/realpath.c 18 Nov 2013 18:19:54 -0000
@@ -69,7 +69,7 @@
}
-char *realpath(const char *path,char *resolved_path)
+char *realpath(const char *__restrict path,char *__restrict resolved_path)
{
char cwd[PATH_MAX];
char *path_copy;
More information about the Newlib
mailing list