From owner-freebsd-hackers Fri Apr 5 21:42:18 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA06182 for hackers-outgoing; Fri, 5 Apr 1996 21:42:18 -0800 (PST) Received: from time.cdrom.com (time.cdrom.com [204.216.27.226]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id VAA06162 for ; Fri, 5 Apr 1996 21:42:15 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by time.cdrom.com (8.7.5/8.6.9) with SMTP id VAA23389 for ; Fri, 5 Apr 1996 21:41:47 -0800 (PST) To: hackers@freebsd.org Subject: Any clues as to why this fails? Date: Fri, 05 Apr 1996 21:41:47 -0800 Message-ID: <23387.828769307@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk #include #include void handler(int sig) { printf("Signal %d received\n", sig); } main() { int i, fd; signal(SIGIO, handler); fd = open("/dev/cuaa1", O_RDONLY | O_NONBLOCK | O_EXCL); printf("%d\n", fd); i = fcntl(fd, F_GETFL, 0); printf("%d\n", i); printf("%d\n", fcntl(fd, F_SETFL, i | O_ASYNC)); printf("%d\n", fcntl(fd, F_SETOWN, getpid())); /* This call returns -1 */ pause(); } I've read the man page for fcntl() and it really appears as though that F_SETOWN call should work. Any clues as to why not? This is a snippet from some code that Thomas Roell sent me, wondering why this didn't work under *BSD when it did under Linux. Jordan