Am 31.08.2008 um 14:46 schrieb Salvatore Benedetto:
2008/8/29 Andreas Färber <andreas.faerber@xxxxxx>:I recently encountered some problems with pthread_cond_broadcast (noticket yet since I haven't pinpointed it exactly). In a very simple C# HelloWorld app Mono checks for the pthread_cond_broadcast return codes andasserts that they are zero (I assume it runs single-threaded, no Garbage Collector). If I remove Mono's asserts it works as expected. The problematic return code is EINVAL iirc (B_BAD_VALUE), and I traced it to libroot's release_sem_etc, triggered by "if (count <= 0 && (flags & B_RELEASE_ALL) == 0) return B_BAD_VALUE;". Unfortunately it's hard to investigate this on theMono side. Does the PosixTestSuite check for such subtleties?I just ran the posixtestsuit and as far as I can see, there is not such a check. As far as POSIX standard goes, the only possible return value *seems* to be- zero on success - EINVAL on error which means, that B_BAD_VALUE for instance might not be correct, which is returnedby cond_signal. Same goes for all the other values returned by release_sem_etc.Thanks for pointing it out.
I was confused by that as well, but B_BAD_VALUE and EINVAL seemed equivalent by value so that part is not wrong per se. I agree, it would be more readable though to use the POSIX error constants in POSIX functions.
Andreas -- HaikuPorts homepage - http://ports.haiku-files.org List archives: //www.freelists.org/archives/beports Administrative contact: brecht@xxxxxxxxxxx