Changeset e1801fc


Ignore:
Timestamp:
Jul 10, 2020, 4:18:36 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:
f5d4f62
Parents:
365e423
Message:

Added support for non-blocking sendfile

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r365e423 re1801fc  
    398398}
    399399
     400ssize_t cfa_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
     401        return cfa_splice(in_fd, offset, out_fd, 0p, count, 0);
     402}
     403
    400404//-----------------------------------------------------------------------------
    401405// Check if a function is asynchronous
     
    499503
    500504                if( /*func == (fptr_t)splice || */
    501                         func == (fptr_t)cfa_splice )
     505                        func == (fptr_t)cfa_splice ||
     506                        func == (fptr_t)cfa_sendfile )
    502507                        #define _CFA_IO_FEATURE_IORING_OP_SPLICE ,
    503508                        return IS_DEFINED(IORING_OP_SPLICE);
  • libcfa/src/concurrency/iofwd.hfa

    r365e423 re1801fc  
    1616#pragma once
    1717
    18 ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
    19 ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
    20 int cfa_fsync(int fd);
    21 int cfa_sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags);
    22 ssize_t cfa_sendmsg(int sockfd, const struct msghdr *msg, int flags);
    23 ssize_t cfa_recvmsg(int sockfd, struct msghdr *msg, int flags);
    24 ssize_t cfa_send(int sockfd, const void *buf, size_t len, int flags);
    25 ssize_t cfa_recv(int sockfd, void *buf, size_t len, int flags);
    26 int cfa_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
    27 int cfa_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
    28 int cfa_fallocate(int fd, int mode, uint64_t offset, uint64_t len);
    29 int cfa_fadvise(int fd, uint64_t offset, uint64_t len, int advice);
    30 int cfa_madvise(void *addr, size_t length, int advice);
    31 int cfa_openat(int dirfd, const char *pathname, int flags, mode_t mode);
    32 int cfa_close(int fd);
    33 int cfa_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf);
    34 ssize_t cfa_read(int fd, void *buf, size_t count);
    35 ssize_t cfa_write(int fd, void *buf, size_t count)
     18extern "C" {
     19        #include <sys/types.h>
     20}
     21
     22extern ssize_t cfa_preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
     23extern ssize_t cfa_pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags);
     24extern int cfa_fsync(int fd);
     25extern int cfa_sync_file_range(int fd, int64_t offset, int64_t nbytes, unsigned int flags);
     26extern ssize_t cfa_sendmsg(int sockfd, const struct msghdr *msg, int flags);
     27extern ssize_t cfa_recvmsg(int sockfd, struct msghdr *msg, int flags);
     28extern ssize_t cfa_send(int sockfd, const void *buf, size_t len, int flags);
     29extern ssize_t cfa_recv(int sockfd, void *buf, size_t len, int flags);
     30extern int cfa_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
     31extern int cfa_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
     32extern int cfa_fallocate(int fd, int mode, uint64_t offset, uint64_t len);
     33extern int cfa_fadvise(int fd, uint64_t offset, uint64_t len, int advice);
     34extern int cfa_madvise(void *addr, size_t length, int advice);
     35extern int cfa_openat(int dirfd, const char *pathname, int flags, mode_t mode);
     36extern int cfa_close(int fd);
     37extern int cfa_statx(int dirfd, const char *pathname, int flags, unsigned int mask, struct statx *statxbuf);
     38extern ssize_t cfa_read(int fd, void *buf, size_t count);
     39extern ssize_t cfa_write(int fd, void *buf, size_t count);
     40extern ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);
     41extern ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags);
     42extern ssize_t cfa_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
    3643
    3744//-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.