[Twisted-Python] Two things in twisted.internet.process

1. I noticed that when Process.__init__ prepares to execute the child process, it closes all fd's from 3 to 255. Is it possible for the child process to inherit open files with fd's greater than 255? I'm concerned that this could happen on busy servers, but this is one aspect of Unix about which I don't know much. 2. To increase consistency with the usual interface between transports and protocols, I think it would be good to implement a loseConnection method in the Process class that does what closeStdin does now. -- Matt Campbell Email and MSN Messenger: mattcampbell@pobox.com Phone: (316) 652-8727 Web site: http://www.pobox.com/~mattcampbell/

On Sun, Jul 28, 2002 at 03:19:39PM -0500, Matt Campbell wrote:
fcntl(fd, F_SETFD, FD_CLOEXEC). On _all_ fds one does not want to share with children. Make the kernel do the work, it's the only sane way. -- tv@{{hq.yok.utu,havoc,gaeshido}.fi,{debian,wanderer}.org,stonesoft.com} double a,b=4,c;main(){for(;++a<2e6;c-=(b=-b)/a++);printf("%f\n",c);}

On Sun, Jul 28, 2002 at 03:19:39PM -0500, Matt Campbell wrote:
fcntl(fd, F_SETFD, FD_CLOEXEC). On _all_ fds one does not want to share with children. Make the kernel do the work, it's the only sane way. -- tv@{{hq.yok.utu,havoc,gaeshido}.fi,{debian,wanderer}.org,stonesoft.com} double a,b=4,c;main(){for(;++a<2e6;c-=(b=-b)/a++);printf("%f\n",c);}
participants (2)
-
Matt Campbell
-
Tommi Virtanen