Skip to contentSkip to conversation

PATCH check for sys_sendfile() in port_user.c

uml-devel Dan Shearer 2 participants 2 messages Jan 27, 2004 – Jan 28, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

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.)

Signature · 2 lines
Dan Shearer
[email protected]
port_user.c renamed from port_user.c.orig +5 -0
@@ -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");
#1 lore raw
Quoted 4 lines

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.

sendfile has nothing to do with passing descriptors across unix sockets. It is a relatively new performance tweak which allows files to be copied without the data flowing through userspace.

Jeff

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel