Alibabacloud.com offers a wide variety of articles about advanced programming in unix environment, easily find your advanced programming in unix environment information here online.
Tags: GPO discard Linu related Extensions inux programming system interfaceThe UNIX environment Advanced programming terminology is many, the concept content, also many, but the study concept nature, the standard rule class thing, presumably is this--needs to expand the content many.Linux programming, illustrated, the code is sufficient enough, it seems that the
UNIX advanced environment programming (5) Files And Directories, unixdirectories
1 File Times
Each file maintains three time fields, each representing a different time field. See the following table:
Field description:
St_mtim (the modification time) records the last time the file content was modified.
St_ctim (the changed-status time) records the last time t
can be linked to a nonexistent file, and if the user is unfamiliar with the symbolic link, it is easy to be confused by this situation.At this point, you can use the "-l" command of LS to see the "--" symbol, or the first bit of the preceding symbol "L" for symbolic links, or with LS "-f" command, the symbolic link file followed by an @ character.?11 Creating and reading symbolic links (Symbolic links)Function: Creating Symbolic Linksfunction declaration:
#include
int symlink (con
terminal.
The function GetSID returns the process group ID of a session leader process.function declaration:
#include
pid_t getsid (pid_t pid);
? ? ? ? Returns:session leader ' s process group ID if OK,-1 On Error
If the PID is 0, the function GetSID returns the process group number of the session leader process where the calling process resides.??Resources:"Advanced programming in the
disk based on the disk location indicated by the handle, without checking whether the file is deleted.
DU/etc/| sort-Nr | the more command indicates to display the directory/etc/. when viewing the usage of the directory, the sort parameter-Nr indicates to reverse sort by numerical sorting, because we want to sort the directory size, we cannot use the output of the human-readable size. Otherwise, the directory size contains the words K and M, which may lead to incorrect sorting.
5. In man's case
static links:
Static Connection Library is to directly link the function code used in the (LIB) file to the target program. Other library files are no longer needed when the program is running; dynamic Link is to link the file module (DLL) where the called function is located and the location of the called function in the file to the target program. When the program is running, find the corresponding function code from the DLL, therefore, support for the corresponding DLL files is required.
Sta
People who want to seriously study UNIX environment advanced programming may want to knock the example in the book and run a look at the effect. But for the novice, there may be some difficulty, because the example used in the header file and some functions do not know where, the compilation may also be problematic. This article here is an example of how to run t
main inside the parameters, a lot of people are confused, the parameters in this is what things! ARGC and argv are a very strange thing for children who are accustomed to Windows. ARGC stores the number of command-line arguments, and the command-line arguments are stored in the argv array. Give me a chestnut and look at the code below.1#include 2 intMainintargcChar*argv[])3 {4 intn =argc, I;5printf"%d\n", n);6 for(i =0; I )7 {8printf"%s\n", Argv[i]);9 }Ten
source code is in appendix B. Therefore, one method is
/Root/apue.2e/include/apue. h directly copy to/usr/include.
The err_sys function is also in appendix B. The same method is to create a new one in/usr/include.My_err.h file, put Figure B .3. error functions that output to StandardThe error content is copied in. In this way, you only need to add: # include"My_err.h ..
Location: http://www.linuxdiyf.com/bbs/thread-90655-1-8.htmlApue2)
Source code
CompileError Handling Method
I believe that man
UNIX advanced environment programming (12) Process Relationships-terminal logon Process, Process group, Session, unixrelationships
In the previous chapter, we learned that processes are associated with each other:
Each process has a parent process;
When a child process exits, the parent process can perceive and obtain the exit status of the child process.
In
operation returns, the file offset increases the number of bytes actually read. The actual number of bytes read may be smaller than that of nbytes.
3.6 write function
# Include
For normal files, the write operation starts from the current offset of the file. If o_append is specified when the file is opened, the file offset is set to the end of the file, the file offset will increase the number of written bytes.
/* Copy the standard input to the standard output */# Include
[emailprotected]:/p
Apue. h is a file written by the author. It contains common header files and is not provided by the system. This includes common header files and definitions of error handling functions. It is really convenient to use.
The content of apue. h is as follows:
#ifndef _APUE_H #define _APUE_H #define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */ #include
To use it, perform the following operations to complete the configuration.
UNIX advanced environment programming (7) standard I/O function library and I/O function library
1 Binary IO (Binary IO)
In the previous article, we learned about character-by-character read/write and row-by-row read/write functions.
If we want to read and write binary files and want to read and write the entire file, although these two functions can be implement
UNIX advanced environment programming (15) process and memory allocation
Angular building is a place that many Photography enthusiasts often visit. It is calm and peaceful in the sunset.
First, let's take a look at the basic concepts of processes, including the layout and content of processes in the memory.In addition, you also need to know how the runtime all
Advanced Programming in Unix environment-"apue. h" configuration
The book is not much said. It is called the Bible for C Programming in Unix. However, it seems that some people in China like to recommend books to others now. I doubt if some people have read every book recommended. I am not recommended for the moment, b
The book "Advanced Programming in UNIX environments" comes with many small and exquisiteProgramWhen I read this bookCodeI have rewritten it according to my own understanding (most of it is on the copybook) and deepened my understanding (it is too difficult to read a book, haha ). This example is successfully tested on ubuntu10.04.
Program Introduction: in UNIX
For many new users who are learning advanced programming in the Unix environment (apue), the first problem may be the source code compilation in this book.. Almost every routine in this book will have such a line of source code:# Include "ourhdr. H"Changed:# Include "apue. H"
This header fileYesThe author puts the standard header files commonly used in each routi
:48:apache:/var/www:/sbin/nologinHsqldb:x:96:96::/var/lib/hsqldb:/sbin/nologinSshd:x:74:74:privilege-separated Ssh:/var/empty/sshd:/sbin/nologinRpcuser:x:29:29:rpc Service User:/var/lib/nfs:/sbin/nologinNfsnobody:x:65534:65534:anonymous NFS User:/var/lib/nfs:/sbin/nologinXfs:x:43:43:x Font Server:/etc/x11/fs:/sbin/nologinHaldaemon:x:68:68:hal Daemon:/:/sbin/nologinAvahi-autoipd:x:100:101:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologinGdm:x:42:42::/var/gdm:/sbin/nologinUglychen:x:500:501:uglyc
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.