Nepto [9/4/2002] ---------------- This doesn't work. It should print /etc/passwd file exactly 4 times. But it is printed sometimes 2 times, sometimes only one. cat /etc/passwd | ./ep -ii -oo -ee cat -- -ii -oo -ee cat -- -ii -oo -ee cat -- -ii -oo -ee cat OK, it is fixed now. Try this to see it works. cat /etc/passwd | ./ep -ii -oo -ee cat -- -ii -oo -ee cat -- -ii -oo -ee cat -- -ii -oo -ee cat | grep ^ondrej | wc -l Or you can try also this: ./ep -ee cat /etc/passwd -- -i1.o -oo -ee cat -- -i1.o -oo -ee cat -- -i1.o -oo -ee cat -- -i1.o -oo -ee cat | grep ^ondrej | wc -l This doesn't work. It is probably due to blocked write() syscall. Data transfer is really slow in these examples. cat /usr/lib/* | hexdump | ./ep -ii -oo -ee cat cat /usr/lib/* | ./ep -ii -oo -ee cat | hexdump Nepto [17/02/2002] ------------------ This doesn't work: ( while [ 1 -eq 1 ]; do cat /etc/passwd; done ) | ./ep -ii -o 2.i cat -- -o 3.i cat -- -o 4.i cat -- -o 5.i cat -- -o 6.i cat -- -o 7.i cat -- -o 8.i cat -- -o 9.i cat -- -o 0.o cat Still doesn't work. It is due to blocked write(). Nepto [5/2/2002] ---------------- Stream oriented applications doesn't work properly. In example, program cat works, rev does not work. Why? * cat uses filedescriptor access to standart input/output via read()/write() syscalls * rev uses stream oriented (FILE *) access to standart input/output viac glibc functions such as fread()/fwrite(), fgets()/fputs() and so on This bug behaviour is, that rev will wait to have full some internal buffer (input or output, I don't know) and than are data read/written. But when rev is runned via bash, like this: ps xf | rev It works properly. And there is no buffering. But when it is runned this way: ./ep -o 2.i -e 2.i ps xf -- -o 0.o rev It does not work properly. Try it please. strace -f bash -c 'ps xf | rev > /dev/null' 2>&1 | less --- IMPORTANT --- strace -f ./ep -ii -o 2.i -e 2.i cat -- -o 0.o rev [-- rev --] read(0, @ <----[ '@' was typed ] [-- ep --] <... select resumed> ) = 1 (in [0]) [-- ep --] read(0, "@\n", 5000) = 2 [-- ep --] write(4, "@\n", 2 [-- cat --] <... read resumed> "@\n", 4096) = 2 [-- cat --] write(1, "@\n", 2) = 2 [-- cat --] read(0, [-- ep --] <... write resumed> ) = 2 [-- ep --] select(1024, [0 5 7 11], NULL, NULL, NULL) = 1 (in [5]) [-- ep --] read(5, "@\n", 5000) = 2 [-- ep --] write(10, "@\n", 2) = 2 [-- ep --] select(1024, [0 5 7 11], NULL, NULL, NULL [-- rev --] <... read resumed> "@\n", 4096) = 2 [-- rev --] fstat64(1, {st_dev=makedev(0, 6), st_ino=62749743, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=502, st_gid=100, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2002/02/05-14:46:17, st_mtime=2002/02/05-14:46:17, st_ctime=2002/02/05-14:46:17}) = 0 [-- rev --] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40177000 [-- rev --] fstat64(1, {st_dev=makedev(0, 6), st_ino=62749743, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=502, st_gid=100, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2002/02/05-14:46:17, st_mtime=2002/02/05-14:46:17, st_ctime=2002/02/05-14:46:17}) = 0 [-- rev --] old_mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40178000 [-- rev --] read(0, strace -f bash -c 'cat | rev' [-- rev --] read(0, @ <----[ '@' was typed ] [-- cat --] <... read resumed> "@\n", 4096) = 2 [-- cat --] write(1, "@\n", 2) = 2 [-- cat --] read(0, [-- rev --] <... read resumed> "@\n", 4096) = 2 [-- rev --] fstat64(1, {st_dev=makedev(0, 7), st_ino=8, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=502, st_gid=100, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 6), st_atime=2002/02/05-14:45:00, st_mtime=2002/02/05-14:45:00, st_ctime=2002/02/05-02:19:22}) = 0 [-- rev --] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40177000 [-- rev --] ioctl(1, TCGETS, {c_iflags=0x500, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x90\x72\x14\x40\x80"}) = 0 [-- rev --] fstat64(1, {st_dev=makedev(0, 7), st_ino=8, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=502, st_gid=100, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 6), st_atime=2002/02/05-14:45:00, st_mtime=2002/02/05-14:45:00, st_ctime=2002/02/05-02:19:22}) = 0 [-- rev --] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40178000 [-- rev --] ioctl(1, TCGETS, {c_iflags=0x500, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x2f\x00\x70\x17\x40\x00\x20\x17\x40\x90\x72\x14\x40\x07"}) = 0 [-- rev --] write(1, "@\n", 2@ <----[ '@' was written to terminal ] ) = 2 [-- rev --] read(0, Rajo [09/04/2001] ---------------- - v procesoch-potomkoch nie su pozatvarane nepotrebne deskriptory, co sposobuje, ze procesy sa zle ukoncuju Rajo [09/04/2001] ---------------- - chyba: - neprenositelne na solaris/sparc : configure zbehlo, ale : main.c:141: `sys_errlist' undeclared (first use in this function) * The symbols _sys_errlist and _sys_nerr are not visible in the * LP64 libc. Use strerror(3C) instead. process.c:19: getopt.h: No such file or directory