Development Diary -20,190,822 keyword study notes "Unix Advanced Programming Environment (Second Edition)," "control habit" DAY 2

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_31433709/article/details/100023881

Preface

Saying, yesterday began to try to change themselves, starting from the basic habits, 11:30 to bed on time, usually go to sleep until almost 12:30. It stands to reason, an hour earlier than usual to sleep, and then I put the alarm clock 45 minutes ahead of time, but also to think more sleep than usual 15 minutes, flattered. As a result, compared to the usual two hours to get up early. Then obviously, I feel a bit tired in the morning, it seems to take some time to adapt to the time difference. Good habits and bad habits to quit, in fact a lot of difficulty, or why mortals always endless, often rare talent it? All the details, why gaming professional players tend to pay attention to the general audience will not notice the details, but it would go deliberately temper it? Because the impact of micro-habits for the entire system caused it is huge!

Still today continue reading, today is more embarrassing, because there is no piece of time, barely read this chapter or dinner time to get pumped, bitterness and suffering.

Content

Unix is ​​a technique used to calling a function with the same name in a standard C library for each system. User process sequences using standard C calls to call these functions, and then, in turn calls the appropriate kernel service with the technical requirements of the system. For example, one or more function parameters into the general register C, and then perform a soft interrupt generated machine instructions into the core. From the application point of view, the system can be regarded as a C function calls.

Another difference between system calls and library functions are: to provide a system call is usually minimal interface, and libraries often provide more complex functions. We can see this from the difference between sbrk system calls and library functions malloc, in the future when the I / O functions and standard I / O functions with less cache, will also see the difference.

ANSI C mark your intention is to provide a C program portability, so that it can adapt to a wide variety of operating systems, not just UNIX. This standard not only defines the syntax and semantics of the C programming language, and also defines its standard library (Chapter IV ANSI 1989; Plauger 1992; Appendix B Kernighan and Richie 1988 in). Because a lot of new UNIX systems provide standard C library functions described, so this library for us is very important.

There are many implementation-defined magic number and Changshu, many of which have been written into the program, or as determined by the particular technology, due to the efforts of a large number of standardization, there may be several methods for determining these portable and magic achieve a defined limit. It is useful for software portability.

The following three types of features are required:

  • Compile-time option (the system supports job control)
  • Compile time limit (what is the maximum value of the short integer)
  • Run time limit (what the maximum number of characters in the file name is)

The first two, compile-time option can be defined in the header file. Program at compile time can contain these headers. But the running time limit is required to process calls a function to obtain such limit.

Further, certain limitations in a given implementation may be fixed (and therefore can be statically defined in a header file), while in the other changes may be achieved (need to have a run-time function call). An example of this type of limit is the maximum number of characters in the file name. System V historical reasons only in file names to 14 characters, while the Berkeley system is to increase this to 255. SVR4 allows us to specify for each file system is created in System V BSD file system or file system, and each system has different restrictions. This is an example of run time limit, the maximum length of the file name of the file which is dependent on the file system. For example, the root file system, file length limit of 14 characters may be, and in some other file system file name length limit may be 255 characters.

To solve these problems, there are three limitations:
(1) selection and editing time restrictions (the header file).
(2) Without limiting the run time of a file or directory associated with it.
(3) with the file or directory run time limit associated with it.

To make matters even more complicated is that if a specific run time limit does not change in a given system, it can be statically defined in a header file, but if not defined in the header file , the application must call a conf three functions to determine the value of its running time.

All restrictions are defined by ANSI C compiler time limit. Table 2-2 shows the restriction standard C file <limit.h> defined. These constants are always defined in the header file, and does not change in a given system. The third column lists the ANSI C standard acceptable minimum. This is for shaping the length 16 of the system, it uses the 1's complement representation. The fourth column lists the value of the current system shaping a length of 32 bits, using two's complement notation. Note that the data type for unsigned did not list their minimum, they should be zero.

Chapter habit control

However, in the long run, you can not adhere to the habits of the real reason is that your self-image interfere with you. This is why you can not be too obsessed with the identity of a version of. We ask you to renewal and progress. Be your own best version of you constantly need to decorate your faith to upgrade and expand your identity.

Your identity from your habits. You are not born with faith. Each beliefs, including your own beliefs, are learned by experience acquired through honed.

The more an act of repetitions, the more to strengthen the associated identity. In fact, the identity of the word is originally derived from the Latin word essentitas, meaning that there is, and identidem, meaning repeated. Your identity is actually your "repeatedly exists."

Over time, the impact of one-time experience will gradually hours, will affect the habits of growing, which means that you are used to provide most of the data to shape your identity. That being said, the process is actually a habit to become your own process.

Each habit will not only get results, but also teach you the more important thing: trust yourself. You start to believe that you really can accomplish these things. When the number of votes is increasing, evidence began to change when you tell your own story began to change.

Identity-based habits of this statement is another key theme of our first introduced in the book - feedback loop - when used. Your habits shape your identity. This is a two-way street.

Ultimately, your habits are important because they will help you become the kind of person you want to be. You harbor deep-seated belief in itself it is by means of a habit developed from this channel. It can be said, you become your habits.

Got home

It is 22:30, had got home, I feel tired today ah, is the cause of excessive indulgence I do? Still want to adhere to good habits, and gradually abandon bad habits. I have a pair of shoes, all red, all along, I gave myself silently made up a determined, if one day I hope to show my edge, I'll wear these shoes. I hope within a year to have this chance.

Good habits stick really hard, just write a diary every day habit and I are struggling persevered, and now half of it. Although there are probably only three weeks diary word "SHAME ON ME". As I said before, when I sent this, and that is basically the same day that I play, and that this feeling If set to visible to everyone, there will be a complete feeling in the water, think again, decided to set privacy on the line. But whatever the outcome is to maintain one of his many promises, there is some good news.

Well, to continue the rest of the learning task "Linux System Administration Handbook" feeling of being put off it. Because the contents inside I really felt the lack of practical, feeling a little out of my mind, so temporarily cut to "Unix-level programming environment" it, let me, which to some extent appropriate to consolidate consolidate what they have learned, it is in good thing. Dumbfounding.

Guess you like

Origin blog.csdn.net/qq_31433709/article/details/100023881