我正在试验PERF_EVENTS,这是Linux内核提供的性能事件接口。我通过perf_event_open系统调用成功地获取了参数(cpu cycles,...)。 long
perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
int cpu, int group_fd, unsigned long flag
考虑下面的C码(x86_64的) #include <unistd.h>
int main()
{
execve("/bin/ls", 0, 0);
}
予编译为gcc a.c和执行;我得到了SIGABRT错误 A NULL argv[0] was passed through an exec system call.
Aborted
下一页上gdb下运行,起初我也得到了
我特别寻找C11标准(ISO/IEC 9899:2011)或POSIX页面中的单词。我检查了POSIX manual for fwrite,但它没有提及未定义的行为。然而,manual for fclose不说, ,来电后FCLOSE(),不确定的行为的任何使用流导致的。 但我仍然看不到NULL流是否会导致UB。