All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Pierre Savary <pierre.savary@kerlink.fr>
Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: syscall in a module
Date: Thu, 20 Dec 2007 09:16:05 +0000	[thread overview]
Message-ID: <20071220091605.GC7921@flint.arm.linux.org.uk> (raw)
In-Reply-To: <000001c842e7$3f2cd340$bd8679c0$@savary@kerlink.fr>

On Thu, Dec 20, 2007 at 10:03:53AM +0100, Pierre Savary wrote:
> I need some help about syscalls and modules. In fact I want to adapt the
> g_file_storage module to my own application.
> I need to use "sys_umount" and "sys_mount" but when I compile I obtain this
> message :
> [...]
>   Kernel: arch/arm/boot/zImage is ready
>   Building modules, stage 2.
>   MODPOST 4 modules
> ERROR: "sys_umount" [drivers/usb/gadget/g_file_storage.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
> [...]
> 
> So, how can I use "sys_umount" and "sys_mount" in this module?

You don't.  Syscalls are NOT for modules because they modify the
filesystem, which depends on the user context.  For example, processes
running chroot have a different view of the filesystem from those which
aren't - and if you happen to be executing with the context of a
chrooted user process when you mount, and a non-chrooted process when
you umount.

I suggest you describe what you're trying to do in greater detail, and/or
ask on the main kernel list - but note that if you ask the same question
without explaining why you need it _and_ asking for alternative ideas,
you'll get the same kind of response there.

       reply	other threads:[~2007-12-20  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <000001c842e7$3f2cd340$bd8679c0$@savary@kerlink.fr>
2007-12-20  9:16 ` Russell King - ARM Linux [this message]
     [not found]   ` <000401c842ea$5aef1ea0$10cd5be0$@savary@kerlink.fr>
2007-12-20 10:15     ` syscall in a module Russell King - ARM Linux
     [not found]       ` <001101c842f6$3793a4b0$a6baee10$@savary@kerlink.fr>
2007-12-27 16:13         ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071220091605.GC7921@flint.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre.savary@kerlink.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.