Search Postgresql Archives

Re: Why can't lseek the STDIN_FILENO?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"=?gb18030?B?V2VuIFlp?=" <896634148@xxxxxx> writes:
> &nbsp;&nbsp; &nbsp;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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux