Hi,

On Wed, Mar 23, 2005 at 01:58:35PM +1100, Brendan O'Dea wrote:
> On Tue, Mar 22, 2005 at 06:27:32PM +0100, Michael Banck wrote:
> >[EMAIL PROTECTED]:~/build$ grep EINPROGRESS /usr/lib/perl/5.8.4/Errno.pm 
> >[EMAIL PROTECTED]:~/build$ 
> 
> >I think this is due to no general glibc inclusion of <errno.h> in
> >perl-5.8.4/ext/Errno/Errno_pm.PL, only linux is tested for.  So I guess
> >either a test for 'gnu' (or whatever perl calls it) should be added or
> >the 'linux' test be generalized for all glibc-using architectures.
> 
> While there is a specific test for linux, there is also a fallback case
> which uses cc to determine what "<errno.h>" resolves to.  Tested to work
> under linux by changing "linux" in the test to "xinu" (or whatever).

Ah, I see.

> The result is a functionally identical Errno.pm (some differences in
> ordering).
> 
> If you wouldn't mind could you fetch and unpack the perl source, and try
> the following please:
> 
>   cd /tmp
>   perl -d $PERL_SRC/ext/Errno_pm.PL
>   c 149
>   p $cpp
>   c 172
>   x \%file
>   ^D

main::(/home/mbanck/perl-5.8.4/ext/Errno/Errno_pm.PL:5):
5:      our $VERSION = "1.09_00";
  DB<1>   c 149
main::get_files(/home/mbanck/perl-5.8.4/ext/Errno/Errno_pm.PL:149):
149:                open(CPPO,"$cpp < errno.c |") or
150:                    die "Cannot exec $cpp";
  DB<2>   p $cpp
cc -E -D_GNU_SOURCE -fno-strict-aliasing -I/usr/local/include -
  DB<3>   c 172
main::get_files(/home/mbanck/perl-5.8.4/ext/Errno/Errno_pm.PL:172):
172:            close(CPPO);
  DB<4>   x \%file
0  HASH(0x845656c)
   '/usr/include/bits/errno.h' => 1
   '/usr/include/errno.h' => 1
   '/usr/include/features.h' => 1
   '/usr/include/gnu/stubs.h' => 1
   '/usr/include/sys/cdefs.h' => 1
   '<built-in>' => 1
   '<command line>' => 1
   '<stdin>' => 1
  DB<5> 


The problem is in process_files, the regex on line 59 is not suited for
the Hurd's /usr/include/bits/errno.h (where the meat is), as the ERRNOs
are defined as follows:

#ifndef _HURD_ERRNO
#define _HURD_ERRNO(n)  ((0x10 << 26) | ((n) & 0x3fff))
#endif
[...]
#define EINPROGRESS     _HURD_ERRNO (36)/* Operation now in progress */


Running /^\s*#\s*define\s+(E\w+)\s+(\d+)/ over that file does not yield
any output, contrary to running it over /usr/include/asm-generic/errno.h
on Linux.


cheers,

Michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to