Changeset ef84413 in mainline
- Timestamp:
- 2018-09-25T18:33:23Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dc68f72
- Parents:
- 5e6b76d
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-25 17:42:45)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-25 18:33:23)
- Location:
- uspace/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
r5e6b76d ref84413 911 911 912 912 /* The native position is too large for the C99-ish interface. */ 913 if (off > LONG_MAX) 914 return EOF; 913 if (off > LONG_MAX) { 914 errno = EOVERFLOW; 915 return -1; 916 } 915 917 916 918 return off; -
uspace/lib/posix/include/posix/stdio.h
r5e6b76d ref84413 61 61 FILE *__restrict__ stream); 62 62 63 #ifdef _LARGEFILE64_SOURCE 64 extern int fseeko64(FILE *stream, off64_t offset, int whence); 65 extern off64_t ftello64(FILE *stream); 66 #endif 67 68 #if _FILE_OFFSET_BITS == 64 && LONG_MAX == INT_MAX 69 #ifdef __GNUC__ 70 extern int fseeko(FILE *stream, off_t offset, int whence) __asm__("fseeko64"); 71 extern off_t ftello(FILE *stream) __asm__("ftello64"); 72 #else 73 extern int fseeko64(FILE *stream, off_t offset, int whence); 74 extern off_t ftello64(FILE *stream); 75 #define fseeko fseeko64 76 #define ftello ftello64 77 #endif 78 #else 63 79 extern int fseeko(FILE *stream, off_t offset, int whence); 64 80 extern off_t ftello(FILE *stream); 81 #endif 65 82 66 83 /* Formatted Output */ -
uspace/lib/posix/include/posix/unistd.h
r5e6b76d ref84413 81 81 extern ssize_t write(int fildes, const void *buf, size_t nbyte); 82 82 extern int fsync(int fildes); 83 extern int ftruncate(int fildes, off_t length);84 83 extern int rmdir(const char *path); 85 84 extern int unlink(const char *path); … … 89 88 #ifdef _LARGEFILE64_SOURCE 90 89 extern off64_t lseek64(int fildes, off64_t offset, int whence); 90 extern int ftruncate64(int fildes, off64_t length); 91 91 #endif 92 92 93 #if _FILE_OFFSET_BITS == 64 94 static inline off_t lseek(int fildes, off_t offset, int whence) 95 { 96 /* Declarations visible in this function body only. */ 97 typedef int64_t off64_t; 98 extern off64_t lseek64(int fildes, off64_t offset, int whence);99 100 /* With _FILE_OFFSET_BITS == 64, lseek is actually lseek64. */ 101 return lseek64(fildes, offset, whence); 102 } 93 #if _FILE_OFFSET_BITS == 64 && LONG_MAX == INT_MAX 94 #ifdef __GNUC__ 95 extern off_t lseek(int fildes, off_t offset, int whence) __asm__("lseek64"); 96 extern int ftruncate(int fildes, off_t length) __asm__("ftruncate64"); 97 #else 98 extern off_t lseek64(int fildes, off_t offset, int whence); 99 extern int ftruncate64(int fildes, off_t length); 100 #define lseek lseek64 101 #define ftruncate ftruncate64 102 #endif 103 103 #else 104 104 extern off_t lseek(int fildes, off_t offset, int whence); 105 extern int ftruncate(int fildes, off_t length); 105 106 #endif 106 107 -
uspace/lib/posix/src/stdio.c
r5e6b76d ref84413 34 34 /** @file Standard buffered input/output. 35 35 */ 36 37 #define _LARGEFILE64_SOURCE 38 #undef _FILE_OFFSET_BITS 36 39 37 40 #include "internal/common.h" … … 181 184 int fseeko(FILE *stream, off_t offset, int whence) 182 185 { 183 return fseek 64(stream, offset, whence);186 return fseek(stream, offset, whence); 184 187 } 185 188 … … 191 194 */ 192 195 off_t ftello(FILE *stream) 196 { 197 return ftell(stream); 198 } 199 200 int fseeko64(FILE *stream, off64_t offset, int whence) 201 { 202 return fseek64(stream, offset, whence); 203 } 204 205 off64_t ftello64(FILE *stream) 193 206 { 194 207 return ftell64(stream); -
uspace/lib/posix/src/unistd.c
r5e6b76d ref84413 302 302 off_t lseek(int fildes, off_t offset, int whence) 303 303 { 304 #if LONG_MAX == INT64_MAX 304 #if LONG_MAX == INT_MAX 305 return _lseek(fildes, offset, LONG_MAX, whence); 306 #else 305 307 return _lseek64(fildes, offset, whence); 306 #else307 return _lseek(fildes, offset, LONG_MAX, whence);308 308 #endif 309 309 } … … 331 331 */ 332 332 int ftruncate(int fildes, off_t length) 333 { 334 return ftruncate64(fildes, length); 335 } 336 337 int ftruncate64(int fildes, off64_t length) 333 338 { 334 339 if (failed(vfs_resize(fildes, (aoff64_t) length)))
Note:
See TracChangeset
for help on using the changeset viewer.