RETURN VALUES
On successful completion, basename returns a pointer to the last component of path. If basename fails, a null pointer is returned and the global variable errno is set to indicate the error.
ERRORS
The following error codes may be set in errno: