版權所有 © 2014 tutorialspoint
#define _GNU_SOURCE #include <fcntl.h> long splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len ", unsigned int " flags );
long splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len ", unsigned int " flags );
如果fd_in指向管道,則off_in必須為NULL。如果fd_in不指向管道且off_in為NULL,則從當前檔案偏移量開始讀取fd_in中的位元組,並相應調整當前檔案偏移量。如果fd_in不指向管道且off_in不為NULL,則off_in必須指向一個緩衝區,該緩衝區指定從fd_in讀取位元組的起始偏移量;在這種情況下,fd_in的當前檔案偏移量不會更改。類似的陳述適用於out_fd和off_out。
flags引數是一個位掩碼,它由將以下一個或多個值組合在一起形成。
發生錯誤時,splice()返回-1,並設定errno以指示錯誤。
sendfile (2)
splice (2)
tee (2)
廣告