#include <stdio.h>
int main() {
int val1 = 0;
int val2;
struct chclause clauses[] = {
{CHSEND, 100, &val1, sizeof(val1)},
{CHRECV, 200, &val2, sizeof(val2)}
};
int rc = choose(clauses, 2, now() + 1000);
printf("rc=%i, errno=%i\n",rc,errno);
return 0;
}
prints
rc=0, errno=9When as per documentation
rcshould be-1.