what is linux apr

藏色散人
藏色散人Original
2023-04-06 11:29:551360browse

linux apr refers to the Apache portable runtime library, and its full English name is "Apache portable Run-time libraries"; it mainly provides upper-layer applications with a bottom-level support interface library that can be used across multiple operating system platforms. .

what is linux apr

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What is linux apr?

apache apr introduction

The purpose of APR (Apache portable Run-time libraries, Apache portable run-time libraries) is as its name suggests, mainly for The upper-layer application provides a low-level support interface library that can be used across multiple operating system platforms. In early versions of Apache, the application itself had to be able to handle the details of various operating system platforms and call different processing functions for different platforms.

With the further development of Apache, the Apache organization decided to separate these common functions and develop them into a new project. In this way, the development of APR is independent from Apache, and Apache only uses APR. At present, APR is mainly used by Apache. However, due to the better portability of APR, some C programs that need to be transplanted have also begun to use APR. Open source projects such as Flood loader (http://httpd.apache.org/test/flood /, this project is used for server stress testing, not only applicable to Apache), FreeSwitch (www.freeswitch.org), JXTA-C (http://jxta-c.jxta.org, C version of JXTA point-to-point platform implementation) ; Commercial projects include Blogline (http://www.bloglines.com/), covalent (http://www.covalent.net), etc.

APR moves the processing of platform details down. For applications, they do not need to consider the specific platform at all. Whether it is Unix, Linux or Window, the interface executed by the application is basically unified. Therefore, for APR, portability and unified upper-layer interface is a key point of its consideration. The earliest purpose of APR was not this. It initially just hoped to merge all the code used in Apache into a common code base. However, this was not a correct strategy, so APR later changed its Goal. Sometimes using common code is not a good thing. For example, how to map a request to a thread or process is platform dependent, so just a common code base cannot complete this distinction. The goal of APR is to hope for security Merge all code that can be merged without sacrificing performance.

One of the earliest goals of APR is to provide a common unified operation function interface for all platforms (not just some), which is a very remarkable purpose , is of course an unrealistic goal. It is impossible for us to support all features of all platforms, so APR can currently only provide support for all APR features for most platforms, including Win32, OS/2, BeOS, Darwin, Linux, etc. In order to achieve this goal, APR developers must create a series of feature macros (FEATURE MACROS) for features that cannot run on all platforms to distinguish these features between platforms. These feature macro definitions are very simple, usually using APR_HAS_FEATURE Parameter setting:

If a certain platform has this feature, this macro must be set to true. For example, both Linux and window have memory mapped files, and APR provides an operation interface for memory mapped files, so in these two On each platform, the APR_HAS_MMAP macro must be set, and the ap_mmap_* functions should map the disk file into memory and return the appropriate status code. If your operating system does not support memory mapping, then APR_HAS_MMAP must be set to 0, and all ap_mmap_* Functions do not need to be defined. The second step is to warn those who use unsupported functions in the program.

The basic types currently supported in APR include the following:

Table 3-1 Basic types supported in APR

##/apr/atomicAtomic operationsdso/apr/dsoDynamic loading of shared librariesfile io/apr/file_ioFile IO processingmmap/apr/mmapMemory mapped filelocks/apr/locksProcesses and threads are mutually exclusive Lockmemory/apr/memoryMemory pool Operationnetwork_io/apr/network_ioNetworkIO Processpoll/apr/polltableprocess##/apr/passwdTerminal password processingmisc/apr/miscA hodgepodge that doesn’t belong among the rest Any apr type of the class can be placed insideshmem/apr/shmemShared memoryrandom##                                                                                                    iconvapr contains some common development components, including mmap, DSO, etc.apr-util This directory also contains some commonly used development components. These components are more closely related to apache than those in the apr directory. Such as storage segments and storage segment groups, encryption, etc.

Type name

Folder name

Description

##atomic

##Poll IO

/apr/tables

Apache array (stack) and table and hash table

##/apr/threadproc

Process and thread operations

user

/apr/user

User and user group operations

time

##/apr/time

Time operation

string

/apr/strings

String operations

password

##/apr/random

Random number generation library

The files in the apr-iconv package are mainly used to implement iconv encoding. Most of the current transcoding processes are related to native encodings. You must be able to set the local encoding correctly before converting. Therefore, if two non-local codes A and B need to be converted, the conversion process is roughly A->Local and Local->B or B->Local and Local->A.
The latest download address of the above three packages is:
http://labs.mop.com/apache-mirror//apr/apr-1.4.6.tar.gz
http://labs.mop.com/apache-mirror//apr/apr-util-1.4.1.tar.gz
http://labs.mop.com/apache-mirror//apr/apr-iconv-1.2.1.tar.gz

Related recommendations: "
Linux Video Tutorial
"

The above is the detailed content of what is linux apr. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:linux selinux what isNext article:linux selinux what is