Beginner "Unix environment advanced programming" friends will encounter a problem, run inside the instance (download: http://www.apuebook.com/) problems, prompt "error: apue. h: No file or directory ".Apue. H is a header file customized by the author, including common header files and error handling functions required by the program. So it should be put into the system
UNIX advanced environment programming (3) Files And Directories, unixdirectories
In the previous two articles, we learned some basic operation functions of IO operations, including open, read, and write.
In this article, we will learn about other features of the file system and the attributes of a file. The functions involved include:
View all attributes of
1, for the system call in the IO, is for the file descriptor. And for standard IO is for streaming.The standard IO function returns a pointer to file.2. Open the StreamFILE *f;f = fopen ("./a.txt", wr+);A pointer to the open file is obtained from above, and subsequent operations can be based on this pointer.3. Read and Write data streams(1) io:getc (f) fgetc (f) getchar () reading one character at a timeGetChar (): Indicates that characters are obtain
process group of the PID process to Pgid. If Pid=pgid, or Pgid for 0,pid to become the leader Process Group ID Committee PID; In order to be able to use the caller's process ID, if the PID is 0, the process ID of the caller is used, only the process group ID of itself and the child process can be set. A child process called exec is not allowed to change the sub-process. In order to prevent the parent-child process order from being uncertain, the team member and the team leader set the process g
Tags: UI login types Child span results end NALIn this chapter, people indefinitely the feeling, mainly do not know how to use the actual. Learning from the previous chapters, each process has a parent process, and when the child process terminates, the parent process is notified and gets the exit status of the child process. First of all, the basic knowledge of this chapter is summarized as follows, in the future look at the time to summarize.1. Terminal LoginThe process of Terminal login
and XP in smoke
Lean from the trenches: Managing large-scale projects with Kanban lean development practices-using dashboards to manage large projects
Continuous integration: improving software quality and risk cing risk continuous integration-path to software quality improvement and risk reduction
Continuous delivery: reliable software releases through build, test, and deployment automation continuous delivery-System Method for releasing re
[07] UNIX process environment========================================1. Process TerminationAtexit () function registration termination processProgram.Exit () or return statement:Terminate the Handler-> terminate the Handler-> standard I/O cleanup-> _ exit ()-> enter the kernel._ Exit () directly enters the kernel.
2. Environment tableExtern char ** environ;Example:For (I = 0; Environ [I]! = NULL; I ++){Printf ("env [% d]: % s \ n", I, Environ [I]);}
available, the sigio signal can be sent to the process group.
O_direct directly performs file IO, and the system does not cache it as much as possible. For details, refer to the following link: http://blog.csdn.net/zhangxinrun/article/details/7635570http://laokaddk.blog.51cto.com/368606/699563/http://www.ukuug.org/events/linux2001/papers/html/AArcangeli-o_direct.html o_noatime, read the file does not change the last access time.
In addition, there ar
2016.8.19 17:20-17:50HP-UX is based on System V and are tied to Hewlett-Packard ' s hardware platforms. It ' s closer to the ancestral source tree than either Solaris or AIX, but HP have kept pace with developments in the OS worl D and have added a variety of its own enhancements. Now that HP have begun supporting Linux as well, the future of HPUX was somewhat less clear.HP- UX is based on system V and is u
The UNIX volume I bought last summer has only begun to look very ashamed, and I am ashamed that the first program has been on and off for a few days, so I have to write a program, and I am looking for a job soon, the following describes how to run the first program in this book:
Search various blogs
I use Ubuntu 13.04 as the system.
Thanks to the blog: After the
Linux and Unix Secure Programming: environment variables-general Linux technology-Linux programming and kernel information. For details, see the following.
Environment Variable
By default, environment variables are inherited from the parent process of the process. However, when the program executes another program, the calling program can set the environment var
be executed, the shell will search the disk and find the specified program, and when found, the shell requests the kernel to initialize the program, and then the shell goes to "sleep" until the program finishes executing.Program Name parameter tableShell role:implementation procedures;Interpreting programming languages;Environmental control;Pipe line Connection;I/O redirection;Variable and file name substitution;The shell determines the starting and
Process ControlPS auxPS AXJPS AXFPS AXMI. Process identifierspid_t---->long intUnique identity of the process0 calling process (kernel)1init process (user-state ancestor process for all processes)Getpid (2);Getppid (2);Status of the processs interruptible sleep stateR Run StateD Non-disruptive sleep stateT stop Statex termination stateZ Zombie StateProcess priorityS conversation leaderL MultithreadingN Low-priority+ in the foreground process groupTwo. Fork (2)Differences between parent and child
1. Blocking IO: The socket is blocked by default, and the model is blocked on the system call until the data reaches the kernel area and completes the copy of the data from the kernel zone to the user process area.2. Non-blocking IO: The model sets the state of the socket to non-blocking, polling the socket state until the data reaches the kernel area and completes the data copy of the kernel area to the user area, which feels like a spin lock under L
Chapter 3 Introduction to socket programming
Each socket uses a semi-correlation description:{Protocol, local address, local port}A complete socket is described as follows:{Protocol, local address, local port, remote address, remote port}Each socket has a unique local socket number, which is allocated by the operating system.
1. struct sockaddrThis structure is used to store socket addresses.Data Definition
achieve synchronization structSembuf p = {1,-1,0};structSembuf v = {0,1,0}; while(1){//client read the data and determine if the data came from the server is quit, if the direct program ends for quitSemop (sem_id, p,1);printf("ser:>%s\n", addr);if(strncmp(Addr,"Quit",4) ==0){ Break; }//The data read is not quit, the client writes the data "at this point the value of signal number 1th is 0, the client's read operation is blocked" printf("Cli:>"); Gets (addr);//If the data sent by the
Why should you read this book?Microsoft Windows CEProgramDesign is written by anyone who wants to write applications for a Windows CE or. NET simplified framework. Embedded System programmers use Windows CE for specific applications. Windows programmers are very interested in writing or porting an existing windows program, and can even manageCodeDevelopers can use the information in this
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.