- Timestamp:
- Jul 10, 2020, 2:21:47 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 365e423
- Parents:
- fb98462
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/iocall.cfa
rfb98462 r0a92c78 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 … … 329 332 } 330 333 331 332 334 ssize_t cfa_read(int fd, void *buf, size_t count) { 333 335 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_READ) … … 349 351 350 352 (*sqe){ IORING_OP_WRITE, fd, buf, count, 0 }; 353 354 __submit_wait 355 #endif 356 } 357 358 ssize_t cfa_splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags) { 359 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_SPLICE) 360 return splice( fd_in, off_in, fd_out, off_out, len, flags ); 361 #else 362 __submit_prelude 363 364 (*sqe){ IORING_OP_SPLICE, fd_out, 0p, len, off_out }; 365 sqe->splice_fd_in = fd_in; 366 sqe->splice_off_in = off_in; 367 sqe->splice_flags = flags; 368 369 __submit_wait 370 #endif 371 } 372 373 ssize_t cfa_tee(int fd_in, int fd_out, size_t len, unsigned int flags) { 374 #if !defined(HAVE_LINUX_IO_URING_H) || !defined(IORING_OP_TEE) 375 return tee( fd_in, fd_out, len, flags ); 376 #else 377 __submit_prelude 378 379 (*sqe){ IORING_OP_TEE, fd_out, 0p, len, 0 }; 380 sqe->splice_fd_in = fd_in; 381 sqe->splice_flags = flags; 351 382 352 383 __submit_wait … … 453 484 #define _CFA_IO_FEATURE_IORING_OP_WRITE , 454 485 return IS_DEFINED(IORING_OP_WRITE); 486 487 if( /*func == (fptr_t)splice || */ 488 func == (fptr_t)cfa_splice ) 489 #define _CFA_IO_FEATURE_IORING_OP_SPLICE , 490 return IS_DEFINED(IORING_OP_SPLICE); 491 492 if( /*func == (fptr_t)tee || */ 493 func == (fptr_t)cfa_tee ) 494 #define _CFA_IO_FEATURE_IORING_OP_TEE , 495 return IS_DEFINED(IORING_OP_TEE); 455 496 #endif 456 497
Note: See TracChangeset
for help on using the changeset viewer.