#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
	int fd = open("/proc/sys/vm/drop_caches", O_WRONLY, O_SYNC);
	if (-1 == fd)
		perror("opening");

	int written = write(fd, "3", 1);
	if (1!=written)
		perror("writing");

	if (0 != close(fd))
		perror("closing");

	return written;
}

