Home > Article > Operation and Maintenance > what is linux apr
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. .
#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
Type name |
Folder name |
Description |
##atomic | ##/apr/atomicAtomic operations | |
/apr/dso | Dynamic loading of shared libraries | |
/apr/file_io | File IO processing | |
/apr/mmap | Memory mapped file | |
/apr/locks | Processes and threads are mutually exclusive Lock | |
/apr/memory | Memory pool Operation | |
/apr/network_io | NetworkIO Process | |
/apr/poll | ##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/passwdTerminal password processing | |
/apr/misc | A hodgepodge that doesn’t belong among the rest Any apr type of the class can be placed inside | |
/apr/shmem | Shared memory | |
##/apr/random | Random number generation library | ## iconv |
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
The above is the detailed content of what is linux apr. For more information, please follow other related articles on the PHP Chinese website!