Problem was different. In test program is necessary to call fflush(stdout) and it works fine then. Hope this will help someone . Thanks for help.