Lines Matching refs:ref
910 dup_elf (int fildes, Elf_Cmd cmd, Elf *ref)
916 fildes = ref->fildes;
919 else if (unlikely (ref->fildes != -1 && fildes != ref->fildes))
928 if (unlikely (ref->cmd != ELF_C_READ && ref->cmd != ELF_C_READ_MMAP
929 && ref->cmd != ELF_C_WRITE && ref->cmd != ELF_C_WRITE_MMAP
930 && ref->cmd != ELF_C_RDWR && ref->cmd != ELF_C_RDWR_MMAP
931 && ref->cmd != ELF_C_READ_MMAP_PRIVATE))
940 if (ref->kind != ELF_K_AR)
942 ++ref->ref_count;
943 return ref;
950 if (ref->state.ar.elf_ar_hdr.ar_name == NULL
951 && __libelf_next_arhdr_wrlock (ref) != 0)
957 result = read_file (fildes, ref->state.ar.offset + sizeof (struct ar_hdr),
958 ref->state.ar.elf_ar_hdr.ar_size, cmd, ref);
963 result->next = ref->state.ar.children;
964 ref->state.ar.children = result;
1001 elf_begin (fildes, cmd, ref)
1004 Elf *ref;
1015 if (ref != NULL)
1017 rwlock_rdlock (ref->lock);
1028 if (ref->kind == ELF_K_AR)
1030 rwlock_unlock (ref->lock);
1031 rwlock_wrlock (ref->lock);
1035 return dup_elf (fildes, cmd, ref);
1047 if (unlikely (ref != NULL && ref->cmd != ELF_C_READ_MMAP_PRIVATE))
1057 if (ref != NULL)
1066 /* If we have a REF object it must also be opened using this
1068 if (ref != NULL)
1070 if (unlikely (ref->cmd != ELF_C_RDWR && ref->cmd != ELF_C_RDWR_MMAP
1071 && ref->cmd != ELF_C_WRITE
1072 && ref->cmd != ELF_C_WRITE_MMAP))
1074 /* This is not ok. REF must also be opened for writing. */
1088 /* We ignore REF and prepare a descriptor to write a new file. */
1099 if (ref != NULL)
1100 rwlock_unlock (ref->lock);