Changes in / [59f74a2:365e423]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/iocall.cfa
r59f74a2 r365e423 108 108 109 109 extern ssize_t read (int fd, void *buf, size_t count); 110 111 extern ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags); 112 extern ssize_t tee(int fd_in, int fd_out, size_t len, unsigned int flags); 110 113 } 111 114 … … 342 345 } 343 346 344 345 347 ssize_t cfa_read(int fd, void *buf, size_t count) { 346 348 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READ) … … 362 364 363 365 (*sqe){ IORING_OP_WRITE, fd, buf, count, 0 }; 366 367 __submit_wait 368 #endif 369 } 370 371 ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) { 372 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SPLICE) 373 return splice( fd_in, off_in, fd_out, off_out, len, flags ); 374 #else 375 __submit_prelude 376 377 (*sqe){ IORING_OP_SPLICE, fd_out, 0p, len, off_out }; 378 sqe->splice_fd_in = fd_in; 379 sqe->splice_off_in = off_in; 380 sqe->splice_flags = flags; 381 382 __submit_wait 383 #endif 384 } 385 386 ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags) { 387 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_TEE) 388 return tee( fd_in, fd_out, len, flags ); 389 #else 390 __submit_prelude 391 392 (*sqe){ IORING_OP_TEE, fd_out, 0p, len, 0 }; 393 sqe->splice_fd_in = fd_in; 394 sqe->splice_flags = flags; 364 395 365 396 __submit_wait … … 466 497 #define _CFA_IO_FEATURE_IORING_OP_WRITE , 467 498 return IS_DEFINED(IORING_OP_WRITE); 499 500 if( /*func == (fptr_t)splice || */ 501 func == (fptr_t)cfa_splice ) 502 #define _CFA_IO_FEATURE_IORING_OP_SPLICE , 503 return IS_DEFINED(IORING_OP_SPLICE); 504 505 if( /*func == (fptr_t)tee || */ 506 func == (fptr_t)cfa_tee ) 507 #define _CFA_IO_FEATURE_IORING_OP_TEE , 508 return IS_DEFINED(IORING_OP_TEE); 468 509 #endif 469 510
Note: See TracChangeset
for help on using the changeset viewer.