Skip to contentSkip to conversation

which errno should I use

DISCUSSION Ralph Blach 2 participants 2 messages Jan 30, 2001

lore
Share & tools
lore
#0 lore raw

I am writing a character device driver. I want this device driver to return an error if the user request less than say 1024 byte of data. What errno should I use? Is it legal to return an error if not enouth bytes are requested?

Thanks

Chip

begin:vcard
n:Blach;Ralph
tel;work:919-543-1207
x-mozilla-html:TRUE
url:www.ibm.com
org:IBM MicroElectronics
adr:;;3039 Cornwallis ;RTP;NC;27709;USA
version:2.1
email;internet:[email protected]
x-mozilla-cpt:;15936
fn:Ralph Blach
end:vcard

#1 lore raw

Hi Ralph,

Quoted 4 lines · in message <[email protected]> you wrote:

I am writing a character device driver. I want this device driver to return an error if the user request less than say 1024 byte of data. What errno should I use? Is it legal to return an error if not enouth

EINVAL (Invalid argument) is often used in this situation.

Quoted 1 line

bytes are requested?

Sure. Many character devices have certain restrictions on the I/O size.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01 (with TQ Components); our presentation "Starke Zwerge: Embedded Linux auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/