Lines Matching refs:fd

92 prepare_address_space (int fd, size_t total, size_t *reserved, int *xflags,  in prepare_address_space()  argument
97 void *p = mmap64 (NULL, RESERVE_MMAP_SIZE, PROT_NONE, MAP_SHARED, fd, 0); in prepare_address_space()
122 int fd; in create_archive() local
130 fd = mkstemp (fname); in create_archive()
131 if (fd == -1) in create_archive()
162 if (TEMP_FAILURE_RETRY (write (fd, &head, sizeof (head))) != sizeof (head)) in create_archive()
169 if (ftruncate64 (fd, total) != 0) in create_archive()
179 void *p = prepare_address_space (fd, total, &reserved, &xflags, &mmap_base, in create_archive()
183 p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0); in create_archive()
199 close (fd); in create_archive()
217 if (fchmod (fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) == -1) in create_archive()
226 ah->fd = fd; in create_archive()
295 if (fstat64 (ah->fd, &st) != 0) in file_data_available_p()
304 ah->fd, start); in file_data_available_p()
321 if (pread (ah->fd, p2, size, offset2) != size) in compare_from_file()
335 int fd; in enlarge_archive() local
352 if (fstat64 (ah->fd, &st) != 0) in enlarge_archive()
358 MAP_SHARED | MAP_FIXED, ah->fd, 0); in enlarge_archive()
366 MAP_SHARED, ah->fd, 0); in enlarge_archive()
377 fd = mkstemp (fname); in enlarge_archive()
378 if (fd == -1) in enlarge_archive()
424 if (TEMP_FAILURE_RETRY (write (fd, &newhead, sizeof (newhead))) in enlarge_archive()
432 if (ftruncate64 (fd, total) != 0) in enlarge_archive()
442 void *p = prepare_address_space (fd, total, &reserved, &xflags, &mmap_base, in enlarge_archive()
446 p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0); in enlarge_archive()
455 if (lockf64 (fd, F_LOCK, total) != 0) in enlarge_archive()
466 new_ah.fd = fd; in enlarge_archive()
532 if (fchmod (fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) == -1) in enlarge_archive()
561 int fd; in open_archive() local
580 fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); in open_archive()
581 if (fd == -1) in open_archive()
599 ah->fd = -1; in open_archive()
611 if (fstat64 (fd, &st) < 0) in open_archive()
615 if (!readonly && lockf64 (fd, F_LOCK, sizeof (struct locarhead)) == -1) in open_archive()
617 close (fd); in open_archive()
641 (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead)); in open_archive()
642 close (fd); in open_archive()
651 if (TEMP_FAILURE_RETRY (read (fd, &head, sizeof (head))) != sizeof (head)) in open_archive()
653 (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead)); in open_archive()
660 (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead)); in open_archive()
664 ah->fd = fd; in open_archive()
670 void *p = prepare_address_space (fd, st.st_size, &reserved, &xflags, in open_archive()
676 MAP_SHARED | xflags, fd, 0); in open_archive()
679 (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead)); in open_archive()
691 if (ah->fd != -1) in close_archive()
697 close (ah->fd); in close_archive()
1007 lastpos = lseek64 (ah->fd, 0, SEEK_END); in add_locale()
1022 if (TEMP_FAILURE_RETRY (write (ah->fd, zeros, sz) != sz)) in add_locale()
1034 if (TEMP_FAILURE_RETRY (write (ah->fd, zeros, 16 - (lastpos & 15))) in add_locale()
1046 if (TEMP_FAILURE_RETRY (write (ah->fd, data[cnt].addr, data[cnt].size)) in add_locale()
1455 int fd; in add_locales_to_archive() local
1458 fd = open64 (fullname, O_RDONLY); in add_locales_to_archive()
1459 if (fd == -1 || fstat64 (fd, &st) == -1) in add_locales_to_archive()
1462 if (fd != -1) in add_locales_to_archive()
1463 close (fd); in add_locales_to_archive()
1470 close (fd); in add_locales_to_archive()
1475 fd = open64 (fullname, O_RDONLY); in add_locales_to_archive()
1476 if (fd == -1 || fstat64 (fd, &st) == -1 in add_locales_to_archive()
1479 if (fd != -1) in add_locales_to_archive()
1480 close (fd); in add_locales_to_archive()
1487 fd, 0); in add_locales_to_archive()
1491 close (fd); in add_locales_to_archive()
1499 close (fd); in add_locales_to_archive()