NOFILES bug in System V.3
John Limpert
johnl at n3dmc.UU.NET
Wed Nov 23 14:40:17 AEST 1988
In article <11616 at cup.portal.com> Walter_James_DeReu at 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 at n3dmc.UUCP, johnl at n3dmc.UU.NET, uunet!n3dmc!johnl
More information about the Comp.bugs.sys5
mailing list