Subject: Re: uprintf() limitations?
To: Nick Gimbrone <Nicholas.Gimbrone@Comcast.Net>
From: Alfred Perlstein <bright@mu.org>
List: tech-kern
Date: 03/12/2002 22:11:33
* Nick Gimbrone <Nicholas.Gimbrone@Comcast.Net> [020312 21:52] wrote:
> I have a piece of kernel code (in an ioctl() routine for a pseudo-device driver)
> that wants to issue about 100ish uprintf() calls. I'm finding that (roughly) the
> first 40ish are displayed to the user (about 1-2KB of output I'd guess by
> eyeballing it) and the rest seem to disappear into never never land...
> specifically at about the same total bytes of output the then current line of
> output from uprintf() is terminated and the next byte displayed on the terminal
> is the first line of output from the userland printf() statement that follows
> all the uprintf() calls in the kernel.
> 
> I didn't see any documented limitations in the man page for uprintf(), and am
> hoping that perhaps someone can provide some insight before I go code diving to
> figure out why this is occuring...

Just guessing that you're filling the tty's buffer.  You really
shouldn't be using uprintf.  If you really need to print like this
you probably want to make some sort of binary blob that's passed
around or possibly have the user process give a large enough buffer
to the ioctl so that it can sprintf the message and then copyout(9)
it.

-Alfred