aboutsummaryrefslogtreecommitdiffstats
path: root/man/man2/tee.2
diff options
context:
space:
mode:
Diffstat (limited to 'man/man2/tee.2')
-rw-r--r--man/man2/tee.222
1 files changed, 11 insertions, 11 deletions
diff --git a/man/man2/tee.2 b/man/man2/tee.2
index 0b91b2b5b2..33b2b8b684 100644
--- a/man/man2/tee.2
+++ b/man/man2/tee.2
@@ -14,7 +14,7 @@ Standard C library
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.P
-.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " len \
+.BI "ssize_t tee(int " fd_in ", int " fd_out ", size_t " size \
", unsigned int " flags );
.fi
.\" Return type was long before glibc 2.7
@@ -27,7 +27,7 @@ Standard C library
.\" one pipe to two other pipes.
.BR tee ()
duplicates up to
-.I len
+.I size
bytes of data from the pipe referred to by the file descriptor
.I fd_in
to the pipe referred to by the file descriptor
@@ -147,7 +147,7 @@ int
main(int argc, char *argv[])
{
int fd;
- ssize_t len, slen;
+ ssize_t size, ssize;
\&
if (argc != 2) {
fprintf(stderr, "Usage: %s <file>\[rs]n", argv[0]);
@@ -164,28 +164,28 @@ main(int argc, char *argv[])
/*
* tee stdin to stdout.
*/
- len = tee(STDIN_FILENO, STDOUT_FILENO,
+ size = tee(STDIN_FILENO, STDOUT_FILENO,
INT_MAX, SPLICE_F_NONBLOCK);
- if (len < 0) {
+ if (size < 0) {
if (errno == EAGAIN)
continue;
perror("tee");
exit(EXIT_FAILURE);
}
- if (len == 0)
+ if (size == 0)
break;
\&
/*
* Consume stdin by splicing it to a file.
*/
- while (len > 0) {
- slen = splice(STDIN_FILENO, NULL, fd, NULL,
- len, SPLICE_F_MOVE);
- if (slen < 0) {
+ while (size > 0) {
+ ssize = splice(STDIN_FILENO, NULL, fd, NULL,
+ size, SPLICE_F_MOVE);
+ if (ssize < 0) {
perror("splice");
exit(EXIT_FAILURE);
}
- len \-= slen;
+ size \-= ssize;
}
}
\&