• Home
  • Raw
  • Download

Lines Matching refs:fname

101 int os_write_file(const char *fname, const void *buf, int size)  in os_write_file()  argument
105 fd = os_open(fname, OS_O_WRONLY | OS_O_CREAT | OS_O_TRUNC); in os_write_file()
107 printf("Cannot open file '%s'\n", fname); in os_write_file()
111 printf("Cannot write to file '%s'\n", fname); in os_write_file()
120 int os_read_file(const char *fname, void **bufp, int *sizep) in os_read_file() argument
126 fd = os_open(fname, OS_O_RDONLY); in os_read_file()
128 printf("Cannot open file '%s'\n", fname); in os_read_file()
133 printf("Cannot seek to end of file '%s'\n", fname); in os_read_file()
137 printf("Cannot seek to start of file '%s'\n", fname); in os_read_file()
142 printf("Not enough memory to read file '%s'\n", fname); in os_read_file()
147 printf("Cannot read from file '%s'\n", fname); in os_read_file()
400 char *fname; in os_dirent_ls() local
413 fname = os_malloc(len); in os_dirent_ls()
414 if (!fname) { in os_dirent_ls()
434 old_fname = fname; in os_dirent_ls()
435 fname = os_realloc(fname, len); in os_dirent_ls()
436 if (!fname) { in os_dirent_ls()
460 snprintf(fname, len, "%s/%s", dirname, next->name); in os_dirent_ls()
461 if (!stat(fname, &buf)) in os_dirent_ls()
472 os_free(fname); in os_dirent_ls()
491 int os_get_filesize(const char *fname, loff_t *size) in os_get_filesize() argument
496 ret = stat(fname, &buf); in os_get_filesize()
514 int os_write_ram_buf(const char *fname) in os_write_ram_buf() argument
519 fd = open(fname, O_CREAT | O_WRONLY, 0777); in os_write_ram_buf()
530 int os_read_ram_buf(const char *fname) in os_read_ram_buf() argument
536 ret = os_get_filesize(fname, &size); in os_read_ram_buf()
541 fd = open(fname, O_RDONLY); in os_read_ram_buf()
553 static int make_exec(char *fname, const void *data, int size) in make_exec() argument
557 strcpy(fname, "/tmp/u-boot.jump.XXXXXX"); in make_exec()
558 fd = mkstemp(fname); in make_exec()
564 if (chmod(fname, 0777)) in make_exec()
628 static int os_jump_to_file(const char *fname) in os_jump_to_file() argument
652 extra_args[1] = (char *)fname; in os_jump_to_file()
661 argv[0] = (char *)fname; in os_jump_to_file()
671 err = execv(fname, argv); in os_jump_to_file()
675 printf("Image filename '%s'\n", fname); in os_jump_to_file()
679 return unlink(fname); in os_jump_to_file()
684 char fname[30]; in os_jump_to_image() local
687 err = make_exec(fname, dest, size); in os_jump_to_image()
691 return os_jump_to_file(fname); in os_jump_to_image()
694 int os_find_u_boot(char *fname, int maxlen) in os_find_u_boot() argument
706 strcpy(fname, progname); in os_find_u_boot()
707 suffix = fname + len - 4; in os_find_u_boot()
711 fname[len - 3] = 's'; in os_find_u_boot()
712 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
719 p = strstr(fname, "/tpl/"); in os_find_u_boot()
722 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
733 fname[len - 4] = '\0'; in os_find_u_boot()
734 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
742 p = strstr(fname, "spl/"); in os_find_u_boot()
746 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
756 int os_spl_to_uboot(const char *fname) in os_spl_to_uboot() argument
758 return os_jump_to_file(fname); in os_spl_to_uboot()