[Mono-dev] MonoPosixHelper and namespacing

Jonathan Pryor jonpryor at vt.edu
Sun Aug 28 12:53:37 EDT 2005


Current programming practice is that library exports should have a
common prefix, forming a "namespace."  Common examples abound in GLib
(with a g_ prefix) and GTK+ (with a gtk_ prefix).

libMonoPosixHelper.so in many cases disregards this, with exports like:

	create_z_stream
	helper_Mono_Posix_GetGroupName
	Mono_Posix_ToPollEvents
	open_serial
	read_serial
	set_attributes
	wexitstatus
	wifexited
	z_stream_deflate

A full list of exports can be retrieved from:

	nm -D $prefix/lib/libMonoPosixHelper.so | grep '^........ T'

Questions:

1.  Is this a problem?  I think it is, as we're "polluting" the dynamic
linker, but I could be wrong.

2.  If this is a problem, should we fix it?  Many of the non-prefixed
exports such as helper_Mono_Posix_GetGroupName and wifexited were
exported with Mono 1.0, so it might not be practical to remove them.  On
the other hand, we're no longer shipping a versioned .so (thus
publishing ABI instability), so this might not be a problem.

3.  What would be the appropriate prefix?  Mono_Posix is a common prefix
for most of the exports (194/218), though it doesn't match the typical
convention of using the library name.  MonoPosixHelper could be used, if
it's a little verbose.  "mph" might make sense, though it might be too
short.

4.  If we were to add a namespace to the exports, who would be impacted?
I know Mono.Posix.dll uses most of the exports, but it also seems that
System.dll uses some as well (via System.IO.Ports and
System.IO.Compression).

5.  Why is System.dll uses libMonoPosixHelper.so anyway?  Wouldn't it
make more sense for System.IO.Ports and System.IO.Compression to use
icalls instead, or at least a different library than MonoPosixHelper?
Perhaps libMonoSystemHelper.so? :-)

Thanks,
 - Jon





More information about the Mono-devel-list mailing list