when I execute code as i pasted, it returns an error as segmentation error. I print gethostname(), it can return right value. Also if I execute this code in other machine, i