| Function report | 
| Source Code: ipc\shm.c | Create Date:2022-07-28 16:47:51 | 
| Last Modify:2020-03-17 22:58:32 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:shmctl_do_lock
Proto:static int shmctl_do_lock(struct ipc_namespace *ns, int shmid, int cmd)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct ipc_namespace * | ns | |
| int | shmid | |
| int | cmd | 
| 1071 | shp = shm_obtain_object_check(ns, shmid) | 
| 1074 | Go to out_unlock1 | 
| 1077 | audit_ipc_obj( & (shm_perm)) | 
| 1078 | err = security_shm_shmctl( & shm_perm, cmd) | 
| 1079 | If err Then Go to out_unlock1 | 
| 1082 | ipc_lock_object( & shm_perm) | 
| 1087 | Go to out_unlock0 | 
| 1091 | euid = current_euid() | 
| 1096 | Go to out_unlock0 | 
| 1098 | If cmd == super user shmctl commands && Not rlimit(RLIMIT_MEMLOCK) Then | 
| 1100 | Go to out_unlock0 | 
| 1105 | If is_file_hugepages(shm_file) Then Go to out_unlock0 | 
| 1108 | If cmd == super user shmctl commands Then | 
| 1109 | user = current_user() | 
| 1111 | err = shmem_lock(shm_file, 1, user) | 
| 1112 | If Not err && Not (mode & segment will not be swapped ) Then | 
| 1113 | mode |= segment will not be swapped | 
| 1114 | mlock_user = user | 
| 1116 | Go to out_unlock0 | 
| 1120 | If Not (mode & segment will not be swapped ) Then Go to out_unlock0 | 
| 1122 | shmem_lock(shm_file, 0, mlock_user) | 
| 1123 | mode &= ~segment will not be swapped | 
| 1124 | mlock_user = NULL | 
| 1126 | ipc_unlock_object( & shm_perm) | 
| 1131 | Return err | 
| 1133 | out_unlock0 : | 
| 1134 | ipc_unlock_object( & shm_perm) | 
| 1135 | out_unlock1 : | 
| 1137 | Return err | 
| Name | Describe | 
|---|---|
| ksys_shmctl | |
| compat_ksys_shmctl | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |