Compiling the kernel API into the man manual

Source: Internet
Author: User
Generally we all know the use of the Man manual to view the LIBC Library API usage, such as man strcpy, man stat ... In fact, some of the APIs in the kernel can also be compiled into the man manual, which is certainly a good material for learning the kernel.
----------------------------------------------------------------------------------
1, compile the kernel API to the man manual. Download a kernel version, and then execute the following command in the top-level directory: Make Installmandocs to execute this command, others will prompt you lack of a dependent xmlto, then install dependencies, Ubuntu below: sudo apt-get install Xmlto to rely on Ann Put it up and execute the last command again. Make Installmandocs.
----------------------------------------------------------------------------------
2, when the above command is finished, some kernel API information will be installed under/USR/LOCAL/MAN/MAN9. The directory has access to the kernel API. What functions can be found in the kernel, you can go to that directory to see.
----------------------------------------------------------------------------------
3, Example: (Man Copy_to_user)

Copy_to_user (9) Memory Management in Linux copy_to_user (9)



NAME
Copy_to_user-copy a blocks of data into user spaces.

Synopsis
unsigned long copy_to_user (void __user * to, const void * from, unsigned long n);

ARGUMENTS
To
Destination address, in user spaces.

From
Source address, in kernel space.

N
Number of bytes to copy.

Context
User context only. This function could sleep.

DESCRIPTION
Copy data from kernel spaces to user spaces.

Returns number of bytes that could is not copied. On success, this is zero.

COPYRIGHT
Kernel Hackers Manual 2.6. August Copy_to_user (9)------------------------------------------------------------------------------------- --
4, personal feeling.
Disadvantages: 1, the display of API information is relatively "crude", not as detailed as LIBC's explanation.
2, some of the kernel API is not found, but also need to check the source code.
Advantages: 1, very authoritative. I think these things are probably the explanations that the authors of these functions have written.
2, compared to looking at the source, this is still convenient point.
----------------------------------------------------------------------------------------

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.