[Openmcl-devel] patch: ability to create socket for given file descriptor number

Maciej Pasternacki maciej at pasternacki.net
Fri May 8 03:04:12 PDT 2009


Hello everyone,

I looked into possibility of using Clozure CL in shared Web hosting  
environment; Clozure may be really good in this kind of environment,  
because of more limits-friendly memory handling than SBCL.  Since I  
care for efficiency, plain CGI is out (if I thought about plain CGI, I  
could use clisp as well), and FastCGI seems to be one of most  
widespread standards at the moment.  Many shared hosting providers,  
however, don't provide possibility of running FastCGI servers outside  
of Web server on arbitrary port or socket, but support only fcgi  
scripts, that are spawned by Web server and receive a listening socket  
on stdin.  So, basically, I need to create a socket structure for  
standard input file descriptor (fd 0) and rebind basic streams.   
Second part is trivial; however, CCL doesn't seem to provide way to  
pass a file descriptor to any of socket-creating functions.  I looked  
a bit into l1-sockets.lisp and came up with a small patch, included  
here for review.

Patch adds FD as an accepted keyword argument to CCL:MAKE-SOCKET, and  
changes FD from auxilliary variable to a keyword argument in all  
downstream functions.  Downstream functions call c_socket only when FD  
argument wasn't supplied, otherwise trusting caller that given file  
descriptor is a descriptor for right kind of socket, and using it to  
create socket structure.

Patch is made against SVN trunk.

Regards,
Maciej.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccl-fdsocket.patch
Type: application/octet-stream
Size: 2360 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090508/8814a430/attachment.obj>
-------------- next part --------------


-- 
Maciej Pasternacki -><- http://www.pasternacki.net/ -><- http://www.3ofcoins.net/



More information about the Openmcl-devel mailing list