I'm trying to port an email server program (BlitzMail, from Dartmouth
College) to OS X, mostly for my own personal interest. It was
originally written for NeXT, and has been ported to Digital Unix and
Linux - so I figured that it wouldn't be too hard to port to OS X.
However, during its configure script, it checks to see if errno is
preserved between threads, and on OS X it's failing this test. I've
modified the original test code from the configure script, and will
include it below. It seems to me (with admittedly limited pthread
experience) that it should work. However, it's not. Here's the source
code and the output.
Basically, the program calls a read() that it knows will fail, and
checks errno. It then sleeps, and another thread runs that calls
read() with a different errno. The original thread then resumes, and
checks to see if errno is the same. It's not, and it seems to me that
it should be. Can anyone tell me what I'm doing wrong? I'm running
10.2.1 with Fink (latest CVS) installed.
########################################################333
The output:
sdwr@Scott-D-W-Rankins-Computer:~/<1>BlitzMail/blitzserv-3.9.1>./a.out
Going to sleep...
0: Hello World!
Waking up...
main after sleep: errno = 2
sdwr@Scott-D-W-Rankins-Computer:~/<1>BlitzMail/blitzserv-3.9.1>
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.