which function copies data from user to kernel mode

when transitionaning from user to kernel mode which function copies data from user mode buffer to kernel mode?

user space is visible and writable from kernel mode operations.

example

rc=read(fd, buf, 32);

read -or the syscall behind it - accesses kernel data and writes it directly into buf. buf is a user space variable.

So - I'm not sure what you are really asking about.

1 Like

thanks jim for the reply.
when a write request is issued from an application in user mode then while transitioning from user to kernel mode after the software interrupt is generated the buffer data is copied from user to kernel mode
actually I want which function does this copying

The relevant kernel functions are copy_from_user and copy_to_user.

On Solaris 10:

#define COPY_FROM_USER(target, source, offs, count) \
        if (uiomove((target), count, UIO_WRITE, source)) { \
                cmn_err(CE_WARN, "Bad copyin()!\n"); \
        }

#define COPY_TO_USER(target, offs, source, count) \
        if (uiomove((source), count, UIO_READ, target)) { \
                cmn_err(CE_WARN, "Bad copyout()!\n"); \
        }

coronna is correct
The following link replies my question and clears it all:
Kernel command using Linux system calls

Read the "Reading and writing user memory" in the above link.