2013/3/4 Jacques Pelletier <jpellet...@ieee.org>:
> Le 2013-03-04 01:49, Theo de Raadt a écrit :
>
>>> For use in the GUI of an application, I need to have a list of detected
>>> serial and parallel ports. This list is used to fill a combo box where
>>> the user select the port to use (example: in Windows, it would be a list
>>> with COM1,COM2, etc.
>>>
>>> On OpenBSD, how can we retrieve the detected serial and parallel ports?
>> There is no clean machine-independent way.
>>
>> You could perhaps do something like use the output of pstat -t, but
>> remove the console and pseudo-ttys, and you would probably be OK.
>>
>> The console devices will be somewhat machine dependent, but the
>> pseudo-ttys
>> are easy to spot.
>>
>>
> Is it possible to do this in C?

Since pstat is written in C, the answer most obviously would be "yes"

> Also, what are the name of the serial devices?

Differs on different platforms and type of devices. USB-serials wont
be named as onboard serial ports and so on.

-- 
May the most significant bit of your life be positive.

Reply via email to