add code for open tty by just c language