@spot & samo79
I tryed it some time ago, check this out:
here1. <sys/mman.h> (all those mmap, READ_PROT, MAP_PRIVATE, etc). Uses in 2 files, pretty easy to replace on malloc() & co.
2. Pty.cpp use <termios.h>. What mean all those: IXOFF, IXON, IXOFF, VERASE, tcgetpgrp() and + some stuff from termios (like struct ::termios blabla). Kpty.cpp also uses all that stuff , + some other (which i think KDE related). After that i not going futher, because its understanable that easy port will not be done, and need some reall-hardcore rewriting.