tests/ioperm.c: use errno2name

This commit is contained in:
Дмитрий Левин 2016-04-21 20:59:26 +00:00
parent 7f68f80f42
commit c1dbe052f1

View File

@ -11,23 +11,10 @@ int
main(void)
{
const unsigned long port = (unsigned long) 0xdeafbeefffffffff;
long rc = syscall(__NR_ioperm, port, 1, 0);
const char *error_text;
switch (errno) {
case EIO:
error_text = "EIO";
break;
case ENOSYS:
error_text = "ENOSYS";
break;
case EPERM:
error_text = "EPERM";
break;
default:
error_text = "EINVAL";
}
printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n",
port, 1UL, 0, rc, error_text);
port, 1UL, 0, rc, errno2name());
puts("+++ exited with 0 +++");
return 0;