15 fd
= posix_openpt (O_RDWR
);
18 printf ("posix_openpt(O_RDWR) failed\nerrno %d (%s)\n",
19 errno
, strerror (errno
));
20 /* We don't fail because of this; maybe the system does not have
21 SUS pseudo terminals. */
29 if (ret
!= -1 || err
!= EBADF
)
31 printf ("grantpt(): expected: return = %d, errno = %d\n", -1, EBADF
);
32 printf (" got: return = %d, errno = %d\n", ret
, err
);
42 const char file
[] = "./grantpt-einval";
44 fd
= open (file
, O_RDWR
| O_CREAT
);
47 printf ("open(\"%s\", O_RDWR) failed\nerrno %d (%s)\n",
48 file
, errno
, strerror (errno
));
55 if (ret
!= -1 || err
!= EINVAL
)
57 printf ("grantpt(): expected: return = %d, errno = %d\n", -1, EINVAL
);
58 printf (" got: return = %d, errno = %d\n", ret
, err
);
74 result
+= test_ebadf ();
75 result
+= test_einval ();