Common Linux system invocation commands

Source: Internet
Author: User

Some of the following functions in common Linux System Call commands are outdated and replaced by new and better functions (gcc will issue a warning when linking these functions ), however, they are retained for compatibility reasons. These functions will be marked with the "*" sign in front to show the difference. 1. Process Control fork create a new process clone create a sub-process execve run Executable File exit stop process according to the specified conditions _ exit immediately stop the current process getdtablesize process can open the maximum number of files getpgid get specify process group identification number setpgid set specify process group identification number getpgrp get current process group identification number setpgrp set current process group identification number getpid get process identification number getppid get parent process identification number getpriority get Scheduling priority setpriority set Scheduling Priority modify_ldt local description table of Read and Write processes nanosleep enable the process to sleep at the specified time nice changes the priority of the time-sharing process pause suspension process, wait for the signal personality to set the process running domain prctl to perform specific operations on the process ptrace Process Tracking worker get the maximum static priority sched_get_priority_min get the lower limit sched_getparam get the scheduling parameter sched_getscheduler of the process get the scheduling the sched_rr_get_interval policy gets the time slice length of the real-time process scheduled by the RR algorithm sched_setparam sets the scheduling parameter sched_setsched.pdf of the process to set the scheduling policy and parameter sched_yield of the specified process to take the initiative, create a sub-process for the vfork at the end of the scheduling queue to run new programs, usually use wait to wait for the sub-process to terminate wait3 see waitwaitpid wait for the sub-process to terminate wait4 see waitpidcapget get process permission capset process permission getsid get meeting ID setsid set meeting ID 2 file read/write operation fcntl file control open file creat create new file close file description read file write File readv read data from file into buffer array writev will buffer Array write Data to file pread random read to file pwrite random write to file lseek move file pointer _ llseek move file pointer dup copy open file description word dup2 according to specified conditions copy file description flock file Add/unlock poll I/O multi-channel conversion truncate truncated file ftruncate see truncateumask set File Permission mask fsync write part of the file in memory back to disk 3. File System Operation access determine File accessibility chdir change current working directory fchdir see chdirchmod change file mode fchmod see chmodchown change file owner or user group fchown see chownlchown see chownchroot change root directory stat get File status information lstat see statfstat see statstatfs get File System Information fstatfs see statfsreaddir read directory item getdents read directory item mkdir create directory mknod create index node rmdir Delete directory rename file rename link create link symlink Create Symbolic link unlink delete the value of the readlink read symbolic link mount File System umount unload File System ustat fetch File System Information utime change file access modification time utimes see utimequotactl control disk quota IV. System Control ioctl I /O total control function _ sysctl read/write system parameter acct enable or disable process accounting getrlimit get system resource upper limit setrlimit set system resource upper limit getrusage get system resource usage uselib select the binary to use function library ioperm set port I/O permission iopl change process I/O permission level outb low-level port operation reboot restart swapon open swap file and device swapoff disable swap file and device bdflush control bdflush daemon sysfs obtains the system information using the file system type sysinfo supported by the core. adjtimex adjusts the system clock. alarm sets the process's alarm clock getitimer to obtain the timer value. setitimer sets the timer value. gettimeofday takes the time and the time zone settimeofday set system date and time get system time times get process run time uname get current UNIX system name, version and host information vhangup suspend current terminal nfsservctl to control NFS Daemon access vm86 simulate the 8086 mode. create_module creates a module item that can be loaded. delete_module deletes the module item that can be loaded. init_module initializes the module query_module and queries the module information. * get_kernel_syms obtains the core symbol, replaced by query_module 5. Memory Management brk changes data segment space allocation sbrk see brkmlock Memory Page lock munlock Memory Page unlock mlockall call process all memory page lock munlockall call process all memory page unlock mmap ing virtual Memory Page munmap removal Memory Page ing mremap re- virtual memory address msync write data in the ing memory back to disk mprotect set memory image protection getpagesize get page size sync write memory buffer data back to hard disk cacheflush specify buffer content written back to disk 6. Network Management getdomainname get domain name setdomainname set domain name gethostid get host ID sethostid set host ID gethostname get host name sethostname set host name 7. Socket control socketcall the socket system calls socket to establish socketbind to bind socket to port connect to remote host accept to respond to socket connection request send message sendto send UDP message sendmsg see sendrecv receive information recvfrom receive UDP message recvmsg see recvlisten listening socket port select for Multi-Channel Synchronous I/O polling shutdown close socket connection getsockname get local socket name getpeername get communication peer socket name getsockopt get port set setsockopt set port parameter sendfile transfers data between files or ports socketpair to create a pair of connected anonymous sockets 8. User Management getuid get user ID setuid Set User ID getgid get group ID setgid set group flag ID getegid get valid group ID setegid set valid group ID geteuid get valid user ID seteuid set valid user ID setregid set true and valid group ID setreuid set true and valid respectively getresgid, the valid and saved group ID setresgid are set to true, and the valid and saved group ID getresuid are obtained respectively, set valid and saved user ID setresuid to true, valid and saved user ID: setfsgid set the group ID used for file system check setfsuid set the user ID used for file system check getgroups get after population group flag list setgroups set after population group flag List 9. inter-process communication ipc inter-process communication control call 9.1 signal sigaction set the processing method for the specified signal sigprocmask according to the parameters to implement blocking/unblocking operations on the signal set in the Signal Set sigpending sets the queue sigsuspend for the specified blocked signal to suspend the process and wait for the specific signal. For details, refer to signalkill to send signals to the process or process group * sigblock to add signals to the blocked signal mask, sigprocmask has replaced * siggetmask to obtain the existing blocking signal mask, and sigprocmask has replaced * sigsetmask with the given signal mask to replace the existing blocking signal mask, sigprocmask has replaced * sigmask to convert the given signal into a mask, and sigprocmask has replaced * sigpause as sigsuspend. sigsuspend has replaced sigvec as a signal processing function compatible with BSD, function for Signal Processing similar to sigactionssetmask ansi c, similar to sigaction 9.2 message msgctl message control operation msgget get message queue msgsnd send message msgrcv get message 9.3 pipeline pipe create pipeline 9.4 semaphore semctl semaphore control semget get a set of semaphores semop semaphore operation 9.5 shared memory shmctl control shared memory shmget get shared memory shmat connection shared memory shmdt remove shared memory

Related Article

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.