develooper Front page | perl.perl5.porters | Postings from August 2001

ext/IO/poll.h

Thread Next
From:
Corrin Lakeland
Date:
August 8, 2001 15:38
Subject:
ext/IO/poll.h
Message ID:
200108080144.f781iRc31497@freki.otago.ac.nz
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm afraid I don't know enough to give you a decent bug report.  I'm running 
an intel RedHat system on which I do not have root, but I have built gcc 3 in 
$HOME.  Attempting to install a perl module via CPAN requested perl be 
upgraded from 5.6.0 (installed in the sytem directory) to 5.6.1.  This was 
downloaded and the installation proceeded ok until the ext/IO directory.

The problem was with the file IO.xs:  On line 217 you calculate the size of a 
pollfd which gcc returned as undefined.  You defined pollfd in the file 
poll.h but it was inside a #ifdef:

#if (defined(HAS_POLL) && defined(I_POLL)) || defined(POLLWRBAND)             

I added the line #undef HAS_POLL immediatly before this and it compiled fine.

So it looks like the configure test for HAS_POLL is returning true when it 
shouldn't be.  My <sys/poll.h> comes form glibc-devel-2.2, I've attached it 
below.

It looks like IO wasn't generated correctly even though I got it through make 
though, here is some of the output from make test.

Hope this is of some use...

op/my_stash..........Can't locate loadable object for module IO in @INC (@INC 
contains: ../lib) at ../lib/IO/Handle.pm line 256
Compilation failed in require at ../lib/IO/Handle.pm line 256.
BEGIN failed--compilation aborted at ../lib/IO/Handle.pm line 256.
Compilation failed in require at ../lib/IO/Seekable.pm line 101.
BEGIN failed--compilation aborted at ../lib/IO/Seekable.pm line 101.
Compilation failed in require at ../lib/IO/File.pm line 112.
BEGIN failed--compilation aborted at ../lib/IO/File.pm line 112.
Compilation failed in require at ../lib/FileHandle.pm line 9.
Compilation failed in require at ../lib/Test/Harness.pm line 7.
BEGIN failed--compilation aborted at ../lib/Test/Harness.pm line 7.
Compilation failed in require at ../lib/Test.pm line 3.
BEGIN failed--compilation aborted at ../lib/Test.pm line 3.
Compilation failed in require at op/my_stash.t line 9.
BEGIN failed--compilation aborted at op/my_stash.t line 9.

Corrin

- -- Following is /usr/include/sys/poll.h

/* Compatibility definitions for System V `poll' interface.
   Copyright (C) 1994,96,97,98,99,2000,2001 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

#ifndef	_SYS_POLL_H
#define	_SYS_POLL_H	1

#include <features.h>

/* Get the platform dependent bits of `poll'.  */
#include <bits/poll.h>


/* Type used for the number of file descriptors.  */
typedef unsigned long int nfds_t;

/* Data structure describing a polling request.  */
struct pollfd
  {
    int fd;			/* File descriptor to poll.  */
    short int events;		/* Types of events poller cares about.  */
    short int revents;		/* Types of events that actually occurred.  */
  };


__BEGIN_DECLS

/* Poll the file descriptors described by the NFDS structures starting at
   FDS.  If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
   an event to occur; if TIMEOUT is -1, block until an event occurs.
   Returns the number of file descriptors with events, zero if timed out,
   or -1 for errors.  */
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) __THROW;

__END_DECLS

#endif	/* sys/poll.h */

- -- Following is /usr/include/bits/poll.h

/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

#ifndef _SYS_POLL_H
# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
#endif

/* Event types that can be polled for.  These bits may be set in `events'
   to indicate the interesting event types; they will appear in `revents'
   to indicate the status of the file descriptor.  */
#define POLLIN		0x001		/* There is data to read.  */
#define POLLPRI		0x002		/* There is urgent data to read.  */
#define POLLOUT		0x004		/* Writing now will not block.  */

#ifdef __USE_XOPEN
/* These values are defined in XPG4.2.  */
# define POLLRDNORM	0x040		/* Normal data may be read.  */
# define POLLRDBAND	0x080		/* Priority data may be read.  */
# define POLLWRNORM	0x100		/* Writing now will not block.  */
# define POLLWRBAND	0x200		/* Priority data may be written.  */
#endif

#ifdef __USE_GNU
/* This is an extension for Linux.  */
# define POLLMSG	0x400
#endif

/* Event types always implicitly polled for.  These bits need not be set in
   `events', but they will appear in `revents' to indicate the status of
   the file descriptor.  */
#define POLLERR		0x008		/* Error condition.  */
#define POLLHUP		0x010		/* Hung up.  */
#define POLLNVAL	0x020		/* Invalid polling request.  */

#ifdef __USE_MISC
/* Canonical number of polling requests to read in at a time in poll.  */
# define NPOLLFILE	30
#endif


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7cJl6i5A0ZsG8x8cRAmYdAJ44Nj/kfPJY3ZCz+dEAw5I1HagmMACgjHbJ
fk+oWfyOZbazS7+QUNpxjZI=
=//kD
-----END PGP SIGNATURE-----

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About