*BSD News Article 36175


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!news.nd.edu!news1.oakland.edu!newsxfer.itd.umich.edu!zip.eecs.umich.edu!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (Terry Lambert)
Newsgroups: comp.os.386bsd.development
Subject: Re: Writing serial comm programs in FreeBSD 1.1.5
Date: 23 Sep 1994 07:12:16 GMT
Organization: Weber State University, Ogden, UT
Lines: 29
Message-ID: <35tv4g$hbp@u.cc.utah.edu>
References: <35rvfn$i94@acmex.gatech.edu>
NNTP-Posting-Host: cs.weber.edu

In article <35rvfn$i94@acmex.gatech.edu> gt4384a@prism.gatech.edu (Matthew W. Culbreth) writes:
] I'd like to start writing a serial comm program in FreeBSD 1.1.5.
] 
] I know that if you do this in DOS, you deal with some software interrupts
] to read any data out of the incoming character buffer.
] 
] How would I do this in FreeBSD?  Are there a set of system calls that I
] haven't found that allow me to catch interrupts from the system?
] 
] Or do I deal strictly with the stream devices?

Yes; this is what you do.

] If so, how do I know when a character is waiting to be read?

You use select(2) on the fd for the users keyboard and for the modem,
and select returns when there is data available on one or the other.

For an X based emulator, use XtRegisterAppInput(3Xt) to register a
callback for "data available" for the modem descriptor; it will be
called back by XtMainAppLoop.


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.