Date: Fri, 5 Apr 2002 04:14:55 -0800 (PST) From: Murray Nesbitt <murray@unixporting.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/36784: Can't fcntl(fd, F_SETFL, ...) on a pseudo-tty Message-ID: <200204051214.g35CEtL66960@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 36784
>Category: kern
>Synopsis: Can't fcntl(fd, F_SETFL, ...) on a pseudo-tty
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Apr 05 04:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Murray Nesbitt
>Release: 4.5-RELEASE
>Organization:
>Environment:
FreeBSD bp6.unixporting.com 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Tue Apr 2 05:09:44 GMT 2002 root@bp6.unixporting.com:/usr/src/sys/compile/MYKERNEL.bp6 i386
>Description:
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);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204051214.g35CEtL66960>
