#include <utmp.h>

main()
{
	char *s;
	struct utmp *u;
	char *malloc();
	char *realloc();
	struct utmp *calloc();

	/*
	 * Get 1024 bytes of character memory.
	 */
	if ((s = malloc(1024)) == 0) {
		printf("Cannot allocate memory.\en");
		exit(1);
	}

	/*
	 * Get 5 utmp structures.
	 */
	if ((u = calloc(5, sizeof(struct utmp)) == 0) {
		printf("Cannot allocate memory.\en");
		exit(1);
	}

	/*
	 * Change s to 2048 bytes
	 */
	if ((s = realloc(1024)) == 0) {
		printf("Cannot allocate memory.\en");
		exit(1);
	}

	/*
	 * Free all memory.
	 */
	free(s);
	free(u);
}
