I have to count pulses that come through the serial port.
I found a lot of info about reading characters, but that doesn't work.
In windows C++ there is the function waitforsingleobject(). Does something like that exist in linux C++?
Maybe the select() function is what you are looking for.
Use it to monitor the file in /dev that corresponds to you serial port (probably /dev/ttyS0). See "man select".