delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/08/09:53:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: Ralf Habacker <ralf DOT habacker AT freenet DOT de>
To: cygwin AT cygwin DOT com
Subject: [PATCH] ioctl FIONREAD implementation for sockets
Date: Sun, 8 Feb 2004 15:49:05 +0100
User-Agent: KMail/1.5.4
MIME-Version: 1.0
Message-Id: <200402081549.05934.ralf.habacker@freenet.de>
X-IsSubscribed: yes

--Boundary-00=_hxkJAsxT6ZRWdTB
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi, 

while porting a kde game (Kbattleship) to cygwin/xfree I recognized that the 
ioctl FIONREAD function call wasn't implemented. 
The appended minor patch added this support to fhandler_socket.cc

Cheers 
Ralf 


Changelog 

2004-02-08  Ralf Habacker  <ralf DOT habacker AT freenet DOT de>

	* fhandler_socket.cc (fhandler_socket::ioctl): Added FIONREAD function call. 


--Boundary-00=_hxkJAsxT6ZRWdTB
Content-Type: text/x-diff;
  charset="us-ascii";
  name="cygwin_fhandler_socket_cc-ioctl-fionread.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="cygwin_fhandler_socket_cc-ioctl-fionread.patch"

--- fhandler_socket.cc.orig	2003-12-07 23:38:00.000000000 +0100
+++ fhandler_socket.cc	2004-02-08 15:38:54.508512000 +0100
@@ -1264,6 +1264,13 @@ fhandler_socket::ioctl (unsigned int cmd
 	  set_nonblocking (*(int *) p);
 	}
       break;
+
+		case FIONREAD: 
+      res = ioctlsocket (get_socket (), FIONREAD, (unsigned long *) p);
+      if (res == SOCKET_ERROR)
+	  set_winsock_errno ();
+			break;
+
     }
   syscall_printf ("%d = ioctl_socket (%x, %x)", res, cmd, p);
   return res;


--Boundary-00=_hxkJAsxT6ZRWdTB
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--Boundary-00=_hxkJAsxT6ZRWdTB--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019