Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/tee-overflow/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


cpu% ramfs
cpu% echo a | tee `{seq 1 1000}
tee 62609: warning: process exceeds 100 file descriptors
tee 62609: warning: process exceeds 200 file descriptors
tee 62609: suicide: sys: trap: fault write addr=0x9000 pc=0x00001200
cpu% echo a | /sys/src/cmd/8.tee `{seq 1 1000}
8.tee 62651: warning: process exceeds 100 file descriptors
8.tee 62651: warning: process exceeds 200 file descriptors
8.tee 62651: warning: process exceeds 300 file descriptors
8.tee 62651: warning: process exceeds 400 file descriptors
8.tee 62651: warning: process exceeds 500 file descriptors
8.tee 62651: warning: process exceeds 600 file descriptors
8.tee 62651: warning: process exceeds 700 file descriptors
8.tee 62651: warning: process exceeds 800 file descriptors
8.tee 62651: warning: process exceeds 900 file descriptors
8.tee 62651: warning: process exceeds 1000 file descriptors
a
cpu% ls -l | wc -l
   1000
cpu% 
	
If you dislike the dynamic alloc, optionally one could keep the
array for 100 files swapping in a malloc-ed one only when there 
are 100+ arguments provided.

NB: a previous version of this patch failed to allow room for 
the stdout descriptor to be added to the array. 

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].