linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] PATCH check for sys_sendfile() in port_user.c
@ 2004-01-27  4:50 Dan Shearer
  2004-01-28  4:39 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Shearer @ 2004-01-27  4:50 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

Some kernels (including SuSE 2.4.20, according to
http://marc.theaimsgroup.com/?l=user-mode-linux-user&m=107437381718023&w=2)
don't have sys_sendfile, in which case the port console driver should
refuse to start up because there is no way for telnetd to get the fd.
This might not be obvious to debug.

NOTE! Not tested because it doesn't bite me! Beyond the fact that it
works on systems *with* sendfile() :-)

Should be the final word in anyone who wants to throw out commandline
parameter passing for xterm in favour of fd passing.

(And one more tiny little portability aid.)

-- 
Dan Shearer
dan@shearer.org

[-- Attachment #2: sendfile_patch --]
[-- Type: text/plain, Size: 380 bytes --]

--- port_user.c.orig	2004-01-24 15:48:53.000000000 +1030
+++ port_user.c	2004-01-27 15:05:40.000000000 +1030
@@ -35,6 +35,11 @@
 	char *end;
 	int port;
 
+	if(sys_sendfile() == -1){
+		printk("port_init : host kernel doesn't support sendfile()\n");
+		return(NULL);
+	}
+
 	if(*str != ':'){
 		printk("port_init : channel type 'port' must specify a "
 		       "port number\n");

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-01-28  4:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27  4:50 [uml-devel] PATCH check for sys_sendfile() in port_user.c Dan Shearer
2004-01-28  4:39 ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox