2003-06-27 Ulrich Drepper <drepper@redhat.com>
+ * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
+ (tf_msgsnd): Likewise.
+
* tst-cancel4.c (tf_msgrcv): Strengthen test against valid
premature returns a bit more.
static pthread_barrier_t b2;
+#ifndef IPC_ADDVAL
+# define IPC_ADDVAL 0
+#endif
+
/* Cleanup handling test. */
static int cl_called;
}
+
static void *
tf_read (void *arg)
{
static void *
tf_msgrcv (void *arg)
{
- tempmsg = msgget (random (), 0666 | IPC_CREAT);
+ tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
int r = pthread_barrier_wait (&b2);
if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
int randnr;
/* We need a positive random number. */
do
- randnr = random ();
+ randnr = random () % 64000;
while (randnr <= 0);
do
{
// blocks we can enable this test to run in both rounds.
abort ();
- tempmsg = msgget (random (), 0666 | IPC_CREAT);
+ tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
int r = pthread_barrier_wait (&b2);
if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
} m;
/* We need a positive random number. */
do
- m.type = random ();
+ m.type = random () % 64000;
while (m.type <= 0);
msgsnd (tempmsg, (struct msgbuf *) &m, sizeof (m.mem), 0);