"=?gb18030?B?V2VuIFlp?=" <896634148@xxxxxx> writes: > lseek(STDIN_FILENO, 0, SEEK_SET); If you are not checking for failure return from a system call, you are in a state of sin. > I really don't know, why the buffer's content not be "Hello world\n"? Probably because a tty input device is not seekable. regards, tom lane