Chapter 6 Exercise Poetry: runtime Data Structure
A. Out: it is the abbreviation form of worker er output;
A. Out is an example of UNIX thinking "there is no reason, but we do it;
Super block (Basic Data Structure in the superblock Unix File System) is uniquely identified by the following magic number
# Define ps_magic 0x011954 the birthday of the real-time digital Berkeley Fast File System;
In UNIX, segments identify the content blocks related to a binary file;
Local variables do not enter a. Out, they are created at runtime;
The stack segment has three main purposes: 1. It provides storage space for local variables declared inside the function; 2. For function calling, it stores maintenance information related to this; 3. The stack can also be used as a temporary storage area;
int main() {int i;printf("The stack top is near %p\n", &i);return 0;}
The above small test programs can find the approximate location of your system stack;
In C language, all functions are at the top of the lexical hierarchy;
The pointer loses its validity (referencing something that does not exist) and is called "Dangling Pointer )";
The only thing that can use auto is to make your statement clearer and more tidy;
The GOTO statement cannot jump out of the current function of the C language (this is also the origin of longjmp name, it can jump far, or even be transferred to the function of other files );
#include<setjmp.h>#include<stdio.h>jmp_buf buf;banana() {printf("in banana()\n");longjmp(buf, 1);printf("you'll never see this, because i longjmped");}int main() {if(setjmp(buf))printf("back in main\n");else {printf("first time through \n");banana();}return 0;}
Setjmp and longjmp mutations in C ++ are more common exception handling mechanisms such as catch and throw ";
In UNIX, the stack automatically grows when the process requires more space. Programmers can imagine that the stack is infinitely large. This is one of the many advantages of UNIX over other operating systems such as MS-DOS;