Subject: Re: Getting active console
To: NetBSD Technical Kernel list <tech-kern@netbsd.org>
From: Julio Merino <jmmv@hispabsd.org>
List: tech-kern
Date: 05/28/2002 21:50:31
--tjCHc7DPkfUGtrlw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 28, 2002 at 09:00:43PM +0200, Martin Husemann wrote:
> > The mouse daemon would do the following to paste text using this
> > feature:
> > 1. Use WSDISPLAY_GETACTIVENO to get active console number.
> > 2. Open /dev/ttyE?, where ? is the value returned before.
>=20
> Which will fail, since it's already open - or am I missing something?

Hmm... I have tried it and works... I used:

f =3D open("/dev/ttyE6", O_RDONLY | O_NONBLOCK);
ioctl(f, WSDISPLAY_GETACTIVENO, &d);

Replace 6 with any number. It works for me.

Regards

--=20
Of course it runs NetBSD - http://www.netbsd.org
HispaBSD member - http://www.hispabsd.org
Julio Merino <jmmv@hispabsd.org>

--tjCHc7DPkfUGtrlw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (NetBSD)

iD8DBQE889+Hzz00ZOPKycwRAp3rAJ9h6ha7V/7WLhKMQZZaTjo1rmL1fACeLUx0
uZKnagQ4y3CpUgNkyJyQCq8=
=qiJa
-----END PGP SIGNATURE-----

--tjCHc7DPkfUGtrlw--