From owner-freebsd-questions Wed Jul 30 10:22:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA17370 for questions-outgoing; Wed, 30 Jul 1997 10:22:17 -0700 (PDT) Received: from tornado.cisco.com (tornado.cisco.com [171.69.104.22]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA17356 for ; Wed, 30 Jul 1997 10:22:08 -0700 (PDT) Received: from bmcgover-pc.cisco.com (bmcgover-pc.cisco.com [171.69.104.147]) by tornado.cisco.com (8.8.5-Cisco.1/8.6.5) with ESMTP id NAA24506; Wed, 30 Jul 1997 13:21:07 -0400 (EDT) Received: from bmcgover-pc.cisco.com (localhost.cisco.com [127.0.0.1]) by bmcgover-pc.cisco.com (8.8.5/8.8.5) with ESMTP id NAA00395; Wed, 30 Jul 1997 13:20:38 -0400 (EDT) Message-Id: <199707301720.NAA00395@bmcgover-pc.cisco.com> To: questions@freebsd.org cc: ivan@cyclades.com Subject: ENOENT on read? (Problem with tip) Date: Wed, 30 Jul 1997 13:20:37 -0400 From: Brian McGovern Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm having problems with tip connecting to a serial port. I've tracked the point of failure to the line just after the printf("Point 1\n"); below. I've now reached the point where "I just don't get it" (tm). I've found, from hunt.c, that its trying to open /dev/cuacA00, which is the correct device, so the "No such file or directory" description in /usr/include/sys/errno.h makes little sense. Also, the descriptor FD is usually either 3 or 4, so its not that its a bad descriptor from the open, either. Lastly, I don't see any calls to fnctl to set the socket non-blocking (or in the open for that matter), so the read should block until there is data. Anyhow, any sugguestions are welcome. -Brian for (omask = 0;; sigsetmask(omask)) { cnt = read(FD, buf, BUFSIZ); if (cnt <= 0) { /* lost carrier */ if (cnt < 0 && errno == EIO) { sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } else if (cnt == 0 && errno == ENOENT) { printf("Point 1\n"); if (getppid() != 1) kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } else if (cnt < 0) { printf("Point 2\n"); if (getppid() != 1) kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } continue; }