no apparent good reason in revision 1.39.
This is what broke systrace's filename normalization.
Go back to original behavior as in revision 1.35: return resolved name,
but also set errno to ENOENT.
The current code resolves paths like `/foo/bar/', `/foo/bar/./', and
`/foo/bar/../', even if `bar' is a regular file and not a directory.
Reviewed by cube@.
directory. Strategy from FreeBSD. Addess PR#28986.
- Make realpath() to return an error when null string is passed or
the last component is symlink to null string. The kernel lookup
routine returns an error if such path are passed.
since 1999 when we switched to a (faster) system call based getcwd(),
and as shown recently has had some buffer size problems anyway (although
they have since been fixed).
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.
the first two items result in the addition of code similar to the
following in various functions:
_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
* $PWD was used if it appeared ``correct''. this `enhancment' was
not documented in getcwd(3), and caused problems for pwd(1) (which
uses getcwd(3)), and in turn <bsd.obj.mk> (which uses pwd) when $PWD
is set to the logical path instead of the real path (e.g, symlink
/usr/src -> /z/NetBSD-current/src).
[$PWD is set to the logical path by tcsh(1) with set symlinks=expand]
* as getcwd() without the $PWD code is just a wrapper to getcwd_physical(),
rename the latter to the latter. hack realpath() to use the getcwd().
yet another case of `it was a good idea, but...'
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.
This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.