- 论坛徽章:
- 0
|
- $ltrace tail -2 a.sh
- __libc_start_main(0x804b1b0, 3, 0xbfe8a534, 0x804f000, 0x804eff0 <unfinished ...>
- setlocale(6, "") = "zh_CN.UTF-8"
- bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale"
- textdomain("coreutils") = "coreutils"
- __cxa_atexit(0x804c840, 0, 0, 0x8052618, 0xbfe8a498) = 0
- getenv("_POSIX2_VERSION") = NULL
- __ctype_b_loc() = 0xb7eee690
- __errno_location() = 0xb7eee68c
- __strtoull_internal(0xbfe8b83f, 0xbfe8a364, 10, 0, 0x804f311) = 2
- getopt_long(2, 0xbfe8a538, "c:n:fFqs:v", 0x8052420, NULL) = -1
- malloc(68) = 0x9b4d8a8
- open64("a.sh", 0, 00) = 3
- __fxstat64(3, 3, 0xbfe88304) = 0
- lseek64(3, 0, 0, 1, 0) = 0
- lseek64(3, 0, 0, 2, 0) = 742
- lseek64(3, 0, 0, 0, 0x9b4d8ec) = 0
- read(3, "#!/bin/bash\n#seq 1 100|while rea"..., 742) = 742
- memrchr(0xbfe88364, 10, 742, 2, 0) = 0xbfe88649
- memrchr(0xbfe88364, 10, 741, 2, 0) = 0xbfe88648
- memrchr(0xbfe88364, 10, 740, 2, 0) = 0xbfe8863f
- fwrite_unlocked("sleep 60\n\n", 1, 10, 0x466384c0sleep 60
- ) = 10
- read(3, "", 0) = 0
- close(3) = 0
- exit(0 <unfinished ...>
- __fpending(0x466384c0, 0x46639120, 0xbfe8a53c, 0xbfe8a358, 0x46566d2e) = 0
- fclose(0x466384c0) = 0
- +++ exited (status 0) +++
复制代码
大家请注意memrchr函数,此函数原型为
- #include <string.h>
- void *memchr(const void *s, int c, size_t n);
- void *memrchr(const void *s, int c, size_t n);
复制代码
那么
- memrchr(0xbfe88364, 10, 740, 2, 0)
复制代码
最后后两个参数从何而来?又是什么用途呢? |
|