Xref: utzoo misc.wanted:10387 comp.unix.wizards:23007 comp.unix.questions:23961 comp.sys.ibm.pc.rt:1760 comp.unix.aix:1376 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!vuecon!gerards From: gerards@econ.vu.nl (Gerard Strijdveen) Newsgroups: misc.wanted,eunet.general,nlnet.general,vunet.general,vu.general,comp.unix.wizards,comp.unix.questions,comp.sys.ibm.pc.rt,comp.unix.aix,eunet.news Subject: How to port sgttyb in BSD4.3 application to termio in sysV rel 2 Keywords: port,termio,sgttyb,4.3,sys5,sysV Message-ID: <405@.econ.vu.nl> Date: 23 Jul 90 09:33:52 GMT Reply-To: gerards@econ.vu.nl (Gerard Strijdveen) Followup-To: misc.wanted,eunet.followup,nlnet.followup,vunet.followup,vu.general,comp.unix.wizards,comp.unix.questions,comp.sys.ibm.pc.rt,comp.unix.aix,eunet.news Organization: VU economics Amsterdam Lines: 26 The application I try to port has to read in ascii lines at 1200baud, 7 databits, 1 stopbit even parity. The lines all end with 'Carriage Return'. What is de sysV rel 2 code for the underneath routine (used in BSD4.3)? ------------------------------------------------------ /* set speed etc. of communication line */ open_line() { struct sgttyb ttybuf; close(0); if(fdc = open("/dev/ttyd0", 0) < 0) return(0); if(ioctl(0, TIOCEXCL, (char *)0) < 0 || ioctl(0, TIOCGETP, (char *)&ttybuf) < 0) return(0); ttybuf.sg_ispeed = B1200; ttybuf.sg_flags = 0; ttybuf.sg_flags |= XTABS|ECHO|FF1|CRMOD; if(ioctl(0, TIOCSETP, (char *)&ttybuf) < 0) return(0); return(1); } ------------------------------------------------------ AS you will expect, I am not an experienced C programmer and certainly not when serial lines handling is the topic. Please email directly to me: gerards@econ.vu.nl