Path: utzoo!attcan!uunet!n3dmc!johnl From: johnl@n3dmc.UU.NET (John Limpert) Newsgroups: comp.bugs.sys5 Subject: Re: NOFILES bug in System V.3 Message-ID: <444@n3dmc.UU.NET> Date: 23 Nov 88 04:40:17 GMT References: <11616@cup.portal.com> Reply-To: johnl@n3dmc.UUCP (John Limpert) Organization: N3DMC, Silver Spring, Maryland Lines: 16 In article <11616@cup.portal.com> Walter_James_DeReu@cup.portal.com writes: >I am currently working around this by arranging for /dev/null to be >opened as file descriptor 20. This keeps my buffer from getting trashed >but is hardly elegant. Does anyone have a better solution? I ran into this when writing some code that emulated UNIX system calls on a real-time system. The problem is the brain damaged implementation of sprintf and sscanf, they both use file descriptor #20 and assume the read and write system calls will fail due to the illegal descriptor. This trick saves a few bytes of code at the cost of generating bogus and useless system calls. The 'illegal' descriptor number could be changed or the implementation of sprintf and sscanf could be fixed. -- John A. Limpert UUCP: johnl@n3dmc.UUCP, johnl@n3dmc.UU.NET, uunet!n3dmc!johnl