免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1811 | 回复: 7
打印 上一主题 下一主题

如何从系统自带的命令找到对应的函数? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-22 15:16 |只看该作者 |倒序浏览
5可用积分
如何从系统自带的命令找到对应的函数?
比如说 shutdown ls 等?
有没有相应的函数包?

最佳答案

查看完整内容

抢分,嘎嘎 ltrace可以看到调用了那些libc库,coreutils-x.x.tar.bz2中包含这些命令的源码。

论坛徽章:
0
2 [报告]
发表于 2009-06-22 15:16 |只看该作者
抢分,嘎嘎
ltrace可以看到调用了那些libc库,coreutils-x.x.tar.bz2中包含这些命令的源码。

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
3 [报告]
发表于 2009-06-22 15:26 |只看该作者
原帖由 liying_gg 于 2009-6-22 15:22 发表
抢分,嘎嘎
ltrace可以看到调用了那些libc库,coreutils-x.x.tar.bz2中包含这些命令的源码。

正解

论坛徽章:
0
4 [报告]
发表于 2009-06-22 15:29 |只看该作者
原帖由 liying_gg 于 2009-6-22 15:22 发表
抢分,嘎嘎
ltrace可以看到调用了那些libc库,coreutils-x.x.tar.bz2中包含这些命令的源码。

ltrace出来的的东西太多了
所有的命令都在里面吗?
coreutils binutils这些包分别代表的是那些命令?

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
5 [报告]
发表于 2009-06-22 15:31 |只看该作者
Contents of Coreutils
Installed programs:
base64, basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, head, hostid, hostname, id, install, join, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mktemp, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shred, shuf, sleep, sort, split, stat, stty, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, and yes

摘自LFS

论坛徽章:
0
6 [报告]
发表于 2009-06-22 15:34 |只看该作者

回复 #4 cuer_2 的帖子

ltrace出来的东西你用vi看好看些,不是所有命令都在coreutils里,不过最基本,最常用的差不多都有,
至少你说的ls在里面,shutdown好像不在。
The GNU Binutils are a collection of binary tools. 主要是和二进制文件相关的。
    *  ld - the GNU linker.
    * as - the GNU assembler.
    *  addr2line - Converts addresses into filenames and line numbers.
    * ar - A utility for creating, modifying and extracting from archives.
    * c++filt - Filter to demangle encoded C++ symbols.
    * dlltool - Creates files for building and using DLLs.
    * gold - A new, faster, ELF only linker, still in beta test.
    * gprof - Displays profiling information.
    * nlmconv - Converts object code into an NLM.
    * nm - Lists symbols from object files.
    * objcopy - Copys and translates object files.
    * objdump - Displays information from object files.
    * ranlib - Generates an index to the contents of an archive.
    * readelf - Displays information from any ELF format object file.
    * size - Lists the section sizes of an object or archive file.
    * strings - Lists printable strings from files.
    * strip - Discards symbols.
    * windmc - A Windows compatible message compiler.
    * windres - A compiler for Windows resource files.

[ 本帖最后由 liying_gg 于 2009-6-22 15:37 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2009-06-22 16:08 |只看该作者
好的 谢谢!

论坛徽章:
0
8 [报告]
发表于 2009-06-22 22:19 |只看该作者
ltrace还真没用过,原来可以这样使用,呵呵。学到了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP