Ignore:
Timestamp:
May 5, 2020, 4:58:23 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
cbabfd4
Parents:
b1ac7dd (diff), 08a994e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io.cfa

    rb1ac7dd r4385e8b  
    724724        #include <sys/socket.h>
    725725        #include <sys/syscall.h>
     726
     727#if defined(HAVE_PREADV2)
    726728        struct iovec;
    727729        extern ssize_t preadv2 (int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
     730#endif
     731#if defined(HAVE_PWRITEV2)
     732        struct iovec;
    728733        extern ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
     734#endif
    729735
    730736        extern int fsync(int fd);
     
    752758//-----------------------------------------------------------------------------
    753759// Asynchronous operations
    754 ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
    755         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV)
    756                 return preadv2(fd, iov, iovcnt, offset, flags);
    757         #else
    758                 __submit_prelude
    759 
    760                 (*sqe){ IORING_OP_READV, fd, iov, iovcnt, offset };
    761 
    762                 __submit_wait
    763         #endif
    764 }
    765 
    766 ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
    767         #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITEV)
    768                 return pwritev2(fd, iov, iovcnt, offset, flags);
    769         #else
    770                 __submit_prelude
    771 
    772                 (*sqe){ IORING_OP_WRITEV, fd, iov, iovcnt, offset };
    773 
    774                 __submit_wait
    775         #endif
    776 }
     760#if defined(HAVE_PREADV2)
     761        ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
     762                #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READV)
     763                        return preadv2(fd, iov, iovcnt, offset, flags);
     764                #else
     765                        __submit_prelude
     766
     767                        (*sqe){ IORING_OP_READV, fd, iov, iovcnt, offset };
     768
     769                        __submit_wait
     770                #endif
     771        }
     772#endif
     773
     774#if defined(HAVE_PWRITEV2)
     775        ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) {
     776                #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_WRITEV)
     777                        return pwritev2(fd, iov, iovcnt, offset, flags);
     778                #else
     779                        __submit_prelude
     780
     781                        (*sqe){ IORING_OP_WRITEV, fd, iov, iovcnt, offset };
     782
     783                        __submit_wait
     784                #endif
     785        }
     786#endif
    777787
    778788int cfa_fsync(int fd) {
     
    10021012                        return IS_DEFINED(IORING_OP_READV);
    10031013
    1004                 if( /*func == (fptr_t)pwritev2 || */
    1005                         func == (fptr_t)cfa_pwritev2 )
    1006                         #define _CFA_IO_FEATURE_IORING_OP_WRITEV ,
    1007                         return IS_DEFINED(IORING_OP_WRITEV);
    1008 
    1009                 if( /*func == (fptr_t)fsync || */
    1010                         func == (fptr_t)cfa_fsync )
    1011                         #define _CFA_IO_FEATURE_IORING_OP_FSYNC ,
    1012                         return IS_DEFINED(IORING_OP_FSYNC);
     1014                #if defined(HAVE_PREADV2)
     1015                        if( /*func == (fptr_t)pwritev2 || */
     1016                                func == (fptr_t)cfa_pwritev2 )
     1017                                #define _CFA_IO_FEATURE_IORING_OP_WRITEV ,
     1018                                return IS_DEFINED(IORING_OP_WRITEV);
     1019                #endif
     1020
     1021                #if defined(HAVE_PWRITEV2)
     1022                        if( /*func == (fptr_t)fsync || */
     1023                                func == (fptr_t)cfa_fsync )
     1024                                #define _CFA_IO_FEATURE_IORING_OP_FSYNC ,
     1025                                return IS_DEFINED(IORING_OP_FSYNC);
     1026                #endif
    10131027
    10141028                if( /*func == (fptr_t)ync_file_range || */
Note: See TracChangeset for help on using the changeset viewer.