- 论坛徽章:
- 0
|
In 2.4 kernels, what's the difference between NULL and 0? I know at least one place that these two behave differently. The function remove_proc_entry() takes two arguments, the first the name of the filenode, the second is the pointer to the parent directory, a NULL pointer means that filenode is directly under /proc directory. Now is the interesting part. The following function call
- remove_proc_entry("scullpmem", NULL);
复制代码
correctly removes the /proc/scullpmem file, while the next form
- remove_proc_entry("scullpmem", 0);
复制代码
doesn't work.
In the kernel source, NULL is defined as ((void *) 0).
Then what's the difference between NULL and 0? Thanks in advance.
====================================================
Sorry for troubling all you guys by this meanlingless question. Last Night I dug into the source code and found nothing interesting. In fact, by redoing the experiments I have got to know that the second form also worked. The malfunction must be caused by some reason, though not known yet.
Best Regards
[ 本帖最后由 daiban 于 2007-1-26 12:46 编辑 ] |
|