这个默认是安装了的,如果没有安装可以
#yum install strace
查看httpd进程
#ps auxw | grep httpd
有多个,必须停止apache
[root@localhost usr]# /usr/local/webserver/apache2/bin/apachectl stop
启动单进程httpd [root@localhost usr]# /usr/local/webserver/apache2/bin/apachectl -X -k start
再使用#ps auxw | grep httpd查看只有单经常,记下进程id
将strace绑定至apache
#strace -p 28224
算法
快速排序php代码
long tv_sec; /*秒*/ long tv_usec; /*微秒*/ }; timezone 结构定义为: struct timezone{ int tz_minuteswest; /*和Greenwich 时间差了多少分钟*/ int tz_dsttime; /*日光节约时间的状态*/ };
#include #include main(){ struct timeval tv; struct timezone tz; gettimeofday (&tv , &tz); printf("tv_sec; %d\n", tv,.tv_sec) ; printf("tv_usec; %d\n",tv.tv_usec); printf("tz_minuteswest; %d\n", tz.tz_minuteswest); printf("tz_dsttime, %d\n",tz.tz_dsttime); }tv_sec: 974857339 tv_usec:136996 tz_minuteswest:-540 tz_dsttime:0=======================================================================
poll 函数
http://linux.about.com/library/cmd/blcmdl2_poll.htm
Linux / Unix Command: poll
NAME poll - wait for some event on a file descriptor SYNOPSIS #includeint poll(struct pollfd *ufds, unsigned int nfds, int timeout);
DESCRIPTION pollis a variation on the theme of select. It specifies an array of nfdsstructures of typestruct pollfd { int fd; /* file descriptor */ short events; /* requested events */ short revents; /* returned events */ };-------------------------write 将数据写入已打开的文件内
定义:ssize_t write (int fd,const void * buf,size_t count);表头文件:#include说明:write()会把参数buf所指的内存写入count个字节到参数fd所指的文件内。当然, 文件读写位置也会随之移动。------------------------------Linux / Unix Command: writev
http://linux.about.com/library/cmd/blcmdl2_writev.htm
NAME readv, writev - read or write a vector SYNOPSIS #includessize_t readv(int fd, const struct iovec *vector, int count); ssize_t writev(int fd, const struct iovec *vector, int count);
struct iovec { void *iov_base; /* Starting address */ size_t iov_len; /* Length in bytes */ };----------------------------使用man命令查getsockname
![]()
其他函数:
ACCEPT()和ACCEPT4()getuid 取得用户标识getcwd 获取当前目录rt_sigaction(2) 检查和改变信号动作,sigaction() 系统调用被用于更改一个进程在接收一个特定信号后的动作。setitimer 获取设置定时器的值poll(2) 在文件描述符上等待事件stat64 获取文件状态chdir 改变工作目录