简体   繁体   中英

About the relation between linux shell's functions and C's functions()

For example, I thought the ln command in the shell is implemented by link() and symlink() provided by C,so I checked the src of the ln, but it seems it doesn't utilize them.

Yes, many Linux commands are written in C; and many of those C programs might use C library functions like link() or symlink() . Various Linux shells (eg sh, csh and bash) are themselves written in C, and also use C library calls.

HOWEVER...

link() and symlink() are both POSIX-compliant wrapper functions, they're not part of the "Standard C Library". Consequently, The "ln" command doesn't use them. See unistd.h for more details.

See also What is included in the C standard library .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM