See here everyone basically know how to do Linux under the assembly system call; But some children's shoes may ask: How do you know the extra assembly code that we've solved in functions in C library?
OK, I admit: I know through the reverse, this seems to be a bit of a foul suspicion ...
For example, in the previous article in the Mmap C library function, first write a C code:
#include <stdlib.h>#include <stdio.h>#include <stdbool.h>#include <sys/mman.h>#include <sys/types.h>#include <fcntl.h>#include <errno.h>#include <string.h>#include <math.h>#include <unistd.h>intMainvoid){intSize =4096;printf("Anonymous is%08x\n", map_anonymous);printf("Err test is%s\n", Strerror ( A));//in Linux With-d_bsd_source Char*buf = Mmap (null,size,prot_read| prot_write,map_anonymous,-1,0);printf("BUF is%p\n", buf);if(buf = = map_failed) {//if (buf < 0) { printf("Mmap failed (%s) \ n", Strerror (errno));return 1; }return 0;}
The previous introduction of several Linux under the Integrated debugging environment, here we still use codelite instead of codeblocks, the reason is very simple, the latter need C library function source code to view C library in debugging assembly instructions, and we generally can not find these source code.
However, Codeblocks can set the syntax of the assembly, such as can be set to the Intel type:
And CodeLite seems to have found no place to set up, only with the brain between the T and Intel to convert birds.
Linux under 64-bit assembly system call (5)