Hello
I know a problem of ha like “The times() return -1 may cause Brain
Split”. We have a linux-ha version 2.1.3 as a rpm file. I can’t find the
resource file . Could you please tell us if 2.1.3 fixed the bug? Thank u.
longclock.c
unsigned long
cl_times(void) /* Make times(2) behave rationally on Linux */
{
clock_t ret;
#ifndef DISABLE_TIMES_KLUDGE
int save_errno = errno;
/*
* times(2) really returns an unsigned value ...
*
* We don't check to see if we got back the error value (-1),
because
* the only possibility for an error would be if the address of
* longclock_dummy_tms_struct was invalid. Since it's a
* compiler-generated address, we assume that errors are impossible.
* And, unfortunately, it is quite possible for the correct return
* from times(2) to be exactly (clock_t)-1. Sigh...
*
*/
errno = 0;
#endif /* DISABLE_TIMES_KLUDGE */
ret = times(TIMES_PARAM);
#ifndef DISABLE_TIMES_KLUDGE
/*
* This is to work around a bug in the system call interface
* for times(2) found in glibc on Linux (and maybe elsewhere)
* It changes the return values from -1 to -4096 all into
* -1 and then dumps the -(return value) into errno.
*
* This totally bizarre behavior seems to be widespread in
* versions of Linux and glibc.
*
* Many thanks to Wolfgang Dumhs <wolfgang.dumhs (at) gmx.at>
* for finding and documenting this bizarre behavior.
*/
if (errno != 0) {
ret = (clock_t) (-errno);
}
errno = save_errno;
#endif /* DISABLE_TIMES_KLUDGE */
return (unsigned long)ret;
}
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems