1 | char *pipeAdult = "\\\\.\\pipe\\anyname"; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | // // Create named pipe in Windows // nbytes -- block size from command line arguments. // int mult = 1; int x; x = mult*nbytes + 24; handleA = CreateNamedPipe(pipeAdult, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE, 2, // two connections x, // input buffer size x, // output buffer size INFINITE, // timeout NULL); // security if(handleA == INVALID_HANDLE_VALUE) { printf("CreateNamedPipe() FAILED: err=%d ", GetLastError()); return 1; } handleB = CreateFile(pipeAdult, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(handleB == INVALID_HANDLE_VALUE) { printf("CreateFile() FAILED: err=%d ", GetLastError()); return 1; } |
1 2 3 4 5 6 | int fd1[2]; if(pipe(fd1)) { printf("pipe() FAILED: errno=%d ",errno); return 1; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | list="1 2 3 4 6 8 10 12 14 16 20 24 28 32 36 40 44 48 52 56 60 64 72 80 88" list="$list 96 104 112 120 128 144 160 176 192 208 224 240 256 288 320 352" list="$list 384 416 448 480 512 576 640 704 768 832 896 960 1024 1280 1536" list="$list 1792 2048 2560 3k 3584 4k" uname -s -r for bytes in $list do case $bytes in ----|?k ) count=100k;; ----?|--k) count=100k;; ?|--|--? ) count=500k;; esac pipespeed2 $count $bytes done |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |