函数逻辑报告 |
Source Code:ipc\shm.c |
Create Date:2022-07-27 18:23:43 |
| Last Modify:2020-03-17 22:58:32 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:Fix shmaddr, allocate descriptor, map shm, add attach descriptor to lists.* NOTE! Despite the name, this is NOT a direct system call entrypoint. The* "raddr" thing points to kernel space, and there has to be a wrapper around* this.
函数原型:long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr, unsigned long shmlba)
返回类型:long
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| int | shmid | |
| char __user * | shmaddr | |
| int | shmflg | |
| ulong * | raddr | |
| unsigned long | shmlba |
| 1426 | flags等于Share changes |
| 1432 | populate等于0 |
| 1438 | 如果addr则 |
| 1440 | 如果shmflg按位与und attach address to SHMLBA boundary 则 |
| 1454 | 转到:out |
| 1457 | flags或等于Interpret addr exactly |
| 1458 | 否则如果shmflg按位与ake-over region on attach 则转到:out |
| 1461 | 如果shmflg按位与ad-only access 则 |
| 1465 | 否则 |
| 1466 | prot等于page can be read 按位或page can be written |
| 1470 | 如果shmflg按位与xecution access 则 |
| 1471 | prot或等于page can be executed |
| 1481 | shp等于shm_obtain_object_check(ns, shmid) |
| 1482 | 如果是错误则 |
| 1484 | 转到:out_unlock |
| 1491 | err等于security_shm_shmat( & shm_perm, shmaddr, shmflg) |
| 1492 | 如果err则转到:out_unlock |
| 1495 | ipc_lock_object( & shm_perm) |
| 1514 | shm_nattch自加 |
| 1516 | ipc_unlock_object( & shm_perm) |
| 1521 | 如果非sfd则 |
| 1523 | 转到:out_nattch |
| 1531 | 如果是错误则 |
| 1538 | ns等于get_ipc_ns(ns) |
| 1540 | vm_ops = NULL |
| 1543 | err等于security_mmap_file(file, prot, flags) |
| 1547 | 如果lock for writing则 |
| 1552 | 如果addr且非shmflg按位与ake-over region on attach 的值则 |
| 1563 | err等于0 |
| 1564 | 如果IS_ERR_VALUE(addr)则err等于addr |
| 1566 | invalid : |
| 1567 | lease a write lock |
| 1568 | 如果populate则mm_populate(addr, populate) |
| 1571 | out_fput : |
| 1574 | out_nattch : |
| 1575 | lock for writing |
| 1576 | shp等于shm_lock_(check_) routines are called in the paths where the rwsem* is not necessarily held. |
| 1577 | shm_nattch自减 |
| 1580 | 否则shm_unlock(shp) |
| 1582 | lease a write lock |
| 1583 | 返回:err |
| 1585 | out_unlock : |
| 1587 | out : |
| 1588 | 返回:err |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |