Jerry Peters <je...@example.invalid> wrote:
> fl <
rxj...@gmail.com> wrote:
>> Hi,
>>
>> I remember it said that C lib function printf() cannot be called in a device driver in Linux. Today I come across the following code snippet. I wonder that sprintf function can be called in the interrupt function?
>>
> It can't, because it writes to a file, stdout. Sprintf "writes" to an
> existing string so there's no i/o. Sprintf is just a convenient way to
> construct a fancy formatted string.
>
> There is another function, kprintf, which can be used similiarly to
> printf, but it wrties to a kernel buffer.