Linux system functions

Source: Internet
Author: User

Linux system functions

1.1 function Query
In Linux man page, system functions are stored in the second section. For functions of the standard function library, they are stored in the third section;
Run the following command to query:
# Man-S 3 sysinfo
No manual entry for sysinfo
# Man-S 2 sysinfo
Information about sysinfo
1.2 restrictions on the use of system functions
Because the Linux operating system has a strict security mechanismProgramWhen using the system to call functions, there may be many restrictions.

2. Obtain and set system information

2.1 obtain the name, version, URL, and computer type of the operating system.
When writing a program, a good program designer may make different considerations based on the executed hardware and operating system. you can use the uname () function to obtain the operating system name, version, URL (including host name), and computer type (such as intel6x86 compatible machine lines) of the current host.
2.2 obtain and set the website
Gethostname ();
Sethostname ();
2.3 obtain the system running status
Sysinfo ();
2.4 obtain the file system status
Statfs ();

3. file and directory management

3.1 obtain the File status
Stat ();
Lstat ();
3.2 change file permissions and owner
Chmod (); change File Permissions
Chown (); change the owner or group of the file
3.3 create file links and symbolic links
Link (); Create a symbolic link
Symlink (); Create a symbolic link
3.4 delete an object
Unlink ();
3.5 create and delete a directory
Mkdir ();
Rmdir ();
3.6 obtain and switch the working directory

Access
Chdir
Fchdir
Fchmod
Fchown
Lchown
Chroot
Fstatfs
Readdir
Getdents
Rename
Readlink
Mount
Umount
Ustat
Utime
Utimes
Quotactl

 

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.