[patch] tux3-2.6.5-A3

Anton Blanchard anton at samba.org
Thu Apr 22 16:19:48 UTC 2004


> 
> the latest Tux patch merged to 2.6.5 is available at:
> 
>     	redhat.com/~mingo/TUX-patches/tux3-2.6.5-A3
>  
> this patch also includes the x86-64 fixes from Alex Kiernan.

I removed almost all of the in kernel syscalls on ppc64 and it broke
tux. I think we can use syscalls.h now and call them directly.

I also have a fix for a compile error with tux not compiled as a
module. Its a quick fix im not sure how you want to solve it.

Anton

---

 foobar2-anton/net/socket.c     |    2 +-
 foobar2-anton/net/tux/extcgi.c |    5 +++--
 foobar2-anton/net/tux/main.c   |    5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff -puN net/tux/main.c~fix_tux net/tux/main.c
--- foobar2/net/tux/main.c~fix_tux	2004-04-22 23:59:44.579665398 +1000
+++ foobar2-anton/net/tux/main.c	2004-04-23 00:01:29.694430863 +1000
@@ -10,6 +10,7 @@
 #define __KERNEL_SYSCALLS_NO_ERRNO__
 
 #include <net/tux.h>
+#include <linux/syscalls.h>
 
 /****************************************************************
  *      This program is free software; you can redistribute it and/or modify
@@ -192,9 +193,9 @@ int tux_chroot (char *dir)
 	set_fs(KERNEL_DS);
 	cap_raise (current->cap_effective, CAP_SYS_CHROOT);
 
-	err = chroot(dir);
+	err = sys_chroot(dir);
 	if (!err)
-		chdir("/");
+		sys_chdir("/");
 
 	current->cap_effective = saved_cap;
 	set_fs(oldmm);
diff -puN net/tux/extcgi.c~fix_tux net/tux/extcgi.c
--- foobar2/net/tux/extcgi.c~fix_tux	2004-04-23 00:03:12.352990742 +1000
+++ foobar2-anton/net/tux/extcgi.c	2004-04-23 00:03:26.183040711 +1000
@@ -10,6 +10,7 @@
 #define __KERNEL_SYSCALLS_NO_ERRNO__
 
 #include <net/tux.h>
+#include <linux/syscalls.h>
 #include "parser.h"
 
 /****************************************************************
@@ -87,7 +88,7 @@ repeat:
 repeat_read:
 		Dprintk("reading %d bytes via read().\n", left);
 		oldmm = get_fs(); set_fs(KERNEL_DS);
-		len = read(2, tmp, left);
+		len = sys_read(2, tmp, left);
 		set_fs(oldmm);
 		Dprintk("got %d bytes from read() (total: %d).\n", len, total);
 		if (len > 0)
@@ -275,7 +276,7 @@ static int exec_external_cgi (void *data
 
 		Dprintk("POST data to CGI:\n");
 		oldmm = get_fs(); set_fs(KERNEL_DS);
-		ret = write(1, req->post_data_str, req->post_data_len);
+		ret = sys_write(1, req->post_data_str, req->post_data_len);
 		set_fs(oldmm);
 		Dprintk("write() returned: %d.\n", ret);
 		if (ret != req->post_data_len)
diff -puN net/socket.c~fix_tux net/socket.c
--- foobar2/net/socket.c~fix_tux	2004-04-23 00:04:21.116141895 +1000
+++ foobar2-anton/net/socket.c	2004-04-23 00:06:23.963199811 +1000
@@ -1985,11 +1985,11 @@ void __init sock_init(void)
 int tux_Dprintk;
 int tux_TDprintk;
 
+struct module *tux_module = NULL;
 #ifdef CONFIG_TUX_MODULE
 
 asmlinkage long (*sys_tux_ptr) (unsigned int action, user_req_t *u_info) = NULL;
 
-struct module *tux_module = NULL;
 spinlock_t tux_module_lock = SPIN_LOCK_UNLOCKED;
 
 asmlinkage long sys_tux (unsigned int action, user_req_t *u_info)

_





More information about the tux-list mailing list