Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!emory!att!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul Falstad) Newsgroups: comp.unix.questions Subject: Re: ioctl TIOCSTI question Message-ID: <7110@idunno.Princeton.EDU> Date: 13 Mar 91 04:12:00 GMT References: Sender: news@idunno.Princeton.EDU Organization: League For Fighting Chartered Accountancy Lines: 24 sono!mayer@sun.com (Ronald &) wrote: >On a sparcstation, SunOS 4.1 I am having a problem using the termio >ioctl TIOCSTI [simulate terminal input] when using gcc. While it >works as expected under cc, under gcc I get an "Inappropriate ioctl >for device" error message. Any ideas what I'm missing? >/* This program works differently under gcc and cc. Why? */ > ioctl_return = ioctl(fd,TIOCSTI,&a); Most ioctl's have this problem with ANSI C compilers. The offending code is stuff like this in : #define _IOW(x,y,t) (_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y) #define TIOCSTI _IOW(t, 114, char) /* simulate terminal input */ Putting a macro argument in single quotes is non-ANSI. The solution is to run the fixincludes script that comes with gcc. (Note that I erroneously called this problem a bug in gcc in the zsh documentation.) -- pfalstad@phoenix.princeton.edu The Germans are disputing it! Hegel is arguing that the reality is merely an a priori adjunct of non-absolutistic ethics; Kant, by the categorical imperative, is holding it ontologically exists only in the imagination; and Marx is claiming it was off sides.