#include <sys/types.h>
int
-main ()
+main (int argc, char **argv)
{
- off_t pos = ftello (stdin);
- (void)pos;
-
- return 0;
+ /* Assume stdin is seekable iff argc > 1. */
+ int expected = argc > 1 ? 0 : -1;
+ /* Exit with success only if ftell/ftello agree. */
+ off_t pos1 = ftello (stdin);
+ long pos2 = ftell (stdin);
+ return ! (pos1 == pos2 && pos1 == expected);
}