Apolon
2003-09-30 01:16:51 UTC
Does anyone know what the meaning of errno=65 (ENOPKG) is when an
open() call fails on SCO Open Server 5.0.6? That error code doesn't
appear in the open function man pages.
The error occurs very rarely (say once a month) in a process that runs
continuously closing/opening/creating/moving files around once every 2
hours. The open is performed directly after a system() call which
copies a file to another location. A system( "cp ..." ) call is being
used instead of the rename() function call because of the limitation
with not being able to rename across filesystems.
Here are the code excerpts which encounters the error 65. The open
function call is the one that fails occassionally. Most of the time
the program is running it works fine.
HIST_mv(tmpName, fullname);
if ((hdr->fd = open(fullname, O_RDWR , A_READ | U_WRITE)) == H_ERROR)
{
char lvCurrentDir[1024];
getcwd (lvCurrentDir, sizeof (lvCurrentDir) - 1);
xfatal_err("Fatal Error %d opening file %s in directory %s.",
errno, fullname, lvCurrentDir);
}
void HIST_mv(char* f1, char* f2)
{
char cmd[512];
int systemCallResult;
HDBG( Hdbg( "Copying file %s to %s.\n", f1, f2 ) );
sprintf(cmd, "cp %s %s", f1, f2);
systemCallResult = system(cmd);
HDBG( Hdbg( "system(\"%s\") returned %d.\n", cmd, systemCallResult
) );
HDBG( Hdbg( "Removing file %s.\n", f1 ) );
if ( unlink(f1) != 0 )
{
Hdbg( "unlink(%s) call failed with errno=%d.\n", f1, errno );
}
}
Thanks for any help,
Apolon.
open() call fails on SCO Open Server 5.0.6? That error code doesn't
appear in the open function man pages.
The error occurs very rarely (say once a month) in a process that runs
continuously closing/opening/creating/moving files around once every 2
hours. The open is performed directly after a system() call which
copies a file to another location. A system( "cp ..." ) call is being
used instead of the rename() function call because of the limitation
with not being able to rename across filesystems.
Here are the code excerpts which encounters the error 65. The open
function call is the one that fails occassionally. Most of the time
the program is running it works fine.
HIST_mv(tmpName, fullname);
if ((hdr->fd = open(fullname, O_RDWR , A_READ | U_WRITE)) == H_ERROR)
{
char lvCurrentDir[1024];
getcwd (lvCurrentDir, sizeof (lvCurrentDir) - 1);
xfatal_err("Fatal Error %d opening file %s in directory %s.",
errno, fullname, lvCurrentDir);
}
void HIST_mv(char* f1, char* f2)
{
char cmd[512];
int systemCallResult;
HDBG( Hdbg( "Copying file %s to %s.\n", f1, f2 ) );
sprintf(cmd, "cp %s %s", f1, f2);
systemCallResult = system(cmd);
HDBG( Hdbg( "system(\"%s\") returned %d.\n", cmd, systemCallResult
) );
HDBG( Hdbg( "Removing file %s.\n", f1 ) );
if ( unlink(f1) != 0 )
{
Hdbg( "unlink(%s) call failed with errno=%d.\n", f1, errno );
}
}
Thanks for any help,
Apolon.