Thanks for that reminder Winni... even I use Lazarus as an IDE most of the time rather than vi and make.
One reason I was being cautious was that OP doesn't say what OS he's running, and I really don't want to guess where the RTL has ended up for (in particular) Windows.
The file itself is serial.pp, there's one version for unix (Linux/SunOS) and another for Windows. It's intentionally low-level, i.e. as near the OS as possible, and benefits from a good understanding of threads etc... I think I needed to monitor multiple ports and capture accurate timing when I worked on it.
MarkMLl