/*
* Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved.
* modify it under the same terms as Perl itself.
*/
#define PERL_EXT_IO
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#define PERLIO_NOT_STDIO 1
#include "perl.h"
#include "XSUB.h"
#include "poll.h"
#ifdef I_UNISTD
# include <unistd.h>
#endif
# include <fcntl.h>
#endif
#ifndef SIOCATMARK
# ifdef I_SYS_SOCKIO
# endif
#endif
#ifdef PerlIO
#if defined(MACOS_TRADITIONAL) && defined(USE_SFIO)
#define PERLIO_IS_STDIO 1
#define setvbuf _stdsetvbuf
#define setbuf(f,b) ( __sf_setbuf(f,b) )
#endif
typedef int SysRet;
typedef PerlIO * InputStream;
typedef PerlIO * OutputStream;
#else
#define PERLIO_IS_STDIO 1
typedef int SysRet;
typedef FILE * InputStream;
typedef FILE * OutputStream;
#endif
#ifndef gv_stashpvn
#endif
static int
not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
#ifndef PerlIO
#define PerlIO_fileno(f) fileno(f)
#endif
static int
{
#if defined(HAS_FCNTL)
int RETVAL;
if(!f) {
return -1;
}
if (RETVAL >= 0) {
#ifdef O_NONBLOCK
/* POSIX style */
/* Ooops has O_NDELAY too - make sure we don't
* get SysV behaviour by mistake. */
* after a successful F_SETFL of an O_NONBLOCK. */
if (block >= 0) {
int ret;
if(ret < 0)
}
else
int ret;
if(ret < 0)
}
}
#else
/* Standard POSIX */
int ret;
mode |= O_NONBLOCK;
if(ret < 0)
}
int ret;
mode &= ~O_NONBLOCK;
if(ret < 0)
}
#endif
#else
/* Not POSIX - better have O_NDELAY or we can't cope.
* for BSD-ish machines this is an acceptable alternative
* for SysV we can't tell "would block" from EOF but that is
* the way SysV is...
*/
int ret;
if(ret < 0)
}
int ret;
if(ret < 0)
}
#endif
}
return RETVAL;
#else
return -1;
#endif
}
void
CODE:
if (handle) {
#ifdef PerlIO
ST(0) = &PL_sv_undef;
}
#else
ST(0) = &PL_sv_undef;
} else {
}
#endif
}
else {
ST(0) = &PL_sv_undef;
}
CODE:
if (handle) {
#ifdef PerlIO
#else
char *p;
}
else {
RETVAL = -1;
}
#endif
}
else {
RETVAL = -1;
}
void
char * packname
CODE:
#ifdef PerlIO
fp = PerlIO_tmpfile();
#else
#endif
}
else {
ST(0) = &PL_sv_undef;
}
void
int timeout;
{
#ifdef HAS_POLL
int i,j,ret;
for(i=1, j=0 ; j < nfd ; j++) {
i++;
i++;
}
for(i=1, j=0 ; j < nfd ; j++) {
}
}
#else
not_here("IO::Poll::poll");
#endif
}
void
int blk
PROTOTYPE: $;$
CODE:
{
if(ret >= 0)
else
}
int
int c
CODE:
if (handle)
#ifdef PerlIO
#else
#endif
else {
RETVAL = -1;
}
int
CODE:
if (handle)
#ifdef PerlIO
#else
#endif
else {
RETVAL = -1;
}
int
CODE:
if (handle) {
#ifdef PerlIO
#else
#endif
RETVAL = 0;
}
else {
RETVAL = -1;
}
int
CODE:
#ifdef IOf_UNTAINT
if (io) {
RETVAL = 0;
}
else {
#endif
RETVAL = -1;
#ifdef IOf_UNTAINT
}
#endif
CODE:
if (handle)
#ifdef PerlIO
#else
#endif
else {
RETVAL = -1;
}
void
CODE:
if (handle)
#ifdef PERLIO_IS_STDIO
{
}
#else
not_here("IO::Handle::setbuf");
#endif
setvbuf(...)
CODE:
if (items != 4)
{
OutputStream handle = 0;
int type;
int size;
if (items == 4) {
}
if (!handle) /* Try input stream. */
else {
RETVAL = -1;
}
}
#else
#endif
CODE:
#ifdef HAS_FSYNC
if(handle)
else {
RETVAL = -1;
}
#else
#endif
PROTOTYPE: $
int fd;
CODE:
{
#ifdef HAS_SOCKATMARK
#else
{
int flag = 0;
# ifdef SIOCATMARK
# else
# endif
# else
not_here("IO::Socket::atmark");
# endif
}
#endif
}
BOOT:
{
/*
* constant subs for IO::Poll
*/
#ifdef POLLIN
#endif
#ifdef POLLPRI
#endif
#ifdef POLLOUT
#endif
#ifdef POLLRDNORM
#endif
#ifdef POLLWRNORM
#endif
#ifdef POLLRDBAND
#endif
#ifdef POLLWRBAND
#endif
#ifdef POLLNORM
#endif
#ifdef POLLERR
#endif
#ifdef POLLHUP
#endif
#ifdef POLLNVAL
#endif
/*
* constant subs for IO::Handle
*/
#ifdef _IOFBF
#endif
#ifdef _IOLBF
#endif
#ifdef _IONBF
#endif
#ifdef SEEK_SET
#endif
#ifdef SEEK_CUR
#endif
#ifdef SEEK_END
#endif
}