Re: getname() & IS_ERR

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

 





On 12/11/05, Saumender Dash <sdash@xxxxxxxxxxxxxxxxxxx> wrote:
 In system calls like open(), chmod(), chown() etc. getname() is used to
copy the user space file name/path to the kernel space. Correct me if I'm
wrong.

Right !

The it err check the return value by the macro IS_ERR.
If  "IS_ERR" succeeds then the syscall return from there.

What this IS_ERR/IS_ERR_VALUE/unlikely() does?

The comments above these functions in linux/err.h are mentioning the
reason for those functions (see
http://lxr.linux.no/source/include/linux/err.h#L9) and as you can see
they are just type-casting a pointer to long type or vice-versa. As
far as unlikely/likely is concerned they are for compiler mentioning
that

for unlikely(condition): condition is not expected (very less chances
to occur) and so can put its code in last of compiled file so that
jumping won't occur as this condition occuring chance is less (but if
the condition occurs then overhead of jumping might slow the things)

for likely(condition): condition is expected to occur so put its code
such that jumping won't occur

I may not able to explain the things, but you can search kernelnewbies
archieve for mail thread (AFAIR of October, 2005 and topic name is
likely() ) in which people explained that in detail.

Why this getname() fails in which condition?

You can see the code of getname and look for where its returning
values. I can't say much about it !

Thanks Lateef.
This will be enough for me to go ahead.

Saumendra Dash.

--
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