Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!netcom!ward From: ward@netcom.UUCP (Mike Ward) Newsgroups: comp.os.minix Subject: MINIX V1.3 /dev/null fix Keywords: /dev/null Message-ID: <1543@netcom.UUCP> Date: 20 Jun 89 23:42:56 GMT Organization: NetCom Services - Public Access Unix System (408) 997-9175 guest Lines: 24 In article <18082@louie.udel.EDU> Guy Helmer writes: >Does someone know where I can find the patch for the null device >(/dev/null) in Minix 1.3? I'm referring to the problem where >cat /dev/null > a_file does not result in a file with 0 bytes, >but a file that grows until you kill the cat command. Thanks in >advance. > >-- Guy Helmer BITNET: HELMER@SDNET > Dakota State College (11 days to being a University!!!) > Madison, SD AT&T: (605) 256-5315 I don't really know of an offical patch for this, but I had the same problem and the solution is a one-liner. If you look in kernel/memory.c you will find the following line of code: if (device==NULL_DEV) return (m_ptr->m_type == DISK_READ ? 0 : m_ptr->count); The problem is that if the operation type is DISK_READ then the value EOF should be returned rather than 0. To fix it, simply change the 0 to EOF. Hope this helps.