Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\maccess.c Create Date:2022-07-28 14:07:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__strncpy_from_unsafe

Proto:long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count)

Type:long

Parameter:

TypeParameterName
char *dst
const void *unsafe_addr
longcount
186  old_fs = get_fs()
187  src = unsafe_addr
190  If Value for the false possibility is greater at compile time(count <= 0) Then Return 0
193  set_fs(KERNEL_DS)
194  These routines enable/disable the pagefault handler. If disabled, it will* not take any locks and go straight to the fixup table.* User access methods will not sleep when called from a pagefault_disabled()* environment.
196  Do
197  ret = Get a simple variable from user space, with less checking( * dst++, (constchar__user__force * )src++)
198  When dst[ - 1] && ret == 0 && src - unsafe_addr < count cycle
200  dst[ - 1] = '\0'
201  pagefault_enable()
202  set_fs(old_fs)
204  Return If ret Then -EFAULT Else src - unsafe_addr