No errno set after too many open("/dev/ptmx", ...)
Christian Franke
Christian.Franke@t-online.de
Sun Mar 30 13:01:36 GMT 2025
Found because 'stress-ng --pty 1' reports "open /dev/ptmx failed, errno=0":
$ uname -r # also with 3.5.7-1 and 3.6.0-1.x86_64
3.7.0-0.19.g6c5537c0298e.x86_64
$ cat manyptmx.c
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
int fd;
errno = __ELASTERROR;
do {
fd = open("/dev/ptmx", O_RDWR);
printf("%d, %d\n", fd, errno);
} while (fd >= 0);
return 0;
}
$ gcc -o manyptmx manyptmx.c
$ ./manyptmx
3, 2000
4, 2000
...
127, 2000
128, 2000
0 [main] manyptmx 204 tty_list::allocate: No pty allocated
-1, 2000
--
Regards,
Christian
More information about the Cygwin
mailing list