# include <fcntl.h>
#endif
+#ifndef SIOCATMARK
+# ifdef I_SYS_SOCKIO
+# include <sys/sockio.h>
+# endif
+#endif
+
#ifdef PerlIO
typedef int SysRet;
typedef PerlIO * InputStream;
MODULE = IO PACKAGE = IO::Handle PREFIX = f
-
int
ungetc(handle, c)
InputStream handle
RETVAL
+MODULE = IO PACKAGE = IO::Socket
+
+SysRet
+sockatmark (sock)
+ InputStream sock
+ PROTOTYPE: $
+ PREINIT:
+ int fd,flag,result;
+ CODE:
+ {
+ fd = PerlIO_fileno(sock);
+#ifdef HAS_SOCKATMARK
+ flag = sockatmark(fd);
+#else
+# ifdef SIOCATMARK
+ if (ioctl(fd, SIOCATMARK, &flag) != 0)
+ XSRETURN_UNDEF;
+# else
+ not_here("IO::Socket::atmark");
+# endif
+ RETVAL = flag;
+#endif
+ }
+ OUTPUT:
+ RETVAL
+
BOOT:
{
HV *stash;
newCONSTSUB(stash,"SEEK_END", newSViv(SEEK_END));
#endif
}
+