1 /*******************************************************************************
2 * The BYTE UNIX Benchmarks - Release 3
3 * Module: pipe.c SID: 3.3 5/15/91 19:30:20
5 *******************************************************************************
6 * Bug reports, patches, comments, suggestions should be sent to:
8 * Ben Smith, Rick Grehan or Tom Yager
9 * ben@bytepb.byte.com rick_g@bytepb.byte.com tyager@bytepb.byte.com
11 *******************************************************************************
13 * $Header: pipe.c,v 3.5 87/06/22 14:32:36 kjmcdonell Beta $
14 * August 29, 1990 - modified timing routines (ty)
15 * October 22, 1997 - code cleanup to remove ANSI C compiler warnings
16 * Andy Kahn <kahn@zk3.dec.com>
18 ******************************************************************************/
19 char SCCSid
[] = "@(#) @(#)pipe.c:3.3 -- 5/15/91 19:30:20";
21 * pipe -- test single process pipe throughput (no context switching)
34 fprintf(stderr
,"COUNT|%ld|1|lps\n", iter
);
38 int main(int argc
, char *argv
[])
41 int pvec
[2], duration
;
44 fprintf(stderr
,"Usage: %s duration\n", argv
[0]);
48 duration
= atoi(argv
[1]);
52 wake_me(duration
, report
);
56 if (write(pvec
[1], buf
, sizeof(buf
)) != sizeof(buf
)) {
57 if ((errno
!= EINTR
) && (errno
!= 0))
58 fprintf(stderr
,"write failed, error %d\n", errno
);
60 if (read(pvec
[0], buf
, sizeof(buf
)) != sizeof(buf
)) {
61 if ((errno
!= EINTR
) && (errno
!= 0))
62 fprintf(stderr
,"read failed, error %d\n", errno
);