All of lore.kernel.org
 help / color / mirror / Atom feed
* return negative number for unsigned long function in kernel
@ 2007-03-06 14:52 Chen, Dongliang
  2007-03-06 19:05 ` Andreas Schwab
  2007-03-07  0:39 ` H. Peter Anvin
  0 siblings, 2 replies; 5+ messages in thread
From: Chen, Dongliang @ 2007-03-06 14:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chen, Dongliang

There are lots of functions in the Linux kernel that are declared as
unsigned long, but the return value is negative integer while error
occurred. An example of these functions is do_mmap_pgoff in mm/mmap.c,
which is defined as:

unsigned long do_mmap_pgoff(....)

In this function, it returns -ENODEV, -EPERM, -ENOMEM, -EINVAL, -EAGAIN,
-EACCESS depends on the error type. My question is how should the caller
perform error check based on the return value? 


Please CC reply to me at chen.d@ems-t.com
 

Thanks,

Dongliang Chen

Staff Engineer
EMS Technologies, Inc - Defense and Space Systems
660 Engineering Dr
Norcross, GA 30092
Tel: 770-263-9200 x 4379




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-07 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 14:52 return negative number for unsigned long function in kernel Chen, Dongliang
2007-03-06 19:05 ` Andreas Schwab
2007-03-07  0:39 ` H. Peter Anvin
2007-03-07 13:31   ` Chen, Dongliang
2007-03-07 16:30     ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.