From: Arnd Bergmann Actually, the problem has its origin in my removal of all in-kernel syscalls (except execve, which is non-trivial) earlier this year. This change was blindly reverted by the maintainer, while at the same time the local errno variable was removed. See also http://linux.bkbits.net:8080/linux-2.5/hist/drivers/media/dvb/frontends/tda= 1004x.c This patch is the one that was already merged earlier. I'm now also removing the definitions for the kernel syscalls on i386 to make it harder to reintroduce them again. This was already done for ppc64, the others should probably follow. Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton --- 25-akpm/drivers/media/dvb/frontends/alps_tdlb7.c | 10 ++++------ 25-akpm/drivers/media/dvb/frontends/sp887x.c | 9 ++++----- 25-akpm/drivers/media/dvb/frontends/tda1004x.c | 10 ++++------ 25-akpm/drivers/net/wireless/prism54/isl_38xx.c | 2 -- 25-akpm/include/asm-i386/unistd.h | 8 -------- 5 files changed, 12 insertions(+), 27 deletions(-) diff -puN drivers/media/dvb/frontends/alps_tdlb7.c~dvb-errno-removal drivers/media/dvb/frontends/alps_tdlb7.c --- 25/drivers/media/dvb/frontends/alps_tdlb7.c~dvb-errno-removal 2004-07-31 16:52:06.608994920 -0700 +++ 25-akpm/drivers/media/dvb/frontends/alps_tdlb7.c 2004-07-31 16:52:06.618993400 -0700 @@ -28,8 +28,6 @@ */ - -#define __KERNEL_SYSCALLS__ #include #include #include @@ -148,13 +146,13 @@ static int sp8870_read_firmware_file (co loff_t filesize; char *dp; - fd = open(fn, 0, 0); + fd = sys_open(fn, 0, 0); if (fd == -1) { printk("%s: unable to open '%s'.\n", __FUNCTION__, fn); return -EIO; } - filesize = lseek(fd, 0L, 2); + filesize = sys_lseek(fd, 0L, 2); if (filesize <= 0 || filesize < SP8870_FIRMWARE_OFFSET + SP8870_FIRMWARE_SIZE) { printk("%s: firmware filesize to small '%s'\n", __FUNCTION__, fn); sys_close(fd); @@ -168,8 +166,8 @@ static int sp8870_read_firmware_file (co return -EIO; } - lseek(fd, SP8870_FIRMWARE_OFFSET, 0); - if (read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) { + sys_lseek(fd, SP8870_FIRMWARE_OFFSET, 0); + if (sys_read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) { printk("%s: failed to read '%s'.\n",__FUNCTION__, fn); vfree(dp); sys_close(fd); diff -puN drivers/media/dvb/frontends/sp887x.c~dvb-errno-removal drivers/media/dvb/frontends/sp887x.c --- 25/drivers/media/dvb/frontends/sp887x.c~dvb-errno-removal 2004-07-31 16:52:06.609994768 -0700 +++ 25-akpm/drivers/media/dvb/frontends/sp887x.c 2004-07-31 16:52:06.618993400 -0700 @@ -12,7 +12,6 @@ next 0x4000 loaded. This may change in future versions. */ -#define __KERNEL_SYSCALLS__ #include #include #include @@ -209,13 +208,13 @@ int sp887x_initial_setup (struct dvb_fro // Load the firmware set_fs(get_ds()); - fd = open(sp887x_firmware, 0, 0); + fd = sys_open(sp887x_firmware, 0, 0); if (fd < 0) { printk(KERN_WARNING "%s: Unable to open firmware %s\n", __FUNCTION__, sp887x_firmware); return -EIO; } - filesize = lseek(fd, 0L, 2); + filesize = sys_lseek(fd, 0L, 2); if (filesize <= 0) { printk(KERN_WARNING "%s: Firmware %s is empty\n", __FUNCTION__, sp887x_firmware); @@ -237,8 +236,8 @@ int sp887x_initial_setup (struct dvb_fro // read it! // read the first 16384 bytes from the file // ignore the first 10 bytes - lseek(fd, 10, 0); - if (read(fd, firmware, fw_size) != fw_size) { + sys_lseek(fd, 10, 0); + if (sys_read(fd, firmware, fw_size) != fw_size) { printk(KERN_WARNING "%s: Failed to read firmware\n", __FUNCTION__); vfree(firmware); sys_close(fd); diff -puN drivers/media/dvb/frontends/tda1004x.c~dvb-errno-removal drivers/media/dvb/frontends/tda1004x.c --- 25/drivers/media/dvb/frontends/tda1004x.c~dvb-errno-removal 2004-07-31 16:52:06.611994464 -0700 +++ 25-akpm/drivers/media/dvb/frontends/tda1004x.c 2004-07-31 16:52:06.620993096 -0700 @@ -32,7 +32,6 @@ */ -#define __KERNEL_SYSCALLS__ #include #include #include @@ -40,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -397,13 +395,13 @@ static int tda1004x_fwupload(struct dvb_ // Load the firmware set_fs(get_ds()); - fd = open(tda1004x_firmware, 0, 0); + fd = sys_open(tda1004x_firmware, 0, 0); if (fd < 0) { printk("%s: Unable to open firmware %s\n", __FUNCTION__, tda1004x_firmware); return -EIO; } - filesize = lseek(fd, 0L, 2); + filesize = sys_lseek(fd, 0L, 2); if (filesize <= 0) { printk("%s: Firmware %s is empty\n", __FUNCTION__, tda1004x_firmware); @@ -434,8 +432,8 @@ static int tda1004x_fwupload(struct dvb_ } // read it! - lseek(fd, fw_offset, 0); - if (read(fd, firmware, fw_size) != fw_size) { + sys_lseek(fd, fw_offset, 0); + if (sys_read(fd, firmware, fw_size) != fw_size) { printk("%s: Failed to read firmware\n", __FUNCTION__); vfree(firmware); sys_close(fd); diff -puN drivers/net/wireless/prism54/isl_38xx.c~dvb-errno-removal drivers/net/wireless/prism54/isl_38xx.c --- 25/drivers/net/wireless/prism54/isl_38xx.c~dvb-errno-removal 2004-07-31 16:52:06.613994160 -0700 +++ 25-akpm/drivers/net/wireless/prism54/isl_38xx.c 2004-07-31 16:52:06.620993096 -0700 @@ -18,8 +18,6 @@ * */ -#define __KERNEL_SYSCALLS__ - #include #include #include diff -puN include/asm-i386/unistd.h~dvb-errno-removal include/asm-i386/unistd.h --- 25/include/asm-i386/unistd.h~dvb-errno-removal 2004-07-31 16:52:06.614994008 -0700 +++ 25-akpm/include/asm-i386/unistd.h 2004-07-31 16:52:06.621992944 -0700 @@ -431,15 +431,7 @@ __syscall_return(type,__res); \ * won't be any messing with the stack from main(), but we define * some others too. */ -static inline _syscall0(pid_t,setsid) -static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) -static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) -static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) -static inline _syscall1(int,dup,int,fd) static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) -static inline _syscall3(int,open,const char *,file,int,flag,int,mode) -static inline _syscall1(int,close,int,fd) -static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount); asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, _