예제 #1
0
파일: mmapcopy.c 프로젝트: minhajksm/code
int main(int argc, char** argv) {

  if (argc != 2) {
    printf("Please specify file\n");
    exit(1);
  }

  mmapcopy(argv[1]);
}
예제 #2
0
파일: mmap.c 프로젝트: nagneeve/ecen324
int main(int argc, char**argv)
{
	struct stat stat;
	int fd;
	
	if(argc != 2) {
		printf("usage: %s <filename>\n", argv[0]);
		exit(0);
	}
	
	fd = open(argv[1], O_RDWR, 0);
	fstat(fd, &stat);
	mmapcopy(fd, stat.st_size);
	exit(0);

}
예제 #3
0
/* mmapcopy driver */
int main(int argc, char **argv) 
{
    struct stat stat;
    int fd;

    /* Check for required cmd line arg */
    if (argc != 2) {
	printf("usage: %s <filename>\n", 
	       argv[0]);
	exit(0);
    }

    /* Copy input file to stdout */
    fd = Open(argv[1], O_RDONLY, 0);
    Fstat(fd, &stat);
    mmapcopy(fd, stat.st_size);
    exit(0);
}
예제 #4
0
파일: mmapcopy+.c 프로젝트: weiang/C-codes
/* Mmapcopy driver */
int main(int argc, char *argv[])
{
	struct stat	stat;
	int	fd;

	/* Check for required command */
	if (argc != 2) {
		printf("Usage: %s <filename>\n", argv[1]);
		exit(EXIT_FAILURE);
	}

	/* Copy the input argument to stdout */
	fd = open(argv[1], O_RDONLY, 0);
	if (fd < 0)
		unix_error("Open error");

	fstat(fd, &stat);
	mmapcopy(fd, stat.st_size);
	exit(EXIT_SUCCESS);
}