Ignore:
Timestamp:
2018-09-24T15:36:21Z (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:
34c76e2f
Parents:
631281d
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-24 15:02:32)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-24 15:36:21)
Message:

Make libposix headers understand _FILE_OFFSET_BITS and _LARGEFILE64_SOURCE

File:
1 edited

Legend:

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

    r631281d r97b1dfc2  
    8080extern ssize_t read(int fildes, void *buf, size_t nbyte);
    8181extern ssize_t write(int fildes, const void *buf, size_t nbyte);
    82 extern off_t lseek(int fildes,
    83     off_t offset, int whence);
    8482extern int fsync(int fildes);
    8583extern int ftruncate(int fildes, off_t length);
     
    8886extern int dup(int fildes);
    8987extern int dup2(int fildes, int fildes2);
     88
     89#ifdef _LARGEFILE64_SOURCE
     90extern off64_t lseek64(int fildes, off64_t offset, int whence);
     91#endif
     92
     93#if _FILE_OFFSET_BITS == 64
     94static 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}
     103#else
     104extern off_t lseek(int fildes, off_t offset, int whence);
     105#endif
    90106
    91107/* Standard Streams */
Note: See TracChangeset for help on using the changeset viewer.