
#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/vfs.h>

//static char buf[98304];
static char buf[4096] __attribute__ ((aligned(4096)));

struct stat statbuf;
struct statfs vfsbuf;

int main(int argc, char *argv[])
{
	const char *f= argv[1];
	int fd= open(f, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU | S_IRGRP);

	//pwrite(fd, buf, 1, 0);
	close(fd);

	fd= open(f, O_RDWR|O_CLOEXEC|O_DIRECT);
	//fcntl(fd, F_SETFL, O_DIRECT);
	//fstat(fd, &statbuf);
	//fstatfs(fd, &vfsbuf);
	//fallocate(fd, 0, 0, sizeof(buf));

	//write(fd, buf, sizeof(buf));
	pwrite(fd, buf, sizeof(buf), 0);
	close(fd);
}
