| Summary: | Can't fcntl(fd, F_SETFL, ...) on a pseudo-tty | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Murray Nesbitt <murray> |
| Component: | kern | Assignee: | Jaakko Heinonen <jh> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.5-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
I don't think you're supposed to be able to do that if the client isn't open, but you're right that it works on Solaris. State Changed From-To: open->feedback I couldn't reproduce this on 8.0-RELEASE. Is this problem still relevant on recent versions of FreeBSD? Responsible Changed From-To: freebsd-bugs->jh Track. State Changed From-To: feedback->closed Feedback timeout. |
fcntl(fd, F_SETFL, arg) on a pseudo-tty fails with EAGAIN, even if arg is the result of a call to fcntl(fd, F_GETFL); This doesn't seem right. FWIW, same code works on Linux and Solaris. Also FWIW, this is preventing us from porting our application to FreeBSD. How-To-Repeat: #include <fcntl.h> #include <stdio.h> #include <errno.h> main() { int status, fd; fd = open("/dev/ptyp9", 2); fprintf(stderr, "fd: %d\n", fd); errno = 0; status = fcntl(fd, F_GETFL); fprintf(stderr, "status: %d, errno: %d\n", status, errno); errno = 0; status = fcntl(fd, F_SETFL, status); fprintf(stderr, "status: %d, errno: %d\n", status, errno); }