1 .TH tee 2 2006-04-28 "Linux 2.6.17" "Linux Programmer's Manual"
3 tee \- duplicating pipe content.
5 .B #include <sys/splice.h>
7 .B long tee(int fd_in, int fd_out, size_t bytes, unsigned int flags);
18 is a series of modifier flags, which share the name space with
32 More data will be coming in a subsequent splice.
41 copies the data between the two pipes, in reality no real data copying
42 takes place though. Under the covers,
44 assigns data in the output by merely grabbing a reference to the input.
47 Upon successful completion,
49 shall return the number of bytes that was duplicated between the input
50 and output. Otherwise, it shall return a value of -1 and
52 shall be set to indicate an error.
60 do not both refer to a pipe.
66 The following example implements a basic
70 system call. To keep it simple, it has no real error handling.
76 #include <sys/splice.h>
78 int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
82 * tee stdin to stdout.
84 int len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
95 * Consume stdin by splicing it to a file.
98 int slen = splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
113 system call first appeared in Linux-2.6.17.
120 Jens Axboe <axboe@kernel.dk>