From owner-freebsd-bugs Fri Apr 5 4:20:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E349937B41B for ; Fri, 5 Apr 2002 04:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g35CK1P67670; Fri, 5 Apr 2002 04:20:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5DFA537B405 for ; Fri, 5 Apr 2002 04:14:55 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g35CEtL66960; Fri, 5 Apr 2002 04:14:55 -0800 (PST) (envelope-from nobody) Message-Id: <200204051214.g35CEtL66960@freefall.freebsd.org> Date: Fri, 5 Apr 2002 04:14:55 -0800 (PST) From: Murray Nesbitt To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/36784: Can't fcntl(fd, F_SETFL, ...) on a pseudo-tty Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 #include #include 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