#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int fd;
int n_write;
int n_read;
char buf[4096];
if((fd = open(argv[1], O_RDWR)) < 0) return 1;
while((n_read = read(fd, buf, 4096)) > 0)
;
lseek(fd, SEEK_SET, 0L);
strcpy(buf, "111111111111111");
n_write = write(fd, buf, strlen(buf));
printf("n_write %d\n", n_write);
close(fd);
return 0;
}
lseek(fd, 0L, SEEK_SET);
lseek(fd, 0L, SEEK_SET);