Re: namei() query

From: David S. Miller (davem@redhat.com)
Date: Tue Apr 18 2000 - 02:20:51 EST


   Date: Tue, 18 Apr 2000 12:03:54 +0530 (IST)
   From: akshata <akshata@giasdla.vsnl.net.in>

   I'm trying to use namei() in a module, something like:

   namei("/tmp");

   but it returns an error (-14).

This would work:

        mm_segment_t orig_fs;

        orig_fs = get_fs();
        set_fs(KERNEL_DS);
        err = namei("/tmp");
        set_fs(old_fs);

The namei function expects user space pointers, you're sending
it a kernel pointer, so you have to adjust your mm segment during
the call.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:12 EST