]> granicus.if.org Git - strace/commitdiff
tests/epoll_ctl.c: extend epoll_ctl coverage
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 10 Apr 2016 22:38:00 +0000 (22:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 10 Apr 2016 22:38:00 +0000 (22:38 +0000)
* tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding.  Check
decoding of long int descriptors and NULL struct epoll_event pointer.

tests/epoll_ctl.c

index 4e985e0e2ee41f1cfea937428882f7ef20b2f52a..7237f0f799e1f90bee1a94b3e429320e5abc0ff1 100644 (file)
@@ -21,6 +21,14 @@ main(void)
               ev->data.u32, ev->data.u64, rc,
               errno == ENOSYS ? "ENOSYS" : "EBADF");
 
+       rc = syscall(__NR_epoll_ctl, -3, EPOLL_CTL_DEL, -4, ev);
+       printf("epoll_ctl(-3, EPOLL_CTL_DEL, -4, %p) = %d %s (%m)\n",
+              ev, rc, errno == ENOSYS ? "ENOSYS" : "EBADF");
+
+       rc = syscall(__NR_epoll_ctl, -1L, EPOLL_CTL_MOD, -16L, 0);
+       printf("epoll_ctl(-1, EPOLL_CTL_MOD, -16, NULL) = %d %s (%m)\n",
+              rc, errno == ENOSYS ? "ENOSYS" : "EFAULT");
+
        puts("+++ exited with 0 +++");
        return 0;
 }