Ignore:
Timestamp:
2018-09-25T18:33:23Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
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)
Message:

libposix: Correctly disambiguate other uses of off_t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/include/posix/unistd.h

    r5e6b76d ref84413  
    8181extern ssize_t write(int fildes, const void *buf, size_t nbyte);
    8282extern int fsync(int fildes);
    83 extern int ftruncate(int fildes, off_t length);
    8483extern int rmdir(const char *path);
    8584extern int unlink(const char *path);
     
    8988#ifdef _LARGEFILE64_SOURCE
    9089extern off64_t lseek64(int fildes, off64_t offset, int whence);
     90extern int ftruncate64(int fildes, off64_t length);
    9191#endif
    9292
    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__
     95extern off_t lseek(int fildes, off_t offset, int whence) __asm__("lseek64");
     96extern int ftruncate(int fildes, off_t length) __asm__("ftruncate64");
     97#else
     98extern off_t lseek64(int fildes, off_t offset, int whence);
     99extern int ftruncate64(int fildes, off_t length);
     100#define lseek lseek64
     101#define ftruncate ftruncate64
     102#endif
    103103#else
    104104extern off_t lseek(int fildes, off_t offset, int whence);
     105extern int ftruncate(int fildes, off_t length);
    105106#endif
    106107
Note: See TracChangeset for help on using the changeset viewer.