#include <stdio.h>

main()
{
	FILE *fp;
	long pos;

	if ((fp = fopen("foo", "r")) == NULL) {
		printf("Cannot open foo.\en");
		exit(1);
	}

	/*
	 * seek to the beginning of the file and
	 * print our byte position.
	 */
	pos = fseek(fp, 0L, 0);
	printf("Position = %d\en", pos);

	/*
	 * Seek 10 bytes from the beginning
	 * and print our position.
	 */
	pos = fseek(fp, 10L, 0);
	printf("Position = %d\en", pos);

	/*
	 * Seek to the end of file and
	 * print our position.
	 */
	pos = fseek(fp, 0L, 2);
	printf("Position = %d\en", pos);
}
