[Python-Dev] Syscall Proxying in Python

Gabriel Becedillas gabriel.becedillas at corest.com
Tue Aug 2 20:59:58 CEST 2005

Donovan Baarda wrote:
> On Mon, 2005-08-01 at 10:36, Gabriel Becedillas wrote:
>>We embbeded Python 2.0.1 in our product a few years ago and we'd like to
>>upgrade to Python 2.4.1. This was not a simple task, because we needed 
>>to execute syscalls on a remote host. We modified Python's source code 
>>in severall places to call our own versions of some functions. For 
>>example, instead of calling fopen(...), the source code was modified to 
>>call remote_fopen(...), and the same was done with other libc functions. 
>>Socket functions where hooked too (we modified socket.c), Windows 
>>Registry functions, etc..
> Wow... you guys sure did it the hard way. If you had done it at the
> Python level, you would have had a much easier time of both implementing
> and updating it.
> As an example, have a look at my osVFS stuff. This is a replacement for
> the os module and open() that tricks Python into using a virtual file
> system;
> http://minkirri.apana.org.au/~abo/projects/osVFS

Hi, thanks for your reply.
The problem I see with the aproach you're sugesting is that I have to 
rewrite a lot of code to make it work the way I want. We allready have 
the syscall proxying stuff with an stdio layer on top of it. I should 
have to rewrite some parts of some modules and use my own versions of 
stdio functions, and that is pretty much the same as we have done before.
There are also native objects that use stdio functions, and I should 
replace those ones too, or modules that have some native code that uses 
stdio, or sockets. I should duplicate those files, and make the same 
kind of search/replace work that we have done previously and that we'd 
like to avoid.
Please let me know if I misunderstood you.
Thanks again.


Gabriel Becedillas

Florida 141 - 2º cuerpo - 7º piso
C1005AAC Buenos Aires - Argentina
Tel/Fax: (54 11) 5032-CORE (2673)

More information about the Python-Dev mailing list