![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
zhh157
这个作者很懒,什么都没留下…
展开
-
【send/sendto/sendmsg系统调用】
功能描述:发送消息。send只可用于基于连接的套接字,send 和 write唯一的不同点是标志的存在,当标志为0时,send等同于write。sendto 和 sendmsg既可用于无连接的套接字,也可用于基于连接的套接字。除了套接字设置为非阻塞模式,调用将会阻塞直到数据被发送完。用法: #include #include ssize_t send(int sock, cons转载 2008-11-11 09:03:00 · 1730 阅读 · 0 评论 -
gethostbyname的用法
使用这个东西,首先要包含2个头文件:#include #include struct hostent *gethostbyname(const char *name);这个函数的传入值是域名或者主机名,例如"www.google.com","wpc"等等。传出值,是一个hostent的结构(如下)。如果函数调用失败,将返回NULL。struct hostent { char *h_name转载 2008-11-11 10:27:00 · 1073 阅读 · 0 评论 -
linux下多线程程序的链接选项问题
在利用automake自动生成makefile文件的过程中如果我们需要链接linux的多线程库那么需要在makefile.am中添加链接选项LIBS+=lpthread 如果需要链接boost::thread库则需要添加LIBS+=lboost_thread 否则,会出现undefined reference to 的链接错误原创 2008-11-17 13:16:00 · 788 阅读 · 0 评论 -
关于Linux下时间编程的问题
1. Linux下与时间有关的结构体 struct timeval { int tv_sec; int tv_usec; }; 其中tv_sec是由凌晨开始算起的秒数,tv_usec则是微秒(10E-6 second)。 struct timezone { int tv_minuteswest; int tv_dsttime; };转载 2008-11-17 13:15:00 · 553 阅读 · 0 评论 -
如何用Shell脚本修改crontab
<br />crontab -l > /tmp/crontab.bak<br />echo 'something new...' >> /tmp/crontab.bak<br />crontab /tmp/crontab.bak原创 2010-09-09 16:21:00 · 12692 阅读 · 1 评论