Changeset ed903174 in mainline for uspace/app
- Timestamp:
- 2010-02-10T23:51:23Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e70edd1
- Parents:
- b32c604f
- Location:
- uspace/app
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/bdd/bdd.c
rb32c604f red903174 73 73 size_t block_size; 74 74 int rc; 75 bn_t ba;75 aoff64_t ba; 76 76 uint8_t b; 77 77 -
uspace/app/bdsh/cmds/modules/cat/cat.c
rb32c604f red903174 85 85 { 86 86 int fd, bytes = 0, count = 0, reads = 0; 87 off _t total = 0;87 off64_t total = 0; 88 88 char *buff = NULL; 89 89 -
uspace/app/bdsh/cmds/modules/cp/cp.c
rb32c604f red903174 74 74 { 75 75 int fd1, fd2, bytes = 0; 76 off _t total = 0;76 off64_t total = 0; 77 77 int64_t copied = 0; 78 78 char *buff = NULL; -
uspace/app/mkfat/mkfat.c
rb32c604f red903174 98 98 size_t block_size; 99 99 char *endptr; 100 bn_t dev_nblocks;100 aoff64_t dev_nblocks; 101 101 102 102 cfg.total_sectors = 0; … … 160 160 printf(NAME ": Warning, failed to obtain block device size.\n"); 161 161 } else { 162 printf(NAME ": Block device has %" PRIu BN" blocks.\n",162 printf(NAME ": Block device has %" PRIuOFF64 " blocks.\n", 163 163 dev_nblocks); 164 164 cfg.total_sectors = dev_nblocks; … … 236 236 static int fat_blocks_write(struct fat_params const *par, dev_handle_t handle) 237 237 { 238 bn_t addr;238 aoff64_t addr; 239 239 uint8_t *buffer; 240 240 int i; -
uspace/app/taskdump/elf_core.c
rb32c604f red903174 62 62 #include "include/elf_core.h" 63 63 64 static off _t align_foff_up(off_t foff, uintptr_t vaddr, size_t page_size);64 static off64_t align_foff_up(off64_t foff, uintptr_t vaddr, size_t page_size); 65 65 static int write_all(int fd, void *data, size_t len); 66 66 static int write_mem_area(int fd, as_area_info_t *area, int phoneid); … … 79 79 * ENOMEM on out of memory, EIO on write error. 80 80 */ 81 int elf_core_save(const char *file_name, as_area_info_t *ainfo, int n, int phoneid)81 int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n, int phoneid) 82 82 { 83 83 elf_header_t elf_hdr; 84 off _t foff;84 off64_t foff; 85 85 size_t n_ph; 86 86 elf_word flags; … … 89 89 int fd; 90 90 int rc; 91 int i;91 unsigned int i; 92 92 93 93 n_ph = n; … … 184 184 185 185 for (i = 0; i < n_ph; ++i) { 186 if (lseek(fd, p_hdr[i].p_offset, SEEK_SET) == (off _t) -1) {186 if (lseek(fd, p_hdr[i].p_offset, SEEK_SET) == (off64_t) -1) { 187 187 printf("Failed writing memory data.\n"); 188 188 free(p_hdr); … … 202 202 203 203 /** Align file offset up to be congruent with vaddr modulo page size. */ 204 static off_t align_foff_up(off_t foff, uintptr_t vaddr, size_t page_size) 205 { 206 off_t rfo, rva; 207 off_t advance; 208 209 rva = vaddr % page_size; 210 rfo = foff % page_size; 211 212 advance = (rva >= rfo) ? rva - rfo : (page_size + rva - rfo); 213 return foff + advance; 204 static off64_t align_foff_up(off64_t foff, uintptr_t vaddr, size_t page_size) 205 { 206 off64_t rva = vaddr % page_size; 207 off64_t rfo = foff % page_size; 208 209 if (rva >= rfo) 210 return (foff + (rva - rfo)); 211 212 return (foff + (page_size + (rva - rfo))); 214 213 } 215 214 -
uspace/app/taskdump/include/elf_core.h
rb32c604f red903174 36 36 #define ELF_CORE_H_ 37 37 38 int elf_core_save(const char *file_name, as_area_info_t *ainfo, int n, int phoneid);38 int elf_core_save(const char *file_name, as_area_info_t *ainfo, unsigned int n, int phoneid); 39 39 40 40 #endif -
uspace/app/taskdump/symtab.c
rb32c604f red903174 49 49 static int section_hdr_load(int fd, const elf_header_t *ehdr, int idx, 50 50 elf_section_header_t *shdr); 51 static int chunk_load(int fd, off _t start, off_t size, void **ptr);51 static int chunk_load(int fd, off64_t start, size_t size, void **ptr); 52 52 static int read_all(int fd, void *buf, size_t len); 53 53 … … 65 65 elf_header_t elf_hdr; 66 66 elf_section_header_t sec_hdr; 67 off_t shstrt_start, shstrt_size; 67 off64_t shstrt_start; 68 size_t shstrt_size; 68 69 char *shstrt, *sec_name; 69 70 void *data; … … 307 308 rc = lseek(fd, elf_hdr->e_shoff + idx * sizeof(elf_section_header_t), 308 309 SEEK_SET); 309 if (rc == (off _t) -1)310 if (rc == (off64_t) -1) 310 311 return EIO; 311 312 … … 328 329 * @return EOK on success or EIO on failure. 329 330 */ 330 static int chunk_load(int fd, off _t start, off_t size, void **ptr)331 static int chunk_load(int fd, off64_t start, size_t size, void **ptr) 331 332 { 332 333 int rc; 333 334 334 335 rc = lseek(fd, start, SEEK_SET); 335 if (rc == (off _t) -1) {336 if (rc == (off64_t) -1) { 336 337 printf("failed seeking chunk\n"); 337 338 *ptr = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.