Reading glibc, I saw this piece of code in string/strerror.c
:
char *
strerror (errnum)
int errnum;
{
char *ret = __strerror_r (errnum, NULL, 0);
int saved_errno;
if (__glibc_likely (ret != NULL))
return ret;
saved_errno = errno;
if (buf == NULL)
buf = malloc (1024);
__set_errno (saved_errno);
if (buf == NULL)
return _("Unknown error");
return __strerror_r (errnum, buf, 1024);
}
Note how there is a int errnum
following the argument list. How is this a valid syntax? And what is it doing?