From owner-freebsd-questions Sun Mar 31 10:43:34 2002 Delivered-To: freebsd-questions@freebsd.org Received: from SRDMAIL.SINP.MSU.RU (bigking.sinp.msu.ru [213.131.9.130]) by hub.freebsd.org (Postfix) with ESMTP id 10B5B37B41B for ; Sun, 31 Mar 2002 10:43:23 -0800 (PST) Received: from dima (helo=localhost) by SRDMAIL.SINP.MSU.RU with local-esmtp (Exim 3.34 #1) id 16rkIT-0008YP-00 for freebsd-questions@FreeBSD.org; Sun, 31 Mar 2002 22:43:21 +0400 Date: Sun, 31 Mar 2002 22:43:21 +0400 (MSD) From: Dmitry Mottl To: freebsd-questions@FreeBSD.org Subject: ioctl question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi! I have 'Operation not permitted' when I try to get a controlling terminal via ioctl call #include #include #include #include #include int main(int argc, char **argv, char **envp) { int amaster, aslave; char ttyname[25]; if(openpty(&amaster,&aslave,ttyname,NULL,NULL)) { perror("Can't open pty"); exit(-1); } if (ioctl(aslave, TIOCSCTTY)==-1) { /* here I got error */ perror("Can't make controlling terminal"); exit(-1); } close(0); close(1); close(2); dup(aslave); dup(aslave); dup(aslave); execve(argv[1], argv+1, envp); } Thank You! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message