Source:
AmigartTaken from Amiga Samba mailing list.
"I have been working on something I didn't really want to tackle: write my own 'C' runtime library to port Samba 2.2.x with. Some 430 functions later I now have a codebase at hand which just about covers the ISO 'C' (1994) functionality, minus the wide character support. That was a hell of a lot of work to be done, I can tell you. One of the many nice things this library does is to compile both with SAS/C and GCC. This makes testing with a source level debugger possible. Other neat bits: socket I/O is transparently integrated into the file I/O architecture of the library, stack size checking and extension is supported (for GCC), the library is plastered with debugging and checking code, Amiga operating system functions are used wherever this is convenient (e.g. locale), and almost everything
is written in portable 'C'.
As an exercice, I started to port the SAS/C Samba 2.0.7 port to GCC, using the new library. Quite an eye-opener: I found lots and lots of code in Samba which
didn't even work on the Amiga and whose absence was previously obscured by stub code I had written. Taking the code out did make it more robust, or so it
appears. On the downside, core functionality, such as the opportunistic locking Samba uses, never seems to have worked in Amiga port. Why the SAS/C port still performed well I cannot tell. Just don't tip it off that it doesn't work, will you? Another interesting fact emerged: Samba really never uses more than about 20K of stack space (maximum) on the Amiga. So, if older Amiga Samba ports crashed (in particular the ixemul versions), setting the stack size to 100K or beyond very likely didn't help at all. There is an option in swat to start the nmbd and smbd programs. I discovered that not only did this code never work due to stubs catching the calls to execl(), it also couldn't have worked on the Amiga because smbd must always be launched from the internet superserver (it cannot run as a daemon all by itself).
Yesterday smbd and nmbd compiled, linked and ran for the first time using SAS/C and the new library. The results were encouraging. I soon moved on to rebuild them with GCC 2.95.3. The results were just as good. If this keeps working, chances are that we may have 'pure' versions of smbd and nmbd available which can be made resident. This should be very helpful for smbd, which is so large that it always takes a few seconds to load and run. It also should be possible to port Samba to the Amiga PowerPC platform in the future, provided that the
underlying runtime library is ported as well.
It may not take long for the GCC-built Amiga Samba 2.0.7 port to appear on the usual ftp site. Stay tuned. If this continues to work well, the next thing I'll
do is to see if Samba 2.2.5 is willing to let itself be ported to the Amiga..."