Syscall calls the interface from 2.6.19 to the application layer.

Source: Internet
Author: User

From: http://crquan.blogbus.com/logs/5618102.html


Syscall calls the interface from 2.6.19 to the application layer. The original kernel uses the _ syscalln macro to declare the function prototype method is no longer valid:

As declared:

_syscall1(int, sysinfo, struct sysinfo *, info);

It is called directly when the program needs it:

int syscall(int number, ...);
  • The first number is the number of parameters to be followed, not the number of parameters called by the system. (Note: The man manual describes the number as syscall () performs the system call whose assembly language interface has the specified number with the specified arguments. symbolic constants for System
    Callcan be found in the header file <sys/syscall. h>.
    )
  • The number is followed by all the parameters called by the system.

The corresponding header file is also changed

Therefore, when sysinfo is called, it becomes:

struct sysinfo s_info;
syscall(2, __NR_sysinfo, &s_info);

It can be seen that the new call method is more concise.

References:

  • Http://lxr.linux.no/source/include/asm-i386/unistd.h
  • Http://lxr.linux.no/source/include/asm-i386/unistd.h? V = 2.6.18
  • Http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.19-git13.log
  • Commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 of git: // git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

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.