• Home
  • Raw
  • Download

Lines Matching refs:files

495   process_files = processCB->files;  in files_close_internal()
769 struct files_struct *files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); in alloc_files() local
770 if (!files) in alloc_files()
775 files->count = 1; in alloc_files()
776 files->file_lock = 0; in alloc_files()
777 files->next_fd = 3; in alloc_files()
779 spin_lock_init(&files->workdir_lock); in alloc_files()
780 memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); in alloc_files()
781 files->workdir[0] = '/'; in alloc_files()
783 files->fdt = alloc_fd_table(NR_OPEN_DEFAULT); in alloc_files()
784 if (!files->fdt) in alloc_files()
787 (VOID)LOS_MemFree(m_aucSysMem0, files); in alloc_files()
791 return files; in alloc_files()
798 struct files_struct *files = NULL; in dup_fd() local
803 files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); in dup_fd()
804 if(!files) in dup_fd()
809 files->count = 1; in dup_fd()
810 files->file_lock = 0; in dup_fd()
811 files->next_fd = old_files->next_fd; in dup_fd()
813 spin_lock_init(&files->workdir_lock); in dup_fd()
814 memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); in dup_fd()
815 strncpy_s(files->workdir, PATH_MAX - 1, old_files->workdir, PATH_MAX - 1); in dup_fd()
822 (VOID)LOS_MemFree(m_aucSysMem0, files); in dup_fd()
826 files->fdt = new_fdt; in dup_fd()
828 return files; in dup_fd()
839 void delete_files(struct files_struct *files) in delete_files() argument
841 if (files == NULL) in delete_files()
846 if (files->fdt == NULL) in delete_files()
851 for (int i = 0; i < files->fdt->max_fds; i++) in delete_files()
853 if (FD_ISSET(i, files->fdt->proc_fds)) in delete_files()
861 (VOID)sem_destroy(&files->fdt->ft_sem); in delete_files()
862 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->ft_fds); in delete_files()
863 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->proc_fds); in delete_files()
864 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt); in delete_files()
866 (VOID)LOS_MemFree(m_aucSysMem0, files); in delete_files()
874 struct files_struct *files = NULL; in create_files_snapshot() local
879 files = LOS_MemAlloc(m_aucSysMem0, sizeof(struct files_struct)); in create_files_snapshot()
880 if (!files) in create_files_snapshot()
885 files->count = 1; in create_files_snapshot()
886 files->file_lock = 0; in create_files_snapshot()
887 files->next_fd = old_files->next_fd; in create_files_snapshot()
889 spin_lock_init(&files->workdir_lock); in create_files_snapshot()
890 memset_s(files->workdir, PATH_MAX, 0, PATH_MAX); in create_files_snapshot()
891 strncpy_s(files->workdir, PATH_MAX - 1, old_files->workdir, PATH_MAX - 1); in create_files_snapshot()
898 (VOID)LOS_MemFree(m_aucSysMem0, files); in create_files_snapshot()
902 files->fdt = new_fdt; in create_files_snapshot()
904 return files; in create_files_snapshot()
908 void delete_files_snapshot(struct files_struct *files) in delete_files_snapshot() argument
910 if (files == NULL) in delete_files_snapshot()
914 if (files->fdt == NULL) in delete_files_snapshot()
919 (VOID)sem_destroy(&files->fdt->ft_sem); in delete_files_snapshot()
920 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->ft_fds); in delete_files_snapshot()
921 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt->proc_fds); in delete_files_snapshot()
922 (VOID)LOS_MemFree(m_aucSysMem0, files->fdt); in delete_files_snapshot()
924 (VOID)LOS_MemFree(m_aucSysMem0, files); in delete_files_snapshot()