Function report | 
Source Code:fs\binfmt_misc.c | 
Create Date:2022-07-28 20:27:40 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:he loader itself
Proto:static int load_misc_binary(struct linux_binprm *bprm)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct linux_binprm * | bprm | 
| 135 | struct file * interp_file = NULL | 
| 137 | fd_binary = -1 | 
| 144 | read_lock( & entries_lock) | 
| 145 | fmt = Check if we support the binfmt* if we do, return the node, else NULL* locking is done in load_misc_binary | 
| 146 | If fmt Then get a reference to a dentry | 
| 148 | read_unlock( & entries_lock) | 
| 154 | If interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE Then Go to ret | 
| 157 | If Not ( type, status, etc. & MISC_FMT_PRESERVE_ARGV0) Then | 
| 163 | If type, status, etc. & MISC_FMT_OPEN_BINARY Then | 
| 169 | fd_binary = get_unused_fd_flags(0) | 
| 170 | If fd_binary < 0 Then | 
| 174 | fd_install(fd_binary, file) | 
| 178 | would_dump(bprm, file) | 
| 180 | allow_write_access(file) | 
| 181 | file = NULL | 
| 184 | interp_flags |= BINPRM_FLAGS_EXECFD | 
| 185 | interp_data = fd_binary | 
| 187 | Else | 
| 196 | argc++ | 
| 202 | argc++ | 
| 205 | retval = bprm_change_interp( filename of interpreter , bprm) | 
| 209 | If type, status, etc. & MISC_FMT_OPEN_FILE Then | 
| 211 | If Not IS_ERR(interp_file) Then deny_write_access(interp_file) | 
| 213 | Else | 
| 214 | interp_file = open_exec( filename of interpreter ) | 
| 216 | retval = PTR_ERR(interp_file) | 
| 217 | If IS_ERR(interp_file) Then Go to error | 
| 220 | file = interp_file | 
| 221 | If type, status, etc. & MISC_FMT_CREDENTIALS Then | 
| 222 | pos = 0 | 
| 228 | memset(buf, 0, sizeof(linux_binprm->buf) ) | 
| 229 | retval = kernel_read(file, buf, sizeof(linux_binprm->buf) , & pos) | 
| 231 | Else retval = Fill the binprm structure from the inode.* Check permissions, then read the first BINPRM_BUF_SIZE bytes* This may be called multiple times for binary chains (scripts for example). | 
| 241 | ret : | 
| 243 | Return retval | 
| 244 | error : | 
| 245 | If fd_binary > 0 Then In contrast to sys_close(), this stub does not check whether the syscall* should or should not be restarted, but returns the raw error codes from* __close_fd(). | 
| 247 | interp_flags = 0 | 
| 248 | interp_data = 0 | 
| 249 | Go to ret | 
| 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  |