Changeset ce04ea44 in mainline for uspace/app
- Timestamp:
- 2017-04-02T12:27:14Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d4067a7
- Parents:
- 163fc09
- Location:
- uspace/app
- Files:
-
- 11 edited
-
bdsh/cmds/modules/cat/cat.c (modified) (1 diff)
-
bdsh/cmds/modules/cmp/cmp.c (modified) (1 diff)
-
bdsh/cmds/modules/cp/cp.c (modified) (2 diffs)
-
bdsh/cmds/modules/mkfile/mkfile.c (modified) (2 diffs)
-
sysinst/futil.c (modified) (3 diffs)
-
taskdump/elf_core.c (modified) (6 diffs)
-
taskdump/symtab.c (modified) (3 diffs)
-
tester/mm/pager1.c (modified) (1 diff)
-
tester/vfs/vfs1.c (modified) (2 diffs)
-
viewer/viewer.c (modified) (1 diff)
-
websrv/websrv.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
r163fc09 rce04ea44 251 251 } 252 252 253 bytes = read(fd, &pos, buff + copied_bytes, bytes_to_read);253 bytes = vfs_read(fd, &pos, buff + copied_bytes, bytes_to_read); 254 254 copied_bytes = 0; 255 255 -
uspace/app/bdsh/cmds/modules/cmp/cmp.c
r163fc09 rce04ea44 94 94 ssize_t size; 95 95 do { 96 size = read(fd[i], &pos[i],96 size = vfs_read(fd[i], &pos[i], 97 97 buffer[i] + offset[i], 98 98 CMP_BUFLEN - offset[i]); 99 99 if (size < 0) { 100 rc = errno;100 rc = size; 101 101 printf("Error reading from %s\n", 102 102 fn[i]); -
uspace/app/bdsh/cmds/modules/cp/cp.c
r163fc09 rce04ea44 413 413 } 414 414 415 while ((bytes = read(fd1, &posr, buff, blen)) > 0) {416 if ((bytes = write(fd2, &posw, buff, bytes)) < 0)415 while ((bytes = vfs_read(fd1, &posr, buff, blen)) > 0) { 416 if ((bytes = vfs_write(fd2, &posw, buff, bytes)) < 0) 417 417 break; 418 418 copied += bytes; … … 420 420 421 421 if (bytes < 0) { 422 printf("\nError copying %s, (%d)\n", src, errno);422 printf("\nError copying %s, (%d)\n", src, bytes); 423 423 copied = bytes; 424 424 } -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r163fc09 rce04ea44 166 166 167 167 pos = file_size - 1; 168 rc2 = write(fd, &pos, &byte, sizeof(char));168 rc2 = vfs_write(fd, &pos, &byte, sizeof(char)); 169 169 if (rc2 < 0) { 170 170 vfs_put(fd); … … 183 183 while (total_written < file_size) { 184 184 to_write = min(file_size - total_written, BUFFER_SIZE); 185 rc = write(fd, &pos, buffer, to_write);185 rc = vfs_write(fd, &pos, buffer, to_write); 186 186 if (rc <= 0) { 187 187 printf("%s: Error writing file (%d).\n", cmdname, errno); -
uspace/app/sysinst/futil.c
r163fc09 rce04ea44 72 72 73 73 do { 74 nr = read(sf, &posr, buf, BUF_SIZE);74 nr = vfs_read(sf, &posr, buf, BUF_SIZE); 75 75 if (nr == 0) 76 76 break; … … 78 78 return EIO; 79 79 80 nw = write(df, &posw, buf, nr);80 nw = vfs_write(df, &posw, buf, nr); 81 81 if (nw <= 0) 82 82 return EIO; … … 178 178 } 179 179 180 nr = read(sf, (aoff64_t []) { 0 }, data, fsize);180 nr = vfs_read(sf, (aoff64_t []) { 0 }, data, fsize); 181 181 if (nr != (ssize_t)fsize) { 182 182 vfs_put(sf); -
uspace/app/taskdump/elf_core.c
r163fc09 rce04ea44 207 207 } 208 208 209 rc = write(fd, &pos, &elf_hdr, sizeof(elf_hdr));209 rc = vfs_write(fd, &pos, &elf_hdr, sizeof(elf_hdr)); 210 210 if (rc != sizeof(elf_hdr)) { 211 211 printf("Failed writing ELF header.\n"); … … 215 215 216 216 for (i = 0; i < n_ph; ++i) { 217 rc = write(fd, &pos, &p_hdr[i], sizeof(p_hdr[i]));217 rc = vfs_write(fd, &pos, &p_hdr[i], sizeof(p_hdr[i])); 218 218 if (rc != sizeof(p_hdr[i])) { 219 219 printf("Failed writing program header.\n"); … … 232 232 note.type = NT_PRSTATUS; 233 233 234 rc = write(fd, &pos, ¬e, sizeof(elf_note_t));234 rc = vfs_write(fd, &pos, ¬e, sizeof(elf_note_t)); 235 235 if (rc != sizeof(elf_note_t)) { 236 236 printf("Failed writing note header.\n"); … … 239 239 } 240 240 241 rc = write(fd, &pos, "CORE", note.namesz);241 rc = vfs_write(fd, &pos, "CORE", note.namesz); 242 242 if (rc != (ssize_t) note.namesz) { 243 243 printf("Failed writing note header.\n"); … … 248 248 pos = ALIGN_UP(pos, word_size); 249 249 250 rc = write(fd, &pos, &pr_status, sizeof(elf_prstatus_t));250 rc = vfs_write(fd, &pos, &pr_status, sizeof(elf_prstatus_t)); 251 251 if (rc != sizeof(elf_prstatus_t)) { 252 252 printf("Failed writing register data.\n"); … … 310 310 } 311 311 312 rc = write(fd, pos, buffer, to_copy);312 rc = vfs_write(fd, pos, buffer, to_copy); 313 313 if (rc != (ssize_t) to_copy) { 314 314 printf("Failed writing memory contents.\n"); -
uspace/app/taskdump/symtab.c
r163fc09 rce04ea44 88 88 } 89 89 90 rc = read(fd, &pos, &elf_hdr, sizeof(elf_header_t));90 rc = vfs_read(fd, &pos, &elf_hdr, sizeof(elf_header_t)); 91 91 if (rc != sizeof(elf_header_t)) { 92 92 printf("failed reading elf header\n"); … … 306 306 aoff64_t pos = elf_hdr->e_shoff + idx * sizeof(elf_section_header_t); 307 307 308 rc = read(fd, &pos, sec_hdr, sizeof(elf_section_header_t));308 rc = vfs_read(fd, &pos, sec_hdr, sizeof(elf_section_header_t)); 309 309 if (rc != sizeof(elf_section_header_t)) 310 310 return EIO; … … 335 335 } 336 336 337 rc = read(fd, &pos, *ptr, size);337 rc = vfs_read(fd, &pos, *ptr, size); 338 338 if (rc != (ssize_t) size) { 339 339 printf("failed reading chunk\n"); -
uspace/app/tester/mm/pager1.c
r163fc09 rce04ea44 53 53 (void) vfs_unlink_path(TEST_FILE); 54 54 55 if ( write(fd, (aoff64_t []) {0}, text, sizeof(text)) != sizeof(text)) {55 if (vfs_write(fd, (aoff64_t []) {0}, text, sizeof(text)) < 0) { 56 56 vfs_put(fd); 57 57 return NULL; -
uspace/app/tester/vfs/vfs1.c
r163fc09 rce04ea44 85 85 86 86 size_t size = sizeof(text); 87 ssize_t cnt = write(fd0, &pos, text, size);87 ssize_t cnt = vfs_write(fd0, &pos, text, size); 88 88 if (cnt < 0) 89 89 return "write() failed"; … … 94 94 char buf[BUF_SIZE]; 95 95 TPRINTF("read..\n"); 96 while ((cnt = read(fd0, &pos, buf, BUF_SIZE))) {96 while ((cnt = vfs_read(fd0, &pos, buf, BUF_SIZE))) { 97 97 TPRINTF("read returns %zd\n", cnt); 98 98 if (cnt < 0) -
uspace/app/viewer/viewer.c
r163fc09 rce04ea44 126 126 } 127 127 128 ssize_t rd = read(fd, (aoff64_t []) {0}, tga, stat.size);128 ssize_t rd = vfs_read(fd, (aoff64_t []) {0}, tga, stat.size); 129 129 if ((rd < 0) || (rd != (ssize_t) stat.size)) { 130 130 free(tga); -
uspace/app/websrv/websrv.c
r163fc09 rce04ea44 240 240 aoff64_t pos = 0; 241 241 while (true) { 242 ssize_t nr = read(fd, &pos, fbuf, BUFFER_SIZE);242 ssize_t nr = vfs_read(fd, &pos, fbuf, BUFFER_SIZE); 243 243 if (nr == 0) 244 244 break;
Note:
See TracChangeset
for help on using the changeset viewer.
