Changeset 59f388a in mainline
- Timestamp:
- 2017-04-04T20:56:47Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 51774cd
- Parents:
- 8fe46a0
- Location:
- uspace/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
r8fe46a0 r59f388a 834 834 off64_t ftell(FILE *stream) 835 835 { 836 /* The native position is too large for the C99-ish interface. */ 837 if (stream->pos - stream->ungetc_chars > INT64_MAX) 838 return EOF; 839 836 840 if (stream->error) 837 841 return EOF; -
uspace/lib/posix/source/sys/stat.c
r8fe46a0 r59f388a 49 49 * @param dest POSIX stat struct. 50 50 * @param src HelenOS stat struct. 51 * 52 * @return 0 on success, -1 on error. 51 53 */ 52 static voidstat_to_posix(struct posix_stat *dest, struct stat *src)54 static int stat_to_posix(struct posix_stat *dest, struct stat *src) 53 55 { 54 56 memset(dest, 0, sizeof(struct posix_stat)); … … 68 70 dest->st_nlink = src->lnkcnt; 69 71 dest->st_size = src->size; 72 73 if (src->size > INT64_MAX) { 74 errno = ERANGE; 75 return -1; 76 } 77 78 return 0; 70 79 } 71 80 … … 83 92 if (rc < 0) 84 93 return -1; 85 stat_to_posix(st, &hst); 86 return 0; 94 return stat_to_posix(st, &hst); 87 95 } 88 96 … … 113 121 if (rc < 0) 114 122 return -1; 115 stat_to_posix(st, &hst); 116 return 0; 123 return stat_to_posix(st, &hst); 117 124 } 118 125 -
uspace/lib/posix/source/unistd.c
r8fe46a0 r59f388a 245 245 break; 246 246 } 247 if (posix_pos[fildes] > INT64_MAX) { 248 /* The native width is too large for the POSIX interface. */ 249 errno = ERANGE; 250 return -1; 251 } 247 252 return posix_pos[fildes]; 248 253 }
Note:
See TracChangeset
for help on using the changeset viewer.