directory entries chopped on SCO Unix 
Author Message
 directory entries chopped on SCO Unix

I just built pl44 on SCO Unix 3.2.2 and find that the filenames
returned by Perl's readdir function are missing the first two
characters.  It works fine on SunOS.  Anyone have a fix for this
problem?
--



Wed, 18 Aug 1993 14:56:06 GMT  
 directory entries chopped on SCO Unix

Quote:
} I just built pl44 on SCO Unix 3.2.2 and find that the filenames
} returned by Perl's readdir function are missing the first two
} characters.  It works fine on SunOS.  Anyone have a fix for this
} problem?
} --


Yeah, make sure you DO NOT use -lx when linking.  It has (incorrect,
ore more accurately, outdated) opendir(), readdir(), closedir() etc.
calls, which get used in place of the (correct) ones in libc.

As far as I know, the only thing -lx is needed for in 3.2.2 is the
ancient rdchk() call, which Perl surely isn't using.  You can replace
it with select() or an ioctl() if it is used.
--




Thu, 19 Aug 1993 13:49:53 GMT  
 directory entries chopped on SCO Unix

Quote:
>Yeah, make sure you DO NOT use -lx when linking.  It has (incorrect,
>ore more accurately, outdated) opendir(), readdir(), closedir() etc.

Too true.

Quote:
>As far as I know, the only thing -lx is needed for in 3.2.2 is the
>ancient rdchk() call ...

Actually, Perl _is_ using routine from -lx: chsize().  It's used to
implement the "truncate" function.  Fortunately, the fcntl() solution
for System V is just as effective, and it doesn't require -lx.


Sat, 21 Aug 1993 03:07:49 GMT  
 directory entries chopped on SCO Unix

Quote:

>} I just built pl44 on SCO Unix 3.2.2 and find that the filenames
>} returned by Perl's readdir function are missing the first two
>} characters.  It works fine on SunOS.  Anyone have a fix for this
>} problem?
>} --

>Yeah, make sure you DO NOT use -lx when linking.  It has (incorrect,
>ore more accurately, outdated) opendir(), readdir(), closedir() etc.
>calls, which get used in place of the (correct) ones in libc.

>As far as I know, the only thing -lx is needed for in 3.2.2 is the
>ancient rdchk() call, which Perl surely isn't using.  You can replace
>it with select() or an ioctl() if it is used.

  You might notice that SCO defines both dirent.h, sys/ndir.h,
  and sys/dir.h .   This is a bit of overkill and would be ok,
  I guess, except that dirent defines a strange type on the
  length of the file and throws off the offset of the name
  by two bytes.

  What I did was modify the config.h file after running Configure
  and commented out DIRENT, uncommented NDIR and also uncommented
  the directory length variable.  

  If the above does not help give me a call.

  Bill England

--

 |   * *      H -> He +24Mev                                                |
 |  * * * ... Oooo, we're having so much fun making itty bitty suns *       |
 |__ * * ___________________________________________________________________|



Sat, 21 Aug 1993 06:19:53 GMT  
 directory entries chopped on SCO Unix

   } I just built pl44 on SCO Unix 3.2.2 and find that the filenames
   } returned by Perl's readdir function are missing the first two
   } characters.  It works fine on SunOS.  Anyone have a fix for this
   } problem?
   } --

   Yeah, make sure you DO NOT use -lx when linking.  It has (incorrect,
   ore more accurately, outdated) opendir(), readdir(), closedir() etc.
   calls, which get used in place of the (correct) ones in libc.

Yep, that fixed it.  Configure automatically detects that -lx exists
and includes it in the suggested list of libraries to link with, but
all I had to do was explicitly type in the rest of them at the prompt
instead of accepting the default.  Configure also seems to have
detected that fcntl exists and used that instead of chsize.

Apparently what happens if you use -lx is perl mismatches the dirent.h
header file with the -lx directory routines, which return a
different-sized struct.  If you use either sys/ndir.h with -lx, or
dirent.h with the libc routines, it should work.  However, I have
heard somewhere that the -lx directory routines don't work under NFS
(because they don't use the getdents syscall), which we plan to start
using sometime, so I don't want to use them.
--



Sat, 21 Aug 1993 18:45:14 GMT  
 directory entries chopped on SCO Unix

Quote:
>[...]
>Apparently what happens if you use -lx is perl mismatches the dirent.h
>header file with the -lx directory routines, which return a
>different-sized struct.  If you use either sys/ndir.h with -lx, or

  Thanks,  that makes more sense than what I thought was going on. The
  config does contain some code to skip dirent on Xenix boxes and
  (presumably)  use sys/ndir.  Would modification of the config to
  drop the Xenix specific test and also dropping the -lx library
  work better on Xenix boxes ?  Sorry I can't test Xenix here.

  Bill England

--

 |   * *      H -> He +24Mev                                                |
 |  * * * ... Oooo, we're having so much fun making itty bitty suns *       |
 |__ * * ___________________________________________________________________|



Mon, 23 Aug 1993 01:39:25 GMT  
 directory entries chopped on SCO Unix

Quote:

>   Would modification of the config to
>   drop the Xenix specific test and also dropping the -lx library
>   work better on Xenix boxes ?  Sorry I can't test Xenix here.

This is a difficult question to answer, mostly because it's hard to
tell exactly what kind of Xenix you have.

        Early releases didn't have any kind of ndir  -- no problem

        Many releases have only sys/ndir + -lx       -- no problem

        SCO Xenix 2.3.[012] have ndir + dirent, but dirent is reputedly
                broken on .0 and .1, hence the hack to undef it.

        *However*, the kernel upgrade to 2.3.3 (where dirent apparently works)
        from any lower 2.3.? is a free upgrade, which you can anon FTP or UUCP.

I use dirent -- I had to make a decision which set of directory routines
to throw out (so that there would be no confusion), so I threw out the
old ones.  This means I have to manually remove the ! defined(M_XENIX)
hacks from the source which is very ugh.

My opinion is that the hacks should be removed seeing as they only apply
to a small number of operating system versions which you upgrade for
free anyway.  Chip may disagree with me.  It all rather depends on your
particular point of view.

You could hack Configure to do case "`uname -r`" in 2.3.[01])
I guess.  It's a lot of code to handle just one specific case,
since you have to determine whether to do it or not as well.

In short, I Really Don't Know But It's All Very Annoying.

Just another Xenix user,
--



Mon, 23 Aug 1993 16:30:46 GMT  
 directory entries chopped on SCO Unix

Quote:
>My opinion is that the hacks should be removed seeing as they only apply
>to a small number of operating system versions which you upgrade for
>free anyway.  Chip may disagree with me.

I agree... _if_ the old "#ifdef M_XENIX" is replaced by the more
accurate "#ifdef SYS_NDIR".  That provides an out for those sites that
still haven't upgraded to a dirent-capable version of Xenix.

Quote:
>In short, I Really Don't Know But It's All Very Annoying.

What he said.  Sigh.
--

 "Most of my code is written by myself.  That is why so little gets done."
                 -- Herman "HLLs will never fly" Rubin


Wed, 25 Aug 1993 05:04:34 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Problem to read DOS directory from SCO UNIX

2. chop only chop off the last character ?

3. Oracle / SCO Unix / Perl

4. Compiling for SCO Unix

5. compile error under SCO unix

6. Building Perl 4.036 on SCO UNIX

7. Problem with Perl on SCO Unix

8. Compiling PERL for SCO UNIX

9. Curseperl on SCO UNIX 3.2.4v1

10. perl binary for SCO UNIX

11. undump program for SCO Unix

12. Wanted: Perl executable for SCO Unix

 

 
Powered by phpBB® Forum Software