From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: What's wrong with this really simple function?
Date: Sun, 27 Nov 2005 19:01:34 -0600 [thread overview]
Message-ID: <438A56EE.8030603@shaw.ca> (raw)
In-Reply-To: <5dCs1-7zM-853@gated-at.bofh.it>
Mohamed El Dawy wrote:
> Hi,
> I have created this 5-liner system call, which basically opens a
> file, write "Hello World" to it, and then returns. That's all.
>
> Now, when I actually call it, it creates the file successfully but
> writes nothing to it. The file is created and is only zero bytes. So,
> either write didn't write, or close didn't close. Any help would be
> greatly appreciated.
Well, the main thing wrong is that you are writing to a file from inside
the kernel, that is just wrong.. However likely the reason why the write
didn't work is that it expects an address inside userspace memory and
you've given it a character literal which is inside the kernel address
space.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2005-11-28 1:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5dCs1-7zM-853@gated-at.bofh.it>
2005-11-28 1:01 ` Robert Hancock [this message]
2005-11-27 18:57 What's wrong with this really simple function? Mohamed El Dawy
2005-11-28 7:55 ` Juergen Quade
2005-11-28 12:46 ` Nikita Danilov
2005-11-28 13:09 ` linux-os (Dick Johnson)
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=438A56EE.8030603@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox