Best of the Newsgroups: ENOPKG


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From: Bela Lubkin <belal@sco.com>
Subject: Re: Rare Error 65 (ENOPKG) occurrence on open() call
Date: 30 Sep 2003 21:03:15 -0400 References: <b9dd7dab.0309291716.1f10fd39@posting.google.com>


Hate these ads?




Apolon wrote:



> 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);
> }














First, make sure that `errno' was 0 before the open() call, and that
getcwd() isn't affecting its value:



  if (errno == ENOPKG) {
    /* aha!? */
  }
  errno = 0;  /* might be something weird from prior calls */
  if ((hdr->fd = open(fullname, O_RDWR , A_READ | U_WRITE)) == H_ERROR)
  {
      int my_errno = errno;  /* save errno */
      char lvCurrentDir[1024];
      getcwd (lvCurrentDir, sizeof (lvCurrentDir) - 1);
      xfatal_err("Fatal Error %d opening file %s in directory %s.",
                  my_errno, fullname, lvCurrentDir);  /* saved errno */



Other than that: where is the file it's trying to open?  A local
filesystem, an NFS mount, something else?  Are these your own files, or
are they arbitrary files you find on the filesystem?  (For instance, is
this a backup program that searches for files and copies them?)



There are very few things in the kernel that return ENOPKG.  Candidates
include the System V shared memory driver ("shm"), the Xenix shared data
driver ("xsd"), and the Advanced Power Management drivers ("uapm" and
"pwr").  Each of these drivers has "stubs.c" code -- code that gets
linked into the kernel when the driver is _not_ present -- that returns
ENOPKG for certain operations.



It isn't clear to me whether any of these could return ENOPKG for an
open() call.  More typically it would be on calling shmsys(), any of the
xsd*() functions, and on attempting certain ioctls with the APM stuff.
But... there exists an obscure file type which is an on-disk
representation of a Xenix Shared Data memory segment.  If you had one of
those and tried to open it, it _might_ return ENOPKG if "xsd" wasn't
linked into your kernel.



Or might not.  I just tried it and:









  $ mknod test-m m
  $ cat test-m
  cat: cannot open test-m: Is a name file (error 139)



EISNAM is not ENOPKG.



>Bela<





Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.

I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.




Comments


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments

If you want a picture to show with your comment, go get a Gravatar



LOD Communications, Inc.

/Bofcusm/2342.html copyright 1997-2004 Bela Lubkin All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!





More:
       - Bela








card_image







Change Congress