} while (0)
/* Value which differs from one stored in int *val */
-# define VAL ((unsigned long) 0xbadda7a0facefeedLLU)
-# define VAL_PR ((unsigned) VAL)
+# define VAL ((unsigned long) 0xbadda7a0facefeedLLU)
+# define VAL_PR ((unsigned) VAL)
-# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU)
-# define VAL2_PR ((unsigned) VAL2)
+# define VALP ((unsigned long) 0xbadda7a01acefeedLLU)
+# define VALP_PR ((unsigned) VALP)
-# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU)
-# define VAL3_PR ((unsigned) VAL3)
+# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU)
+# define VAL2_PR ((unsigned) VAL2)
+
+# define VAL2P ((unsigned long) 0xbadda7a07a7b100dLLU)
+# define VAL2P_PR ((unsigned) VAL2P)
+
+# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU)
+# define VAL3_PR ((unsigned) VAL3)
int
main(int argc, char *argv[])
/* Trying to re-queue some processes but there's nothing to re-queue */
CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3,
- (rc == 0));
+ (rc == 0) || ((rc == -1) && (errno == EINVAL)));
printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n",
uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc));
+ CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VALP, VAL2P, uaddr2, VAL3,
+ (rc == 0));
+ printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n",
+ uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc));
+
/* Trying to re-queue some processes but there's nothing to re-queue */
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2,
- uaddr2, VAL3, (rc == 0));
+ uaddr2, VAL3, (rc == 0) || ((rc == -1) && (errno == EINVAL)));
printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n",
uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc));
+ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VALP,
+ VAL2P, uaddr2, VAL3, (rc == 0));
+ printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n",
+ uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc));
+
CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u",
"%#lx");
/* Comparison re-queue with wrong val value */
CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3,
- (rc == -1) && (errno == EAGAIN));
+ (rc == -1) && (errno == EAGAIN || errno == EINVAL));
printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n",
uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc));
+ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, VAL3,
+ (rc == -1) && (errno == EAGAIN));
+ printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n",
+ uaddr, VALP_PR, VAL2P_PR, uaddr2, VAL3_PR, sprintrc(rc));
+
/* Successful comparison re-queue */
CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr,
- (rc == 0));
+ (rc == 0) || ((rc == -1) && (errno == EINVAL)));
printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n",
uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc));
+ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, *uaddr,
+ (rc == 0));
+ printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n",
+ uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc));
+
/* Successful comparison re-queue */
CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL,
- VAL2, uaddr2, *uaddr, (rc == 0));
+ VAL2, uaddr2, *uaddr,
+ (rc == 0) || ((rc == -1) && (errno == EINVAL)));
printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n",
uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc));
+ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VALP,
+ VAL2P, uaddr2, *uaddr, (rc == 0));
+ printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n",
+ uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc));
+
CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6,
"%u", "%u", "%#lx", "%u");