serial.pp on macos lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Jonny · 2022-05-02 16:50 I wrote simple app that sends and receives strings via rs232. It uses serial.pp included in packages/rtl-extra. There exists both a windows and *nix version: fpcsrc/packages/rtl-extra/src/win/serial.pp fpcsrc/packages/rtl-extra/src/unix/serial.pp My only computer runs Linux so I cross compile as required. Does anyone know if serial.pp will compile / run on macos? ---------------------------------------------------------------------- MarkMLl · 2022-05-03 06:18 See this recent thread (please note that the forum has a search facility): https://forum.lazarus.freepascal.org/index.php/topic,58709.0.html I did the last maintenance on that unit, but had no Mac on which to test it. I'd expect the unix variant to work without problems except possibly for the functions that use the select() syscall, where there are two possibilities depending on whether or not select() updates the parameter block on exit. My understanding- which could be wrong- is that the Mac's operating system is BSD-like, so would expect that using the Solaris/SunOS-style select() would be appropriate. MarkMLl ---------------------------------------------------------------------- Jonny · 2022-05-03 15:19 Thank you MarkMLI, yes I had searched and found the other thread but was unsure of what was meant by a select() syscall and also if cross- compiling had any impact on the result. Can you explain what Solaris/SunOS-style select() means and how I can enable it? I have been away from development for a long time and have no experience with Mac so please forgive my "newbie" questions (as the youngsters would say!). ---------------------------------------------------------------------- MarkMLl · 2022-05-03 15:46 Look at the comments near the end of the unit: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Note: this variant of fpSelect() is a thin wrapper around the kernel's syscall.// In the case of Linux the syscall DOES update the timeout parameter....// Note: this variant of fpSelect() is a thin wrapper around the kernel's syscall.// In the case of Solaris the syscall DOES NOT update the timeout parameter.  select() (as a unix syscall) and fpSelect() (as a Pascal wrapper) takes a collection of file handles as parameters, plus a timeout. It returns either when there is activity associated with one of the handles, or when the timeout expires. Linux updates the timeout parameter before exit, while SunOS/Solaris doesn't, so on Linux you can see how long an overall timeout has left on the clock. Or something like that. It's a good 15 years since I worked on that, and I'm not as young as I used to be either :-) This shouldn't affect compilation, or code that doesn't use the four- parameter variant of SerReadTimeout(). And since the conditional tests for Linux rather than for SunOS etc., if the Mac's OS- as a Berkeley derivative- works the same then it should be OK without modification. Note the test programs posted in the other thread, but the stty stuff is untested on anything other than Linux. MarkMLl