Unix/Linux socket collation -- address structure

preface Students who have read UNIX network programming know that this book introduces all aspects of sockets in detail, and gives each structure Implementation code file of system API. However, with the continuous development of technology, the kernel of the operating system is constantly updated. The book describes the relevant address struc ...

Posted by lilywong on Fri, 18 Feb 2022 21:23:57 +0100

Android NDK -- a summary of fork vs vfork in Linux application creation process

introduction Unix series processes are subprocesses obtained by copying init process or kernel process. The specific details of different implementations are different. Linux provides three kinds of fork, vfork and clone system calls. 1, Unix process overview In Unix, the CPU allocates and schedules resources with the process as the allo ...

Posted by lbaxterl on Sun, 13 Feb 2022 17:24:50 +0100

Summary of Unix network programming -- simple server implementation

1. Preface To realize a simple server, it needs several steps to establish a connection with the client and receive the data from the client for processing. The figure above shows the basic socket functions needed to implement the TCP client / server program. This article focuses on the implementation of server-side. 2.sokcet() First, call ...

Posted by tejama on Sun, 13 Feb 2022 15:13:19 +0100

Chapter 6 text processing tool for Shell programming (awk)

1, awk introduction 1. awk overview awk is a programming language, which is mainly used to process text and data under linux/unix. It is a tool under linux/unix. The data can come from standard input, one or more files, or the output of other commands. awk's way of processing text and data: scan the file line by line. By default, from the f ...

Posted by mightymaster on Sun, 13 Feb 2022 05:08:08 +0100

Getting started with Linux system programming -- threads

1, Thread 1. Thread overview (differences from processes and advantages of threads) Multithreading development has been supported by mature pthread library on Linux platform. The most basic concepts of multithreading development include three points: thread, mutex and condition. Among them, thread operation is divided into thread creation ...

Posted by gooman on Sat, 12 Feb 2022 11:40:50 +0100

Implementation and analysis of Unix code example 1

#####1, Brief implementation of ls(1) command. #include<apue.h> #include<dirent.h> int main(int argc,char *argv[]) { DIR *dp; struct dirent *dirp; if(argc!=2) err_quit("usage:ls directory_name"); if((dp=opendir(argv[1]))==NULL) err_sys("can't open %s",argv[1]); while((dirp=readdir(dp))!=NULL) p ...

Posted by sONOCOOLO on Tue, 08 Feb 2022 09:57:42 +0100

Linux delve 14- file manipulation

-----Latest update [2022-01-23]----- Preview of this article's directory structure: 1, Introduction 2, File operation 1. Create file: touch 2. Copying files: cp 3. Move or rename files: mv 4. Delete file: rm 3, File permissions 1. Permission Description: read, write and execute 2. Permission Description: belongs to master, user group and other ...

Posted by Eugene on Wed, 26 Jan 2022 19:14:28 +0100

Exploring the 04 bash shell in Linux

-----Latest update [December 30, 2021]----- Preview of this article's directory structure: 1, Introduction 2, shell variable 1. View variables 2. Variable type 3. Variable operation 4. Common global variables in the system 3, shell options 1. View shell options 2. Set shell options 4, Metacharacter 1. Metacharacter list 2. Citation and escape ...

Posted by AlanG on Tue, 25 Jan 2022 18:27:36 +0100

Linux explores 01-stty and keyboard signals

-----Last updated [December 20, 2021]----- 1, Introduction The original Unix setup assumed that people used terminals to connect to host computers. More than 30 years later, this is still the case, even running Unix on your own PC. Over the years, terminals have developed into many different types and provided many different types of keyboards, ...

Posted by tomz0r on Tue, 25 Jan 2022 08:35:54 +0100

APUE Chapter XI notes

Chapter 11 thread 11.3 thread identification Each thread has a thread ID. The thread ID is meaningful only in the context of the process to which it belongs.When implemented, you can use - a structure to represent pthread_ Tdata type.A function that compares two thread ID s #include <pthread.h> int pthread_equal(pthread_t tidl, pthread ...

Posted by globetrottingmike on Wed, 19 Jan 2022 19:36:27 +0100