History log of /seL4-camkes-master/projects/musllibc/src/unistd/getcwd.c
Revision Date Author Comments
# 4fb7df12 08-Oct-2013 Rich Felker <dalias@aerifal.cx>

fix errno value for getcwd when size argument is zero

based on patch by Michael Forney. at the same time, I've changed the
if branch to be more clear, avoiding the comma operator.

the underlying issue is that Linux always returns ERANGE when size is
too short, even when it's zero, rather than returning EINVAL for the
special case of zero as required by POSIX.


# 899b13ca 01-Mar-2012 Rich Felker <dalias@aerifal.cx>

support null buffer argument to getcwd, auto-allocating behavior

this is a popular extension some programs depend on, and by using a
temporary buffer and strdup rather than malloc prior to the syscall,
i've avoided the dependency on free and thus minimized the bloat cost
of supporting this feature.


# aa398f56 19-Mar-2011 Rich Felker <dalias@aerifal.cx>

global cleanup to use the new syscall interface


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0