ERR_PTR usage question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

Let's assume that I write function that will return
struct buffer_head *, and want also signal about error
can I use ERR_PTR mechanizm for this?

And more general question, when ERR_PTR bad decision,
and when not?

I see some places in kernel, with such functions:

struct foo *f(int *err)
{
*err = ESOMERR;
return NULL;
}

why so?

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux