drawing to the root window (hack hack)

Rick Genter x18 reg at lti.com
Wed Apr 26 13:46:40 AEST 1989


> As a digression, I should mention that there is approximately a 25%
> failure chance for a program whose first two executable lines are:

>   root_fd = open("/dev/win0");
>   root_pixwin = pw_open(root_fd);


If these are the two lines verbatim, then no kidding it fails at random.
open(2) takes 2 or 3 arguments, but never 1.  You want to do:

	root_fd = open("/dev/win0",O_RDONLY);

as it is, you're passing garbage as your second argument.  The third
argument is only used for O_CREAT.  By the way, O_* are defined in
<sys/file.h>.  (Actually in <sys/fcntlcom.h>, but that's included by
<sys/file.h> [SunOS 4.0*].)

If you're going to hack, at least use lint(1).
					- reg
--
Rick Genter					...!{buita,bbn}!lti!reg
Language Technology, Inc.			reg%lti.uucp at bu-it.bu.edu
27 Congress St., Salem, MA 01970		(508) 741-1507



More information about the Comp.sys.sun mailing list