fork + dlls

Mumit Khan khan@xraylith.wisc.EDU
Sat May 22 18:23:00 GMT 1999

I had written earlier (and on an empty stomach):
> This has been a bug since day one, and one that needs a bit of redesign
> of the code in winsup/ to do it right. The current code there
> is quite complex, and overly so in some cases, and someone who knows more 
> about it needs to take a look. 

I was confused. My local hack was completely unnecessary since the code
is actually all there, albeit a bit too complex for me to comprehend at
first [and here's where I plug in the empty stomach bit].

The following should fix Eric's testcase that uses dlsym across fork.

The strcmp->strcasecmp is necessary since the get_full_path_of_dll()
in doesn't necessarily have the same case as the name returned 
by GetModuleFileName() checked by DllList::recordDll. Amazing how these
little things can steer you in the wrong direction!

Chris, the case-insensitive filename comparison should fix the problem 
you had mentioned. Could you please check?

Sat May 22 19:03:47 1999  Mumit Khan  <>

	* (DllList::recordDll): Forkee must reload dlopened
	DLLs. Also use strcasecmp, not strcmp to compare file name.

RCS file: /home/khan/CVSROOT/cygwin/cygwin-dev/winsup/,v
retrieving revision
diff -u -3 -p -p -r1.1.1.1
---	1999/05/21 23:51:12
+++	1999/05/23 01:04:44
@@ -185,6 +185,7 @@ DllList::recordDll (HMODULE h, per_proce
       type = LOAD;
+      forkeeMustReloadDlls (1);
   if (type == LOAD && _dlopenedLib !=0)
@@ -193,7 +194,7 @@ DllList::recordDll (HMODULE h, per_proce
     GetModuleFileName (h, buf, MAX_PATH);
     // it is not the current dlopened lib
     // so we insert one empty lib to preserve place for current dlopened lib
-    if (strcmp (_dlopenedLib, buf) != 0)
+    if (strcasecmp (_dlopenedLib, buf) != 0)
       if (_dlopenIndex == -1)
 	_dlopenIndex = add (0, 0, NONE);

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list