Console I/O in X on A/UX 1.1

John Sovereign john at unisoft.UUCP
Sat Jun 24 09:11:13 AEST 1989


In article <4167 at emory.mathcs.emory.edu> km at mathcs.emory.edu (Ken Mandelberg) writes:
>I am having trouble understanding what is going on with console i/o
>when running X on A/UX 1.1.

Yes, these are undocumented features of A/UX 1.1.  Maybe this means they will
go away in the future....  

Two separate features exist.  First, there's a pseudo-device which allows
access to kernel printf's, /dev/oldmsgs.  This driver is similar to the
osm driver that's been around System V for sometim.  The old beta version
of X11R2 which I'm still running does a "tail -f /dev/oldmsgs" in the
startup script.  This also seems to disable kernel printf's output to
/dev/console.

Second, there's an ioctl in the console streams driver which diverts output
coming from user processes to this pseudo-device.  Used together, these
two features should provide the capability you want.  The following code
demonstrates this streams ioctl; if you haven't used System V streams this
will look a little weird....

#include <sys/video.h>
#include <sys/stropts.h>

main(argc, argv)
int argc;
char **argv;
{
        struct strioctl i;

        if (atoi(*++argv))
                i.ic_cmd = CONS_REDIRECT;
        else
                i.ic_cmd = CONS_UNDIRECT;
        i.ic_timout = i.ic_dp = i.ic_len = 0;

        if (ioctl(0, I_STR, &i) == -1) {
                perror("ioctl");
                exit(1);
        }

        exit(0);
}

The usage of this program should be something like "redirect 1 < /dev/console"
to turn on redirection and "redirect 0 < /dev/console" to turn it off.

>Ken Mandelberg      | km at mathcs.emory.edu          PREFERRED
>Emory University    | {decvax,gatech}!emory!km     UUCP 
>Dept of Math and CS | km at emory.bitnet              NON-DOMAIN BITNET  
>Atlanta, GA 30322   | Phone: (404) 727-7963

John Sovereign		| "Hold Quality undefined.  That's the secret."
UniSoft Corporation	|	-- Robert Pirsig,
uunet!unisoft!john	|	Zen and the Art of Motorcycle Maintenance



More information about the Comp.unix.aux mailing list