dup2() Problem
dup2() Problem
- Subject: dup2() Problem
- From: Norm Green <email@hidden>
- Date: Thu, 5 Jul 2007 18:10:48 -0700
Title: dup2() Problem
Hi,
I'm having a problem on Darwin i386 using dup2() in a child process. This is after a fork() call but before execve() call.
After the fork I do:
int logfd = open(logName, O_WRONLY|O_APPEND|O_CREAT, 0644);
dup2(logfd, STDOUT_FILENO);
The open() call succeeds but the dup2() call always fails with errno=9, which suggests one of the args is not an open fd. I'm sure I'm not closing either in my code.
This area of our code is "old as dirt" and runs fine on other UNIX systems (Solaris, Linux, etc). Any idea why Darwin's dup2() is behaving this way?
Here's my version info from uname -a:
Darwin pandora.gemstone.com 8.9.3 Darwin Kernel Version 8.9.3: Fri Apr 27 14:50:07 PDT 2007; root:xnu-792.19.5~2/RELEASE_I386 i386 i386
Thanks in advance for any insights,
Norm Green
GemStone Systems Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden