| Function report | 
| Source Code: kernel\sys.c | Create Date:2022-07-28 09:21:30 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:SYSCALL_DEFINE5
Proto:SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5)
Type:
Parameter:Nothing
| 2267 | me = current process | 
| 2275 | error = 0 | 
| 2277 | Case option == Second arg is a signal | 
| 2283 | Break | 
| 2284 | Case option == Second arg is a ptr to return the signal | 
| 2285 | error = Write a simple value into user space(The signal sent when the parent dies, (int__user * )arg2) | 
| 2286 | Break | 
| 2287 | Case option == Get/set current->mm->dumpable | 
| 2288 | error = get_dumpable(mm) | 
| 2289 | Break | 
| 2290 | Case option == PR_SET_DUMPABLE | 
| 2291 | If arg2 != No setuid dumping && arg2 != Dump as user of process Then | 
| 2295 | set_dumpable(mm, arg2) | 
| 2296 | Break | 
| 2298 | Case option == PR_SET_UNALIGN | 
| 2299 | error = SET_UNALIGN_CTL(me, arg2) | 
| 2300 | Break | 
| 2302 | error = GET_UNALIGN_CTL(me, arg2) | 
| 2303 | Break | 
| 2304 | Case option == PR_SET_FPEMU | 
| 2305 | error = SET_FPEMU_CTL(me, arg2) | 
| 2306 | Break | 
| 2308 | error = GET_FPEMU_CTL(me, arg2) | 
| 2309 | Break | 
| 2310 | Case option == PR_SET_FPEXC | 
| 2311 | error = SET_FPEXC_CTL(me, arg2) | 
| 2312 | Break | 
| 2314 | error = GET_FPEXC_CTL(me, arg2) | 
| 2315 | Break | 
| 2318 | Break | 
| 2319 | Case option == PR_SET_TIMING | 
| 2320 | If arg2 != Normal, traditional,statistical process timing Then error = -EINVAL | 
| 2322 | Break | 
| 2323 | Case option == Set process name | 
| 2324 | comm[ size of * executable name, excluding path. * - normally initialized setup_new_exec() * - access it with [gs]et_task_comm() * - lock it with task_lock() - 1] = 0 | 
| 2325 | If Copy a NUL terminated string from userspace < 0 Then Return -EFAULT | 
| 2328 | set_task_comm(me, comm) | 
| 2329 | proc_comm_connector(me) | 
| 2330 | Break | 
| 2331 | Case option == Get process name | 
| 2332 | get_task_comm(comm, me) | 
| 2335 | Break | 
| 2336 | Case option == Get/set process endian | 
| 2337 | error = GET_ENDIAN(me, arg2) | 
| 2338 | Break | 
| 2339 | Case option == PR_SET_ENDIAN | 
| 2340 | error = SET_ENDIAN(me, arg2) | 
| 2341 | Break | 
| 2342 | Case option == Get/set process seccomp mode | 
| 2343 | error = prctl_get_seccomp() | 
| 2344 | Break | 
| 2345 | Case option == PR_SET_SECCOMP | 
| 2346 | error = prctl_set_seccomp(arg2, (char__user * )arg3) | 
| 2347 | Break | 
| 2350 | Break | 
| 2351 | Case option == PR_SET_TSC | 
| 2352 | error = SET_TSC_CTL(arg2) | 
| 2353 | Break | 
| 2354 | Case option == PR_TASK_PERF_EVENTS_DISABLE | 
| 2355 | error = perf_event_task_disable() | 
| 2356 | Break | 
| 2357 | Case option == PR_TASK_PERF_EVENTS_ENABLE | 
| 2358 | error = perf_event_task_enable() | 
| 2359 | Break | 
| 2360 | Case option == PR_GET_TIMERSLACK | 
| 2361 | If timer_slack_ns > ULONG_MAX Then error = ULONG_MAX | 
| 2363 | Else error = timer_slack_ns | 
| 2365 | Break | 
| 2367 | If arg2 <= 0 Then timer_slack_ns = default_timer_slack_ns | 
| 2370 | Else timer_slack_ns = arg2 | 
| 2372 | Break | 
| 2377 | Case arg2 == PR_MCE_KILL_CLEAR | 
| 2382 | Case arg2 == PR_MCE_KILL_SET | 
| 2383 | flags |= Process policy on mce errors | 
| 2384 | If arg3 == PR_MCE_KILL_EARLY Then flags |= Early kill for mce process policy | 
| 2386 | Else if arg3 == PR_MCE_KILL_LATE Then flags &= ~Early kill for mce process policy | 
| 2388 | Else if arg3 == PR_MCE_KILL_DEFAULT Then flags &= ~(Early kill for mce process policy | Process policy on mce errors ) | 
| 2391 | Else Return -EINVAL | 
| 2393 | Break | 
| 2394 | Default | 
| 2395 | Return -EINVAL | 
| 2397 | Break | 
| 2398 | Case option == PR_MCE_KILL_GET | 
| 2401 | If flags & Process policy on mce errors Then error = If flags & Early kill for mce process policy Then PR_MCE_KILL_EARLY Else PR_MCE_KILL_LATE | 
| 2404 | Else error = PR_MCE_KILL_DEFAULT | 
| 2406 | Break | 
| 2407 | Case option == Tune up process memory map specifics. | 
| 2410 | Case option == PR_GET_TID_ADDRESS | 
| 2411 | error = prctl_get_tid_address(me, (int__user * * )arg2) | 
| 2412 | Break | 
| 2413 | Case option == PR_SET_CHILD_SUBREAPER | 
| 2414 | is_child_subreaper = Not Not arg2 | 
| 2415 | If Not arg2 Then Break | 
| 2418 | walk_process_tree(me, propagate_has_child_subreaper, NULL) | 
| 2419 | Break | 
| 2420 | Case option == PR_GET_CHILD_SUBREAPER | 
| 2421 | error = Write a simple value into user space(is_child_subreaper, (int__user * )arg2) | 
| 2423 | Break | 
| 2429 | Break | 
| 2430 | Case option == PR_GET_NO_NEW_PRIVS | 
| 2433 | Return If task_no_new_privs(current process) Then 1 Else 0 | 
| 2434 | Case option == PR_GET_THP_DISABLE | 
| 2437 | error = Not Not st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from | 
| 2438 | Break | 
| 2439 | Case option == PR_SET_THP_DISABLE | 
| 2442 | If down_write_killable( & mmap_sem) Then Return -EINTR | 
| 2444 | If arg2 Then Atomically set a bit in memory | 
| 2448 | lease a write lock | 
| 2449 | Break | 
| 2451 | Case option == PR_MPX_DISABLE_MANAGEMENT | 
| 2453 | Return -EINVAL | 
| 2454 | Case option == PR_SET_FP_MODE | 
| 2455 | error = SET_FP_MODE(me, arg2) | 
| 2456 | Break | 
| 2457 | Case option == PR_GET_FP_MODE | 
| 2458 | error = GET_FP_MODE(me) | 
| 2459 | Break | 
| 2460 | Case option == set task vector length | 
| 2461 | error = SVE_SET_VL(arg2) | 
| 2462 | Break | 
| 2463 | Case option == get task vector length | 
| 2464 | error = SVE_GET_VL() | 
| 2465 | Break | 
| 2466 | Case option == Per task speculation control | 
| 2469 | error = arch_prctl_spec_ctrl_get(me, arg2) | 
| 2470 | Break | 
| 2471 | Case option == PR_SET_SPECULATION_CTRL | 
| 2474 | error = arch_prctl_spec_ctrl_set(me, arg2, arg3) | 
| 2475 | Break | 
| 2476 | Case option == Reset arm64 pointer authentication keys | 
| 2481 | Case option == Tagged user address controls for arm64 | 
| 2486 | Case option == PR_GET_TAGGED_ADDR_CTRL | 
| 2489 | error = GET_TAGGED_ADDR_CTRL() | 
| 2490 | Break | 
| 2491 | Default | 
| 2495 | Return error | 
| 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 |