Forgot to Cc: here:
You can't call kernel strlen on a userland address, you must do
something like this:
How so ? It seems to work for me. For instance, I used userland
address space buffer to simulate __getcwd() syscall on the current
process (I was hacking open() syscall and log full path
* Eugene L. Vorokov [EMAIL PROTECTED] [010713 01:33] wrote:
Forgot to Cc: here:
You can't call kernel strlen on a userland address, you must do
something like this:
How so ? It seems to work for me. For instance, I used userland
address space buffer to simulate __getcwd() syscall on
write() doesn't exist in the kernel. The simple answer is you're
going to have to read what the send() syscall does and emulate it.
First, though, you need to answer the question why do I want to do
this in the kernel?
it actually exists, however the problem is that copyin and friends
Have a look at the digi driver in -current where I did this. The
caveat is that the kernel code looks ugly. From the driver's ioctl
routine:
case DIGIIO_IDENT:
return (copyout(sc-name, *(char **)data,
strlen(sc-name)
/*
* return number of characters in a userland address string
* or -1 if an illegal access occurs.
*/
int
user_strlen(uaddr)
char *uaddr;
{
int ret;
ret = -1;
do {
ch = fubyte(uaddr);
ret++;
} while (ch != 0 ch != -1);
ch = fubyte(uaddr);
And one more question, does this mean that I can't use things x = *uaddr
and *uaddr = x for userspace, but always have to use fubyte() and subyte () ?
If so, what is the reason it was done like that ?
Regards,
Eugene
To Unsubscribe: send mail to [EMAIL
In message [EMAIL PROTECTED], [EMAIL PROTECTED] w
rites:
ch = fubyte(uaddr);
And one more question, does this mean that I can't use things x = *uaddr
and *uaddr = x for userspace, but always have to use fubyte() and subyte () ?
Right.
If so, what is the reason it was done like
* Eugene L. Vorokov [EMAIL PROTECTED] [010713 10:16] wrote:
/*
* return number of characters in a userland address string
* or -1 if an illegal access occurs.
*/
Then I don't get it. Won't this piece of code cycle forever fetching
first byte of the string again and again ? According
* Eugene L. Vorokov [EMAIL PROTECTED] [010713 10:24] wrote:
ch = fubyte(uaddr);
And one more question, does this mean that I can't use things x = *uaddr
and *uaddr = x for userspace, but always have to use fubyte() and subyte () ?
If so, what is the reason it was done like that
Alfred Perlstein wrote:
write() doesn't exist in the kernel. The simple answer is you're
going to have to read what the send() syscall does and emulate it.
First, though, you need to answer the question why do I want to do
this in the kernel?
it actually exists, however the problem is
Alfred Perlstein wrote:
* Greg Lehey [EMAIL PROTECTED] [010712 21:08] wrote:
On Thursday, 12 July 2001 at 6:58:09 -0500, [EMAIL PROTECTED] wrote:
Dear Friends
I have some questions about kernel programming:
You'd be better off sending mail like this to -hackers. I've followed
On Thursday, 12 July 2001 at 6:58:09 -0500, [EMAIL PROTECTED] wrote:
Dear Friends
I have some questions about kernel programming:
You'd be better off sending mail like this to -hackers. I've followed
up there.
1. Why I can call some system calls functions into the kernel but
another
* Greg Lehey [EMAIL PROTECTED] [010712 21:08] wrote:
On Thursday, 12 July 2001 at 6:58:09 -0500, [EMAIL PROTECTED] wrote:
Dear Friends
I have some questions about kernel programming:
You'd be better off sending mail like this to -hackers. I've followed
up there.
I also got
13 matches
Mail list logo