From owner-freebsd-current Mon Jul 2 8:51:31 2001 Delivered-To: freebsd-current@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 4318E37B403 for ; Mon, 2 Jul 2001 08:51:17 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f62Fom722048 for current@FreeBSD.org; Mon, 2 Jul 2001 18:50:48 +0300 (EEST) (envelope-from ru) Date: Mon, 2 Jul 2001 18:50:48 +0300 From: Ruslan Ermilov To: current@FreeBSD.org Subject: TIOCSCTTY Message-ID: <20010702185048.A21809@sunbay.com> Mail-Followup-To: current@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! Could someone please explain why the following code snippet does not work anymore with the "/dev/console" argument? # ./tiocsctty /dev/console tiocsctty: ioctl(/dev/console, TIOCSCTTY): Operation not permitted Thanks, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tiocsctty.c" #include #include #include #include #include int main(int argc, char *argv[]) { int fd; if (argc != 2) errx(1, "missing argument"); if ((fd = open(argv[1], O_RDWR)) == -1) err(1, "open %s", argv[1]); if (daemon(1, 1) == -1) err(1, "daemon"); if (ioctl(fd, TIOCSCTTY) == -1) err(1, "ioctl(%s, TIOCSCTTY)", argv[1]); exit(0); } --bg08WKrSYDhXBjb5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message