From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA23672; Wed, 6 Nov 2002 18:39:16 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA22757 for ; Wed, 6 Nov 2002 18:39:15 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gA6HdE511453 for ; Wed, 6 Nov 2002 18:39:15 +0100 (MET) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id gA6HdEB80992 for ; Wed, 6 Nov 2002 18:39:14 +0100 (CET) Received: from (george@localhost) by clipper.ens.fr (8.12.3/jb-1.1) Date: Wed, 6 Nov 2002 18:39:14 +0100 From: Nicolas George To: caml-list@inria.fr Subject: Re: [Caml-list] calling telnet from a caml program Message-ID: <20021106173914.GA2260@clipper.ens.fr> References: <20021106163446.GI3396@alan-schm1p> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le sextidi 16 brumaire, an CCXI, Andrei Errapart a =E9crit=A0: > If it is possible in C, then it is possible in OCaml, too. Most=20 > probably some termios(3) calls are needed, but not much more. It is More Complicated Than That(tm). On modern Unix, the steps to do that are: - master =3D open(/dev/ptmx) - grantpt(master) - unlockpt(master) - fork - setsid - slave =3D open(ptsname(master)) - ioctl(slave, I_PUSH, "ptem") - ioctl(slave, I_PUSH, "ldterm") - ioctl(slave, I_PUSH, "ttcompat") On BSD, this is more painful, since you must find among /dev/pty* someone that can be opened, and change ownership of the corresponding /dev/tty* (so you must be root). The only common step is the fork/setsid. There is nothing impossible, but there are horripilating portability problems here. --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE9yVPBsGPZlzblTJMRAtiGAJ4w0vl3kyD+V2BHXzQfMr+dYX6FbwCeNIv7 TdGnKO9HLn0Uxkv4UOKcg4M= =schp -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners