public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* put_user_byte()
@ 2002-04-11  5:54 blesson paul
  2002-04-11 11:01 ` put_user_byte() Brian Gerst
  0 siblings, 1 reply; 3+ messages in thread
From: blesson paul @ 2002-04-11  5:54 UTC (permalink / raw)
  To: linux-kernel

Hi all
                I need to copy some data from kernel memory space to user 
memory space. When I investigated, the command for that purpose is 
put_user_byte(). But in kernel2.4, I can't find the implementation of this 
command. I want to know the command which replaced put_user_byte() in 2.4 
kernel. Also I want to know whether there is any synonyms for verify_area() 
in kernel 2.4
regards
Blesson Paul



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: put_user_byte()
  2002-04-11  5:54 put_user_byte() blesson paul
@ 2002-04-11 11:01 ` Brian Gerst
  2002-04-13  8:57   ` put_user_byte() Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Gerst @ 2002-04-11 11:01 UTC (permalink / raw)
  To: blesson paul; +Cc: linux-kernel

blesson paul wrote:
> Hi all
>                I need to copy some data from kernel memory space to user 
> memory space. When I investigated, the command for that purpose is 
> put_user_byte(). But in kernel2.4, I can't find the implementation of 
> this command. I want to know the command which replaced put_user_byte() 
> in 2.4 kernel. Also I want to know whether there is any synonyms for 
> verify_area() in kernel 2.4
> regards
> Blesson Paul

Use put_user(val, uaddr).  val must be of type unsigned char (or casted 
to it).  It will return 0 on success or -EFAULT on fault.  verify_area() 
is normally not needed in 2.4, unless you are copying many values to 
user space and only want to do the priviledge check once on the whole range.

-- 

						Brian Gerst


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: put_user_byte()
  2002-04-11 11:01 ` put_user_byte() Brian Gerst
@ 2002-04-13  8:57   ` Russell King
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2002-04-13  8:57 UTC (permalink / raw)
  To: Brian Gerst; +Cc: blesson paul, linux-kernel

On Thu, Apr 11, 2002 at 07:01:25AM -0400, Brian Gerst wrote:
> Use put_user(val, uaddr).

Correct.

> val must be of type unsigned char (or casted to it).

put_user does not care what value you pass it as val.  It only cares
about the type of uaddr.  The following are all equivalent as far as
the size of the data type written to user space:

	put_user((int)foo, (char *)bar);
	put_user((char)foo, (char *)bar);
	put_user((long)foo, (char *)bar);

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-13  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-11  5:54 put_user_byte() blesson paul
2002-04-11 11:01 ` put_user_byte() Brian Gerst
2002-04-13  8:57   ` put_user_byte() Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox