上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 82 下一页
摘要: getnameinfo - address-to-name translation in protocol-independent manner #include <sys/socket.h> #include <netdb.h> int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int f... 阅读全文
posted @ 2012-10-18 21:37 greencolor 阅读(215) 评论(0) 推荐(0) 编辑
摘要: #include <netdb.h>#include <sys/socket.h>int main(int argc, char **argv){char *ptr,**pptr;struct hostent *hptr;char str[32];char ipaddr[16];struct in_addr *hipaddr;/* 取得命令后第一个参数,即要解析的IP地址 */ptr = argv[1];/* 调用inet_aton(),ptr就是以字符串存放的地方的指针,hipaddr是in_addr形式的地址 */if(!inet_aton(ptr,hipaddr) 阅读全文
posted @ 2012-10-18 17:20 greencolor 阅读(339) 评论(0) 推荐(0) 编辑
摘要: getpeername - get name of connected peer socket Synopsis #include <sys/socket.h> int getpeername(int s, struct sockaddr *name, socklen_t *namelen); Description getpeername() returns the name of the peer connected to socket s. The namelen parameter should be initialized to indicate the amount o 阅读全文
posted @ 2012-10-18 17:12 greencolor 阅读(278) 评论(0) 推荐(0) 编辑
摘要: void reader_function ( void );void writer_function ( void ); char buffer;int buffer_has_item=0;pthread_mutex_t mutex;struct timespec delay;void main ( void ){ pthread_t reader; /* 定义延迟时间*/ delay.tv_sec = 2; delay.tv_nec = 0; /* 用默认属性初始化一个互斥锁对象*/ pthread_mutex_init (&mutex,NULL); pthread_create(& 阅读全文
posted @ 2012-10-18 16:03 greencolor 阅读(388) 评论(0) 推荐(0) 编辑
摘要: assert宏的原型定义在assert.h中,其作用是如果它的条件返回错误,则终止程序执行.原型定义: #include "assert.h"void assert (int expression);assert的作用是现计算表达式 expression ,如果其值为假(即为0),那么它先向stderr打印一条出错信息,然后通过调用 abort 来终止程序运行。 阅读全文
posted @ 2012-10-18 15:34 greencolor 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Mutex:Is a key to a toilet. One person can have the key - occupy the toilet - at the time. When finished, the person gives (frees) the key to the next person in the queue.Semaphore:Is the number of free identical toilet keys. Example, say we have four toilets with identical locks and keys. The semap 阅读全文
posted @ 2012-10-17 20:40 greencolor 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 一 制作启动U盘1. 找一个U盘,将其格式化,整个过程中U盘插在USB接口上。2. 解压系统安装镜像文件3. 打开UltraISO 软件,在打开 ISO 文件中找到 boot.iso(images文件夹下),确认打开。4. 选择启动 菜单栏下 写入硬盘映像 功能,弹出 写入硬盘映像 对话框,写入方式 选择 USB-HDD+ ,单击 写入按钮。5. 弹出提示框,提示驱动器数据将丢失,是否继续,选择是 。6. 待写入硬盘映像对话框中消息栏 提示 刻录成功 时启动U 盘制作成功。7. 将系统安装镜像文件装入启动u盘。二 U盘引导安装1. 设置系统 U盘启动刚启动系统时更具提示按 F2 进入系统参数设 阅读全文
posted @ 2012-10-16 13:03 greencolor 阅读(299) 评论(0) 推荐(0) 编辑
摘要: upvar makes the variable by that name in the procedure frame given by level (or at global level, if level is #0)upvar #0 $httpObjName httpObj==============global httpObjset httpObj $httpObjName 阅读全文
posted @ 2012-10-15 23:22 greencolor 阅读(175) 评论(0) 推荐(0) 编辑
摘要: foreach request $Requests($object) { foreach {target attribute callback alias} $request {break} $target $attribute $callback $alias now obtain every four-value in the array Requests($Object) } 阅读全文
posted @ 2012-10-03 13:22 greencolor 阅读(103) 评论(0) 推荐(0) 编辑
摘要: body DeviceObjectname::getObject {} { if {$m_theObject == {}} { #instantiate the singleton object set m_theObject [[namespace current] ::#auto] } return $m_theObject}singleton class cannot be directly instantiated. Use DeviceObjectname::getObject 阅读全文
posted @ 2012-10-02 14:38 greencolor 阅读(153) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 82 下一页