uos.pas adapted for fpc 2.7.x