Use the fork() :-)

John E. Malmberg wb8tyw at qsl.net
Wed May 8 18:56:02 GMT 2002


Ulf Bertilsson wrote:
 > My os don't support fork() very well.

Neither does mine.  Yet.

 > However I should have good emulation wrapper for vfork().

Of an interesting note, I am told that if you are doing an exec() in the 
child, it is better to use vfork() than fork() as it is lower overhead. 
  But that is really outside my experience.

 > As I'm a newbie, how would a "best pratice" be to hack the source ?

For 2.0.x there are ways around this.  You can download the VMS specific 
changes at:

http://www.openvms.compaq.com/freeware/freeware50/samba/

The file: samba_vms_source_2_0_6_jem_1.zip contains the changes from the 
UNIX source.

The file SAMBA.MMS corresponds to the MAKEFILE.

What I have done is have the config.h  #include "config_vms.h" and put 
manual edits in the config_vms.h.

In the SAMBA.MMS (makefile.) for the CC command, a macro has been added 
that expands to -dMOD_$(module_name) for each module.

Then in the config_vms.h file there are module specific #defines.

An example:

#ifdef MOD_UTIL_SOCK

#define fork() (1)

#endif


This allows me to use macros to modify the actions of the source with 
out actually having to edit the source.

It works best when there are few routines per module.

For 2.2.x, I have started to use editor macros to massage some of the 
source modules.  That way I do not have to keep updating the VMS 
specific patches when I down load a change.

OpenVMS has feature that allows multiple directories to be read as if 
they were one directory.  The files are looked up in a hierarchical order.

I use one directory to contain the UNIX sources that my build procedure 
does not have write access to.

 > Any experince from other OS lacking this function ?
 >
 > Do both 2.0.X and 2.2.X use fork() ?

Yes.  2.0.X can be built with out the use of fork() if you do not
implement the test functions.


I have not worked out how to get around this limitation for 2.2.x and 
later.  While I can get the 2.2.x source to compile, I have not had time 
to do anything else.

-John
wb8tyw at qsl.network
Personal Opinion Only





More information about the samba-technical mailing list