- 博客(17)
- 收藏
- 关注
原创 socket
都是新建个socket然后客户端是connect +write+read服务端是bind+while (read +write)client:[code="c"]#include #include #include #include int main(){ char* echo_host="192.168.1.105"; int ...
2011-12-31 00:33:29
136
原创 转 Linux下pipe使用注意事项
转http://blog.yufeng.info/archives/1485[code="java"]Linux下pipe使用注意事项作者:Yu Feng原创文章,转载请注明: 转载自Erlang非业余研究本文链接地址: Linux下pipe使用注意事项Linux下的pipe使用非常广泛, shell本身就大量用pipe来粘合生产者和消费者的. 我们的服务器程序通常...
2011-11-22 00:30:03
325
原创 getpwnam
[code="c"]#include #include int main(){ struct passwd * pw; char *username = "apple"; pw = getpwnam(username); if (!pw) { printf("%s is not...
2011-11-21 23:01:09
214
原创 signal
信号,kill只是个传递信号的作用apue10fig10_2_signal.c造一个死循环,无限等待我们必须区分系统调用和函数。当捕捉到某个信号时,被中断的是 内核中执行的系统调用。[code="c"]#include #include #include static void sig_usr(int); /* one handler for both ...
2011-11-20 23:42:17
203
原创 od 以指定格式显示文件
http://www.ollydbg.de/version2.html参考http://baike.baidu.com/view/370622.htm#2odod 命令用途:以指定格式显示文件。语法 使用字符串类型显示文件,来格式化输出。 od [ -v ] [ -A AddressBase ] [ -N Count ] [ -j Skip ] [ -t TypeS...
2011-11-14 23:20:49
263
原创 字符串处理
expr index haohao aoexpr length hao,haoexpr substr hao,hao 2 3[root@red54apple shell]# expr match "hao123" '[0-9]' 0[root@red54apple shell]# expr match "123" '[0-9]*' 3[root@red5...
2011-11-08 15:01:08
108
原创 locate
mac下locate 文件名会报错sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist[code="linux"]apple:~ apple$ locate errno.hWARNING: The locate database (/var/db/locate.data...
2011-11-08 09:47:15
253
原创 lstat(传入路径参数,&一种struct)返回0或1
apue 04.pdfS _ I S L N K ( )S _ I S S O C K ( )符号连接( P O S I X . 1 或 S V R 4无此类型) 套接字( P O S I X . 1 或 S V R 4无此类型)为了跨平台,代码写成#ifdef这种[code="c"]#include "apue.h"intmain(int argc, char...
2011-11-08 00:15:57
294
原创 extern c
http://baike.baidu.com/view/2814224.htm(1) 被extern "C"限定的函数或变量是extern类型的 extern是C/C++语言中表明函数和全局变量作用范围(可见性)的关键字,该关键字告诉编译器,其声明的函数和变量可以在本模块或其它模块中使用。(2) 被extern "C"修饰的变量和函数是按照C语言方式编译和连接的...
2011-11-04 23:56:16
87
原创 vim set list 看特殊符号
转http://blog.163.com/mageng11@126/blog/static/14080837420110211753226/:set list:set nolist
2011-11-01 11:53:14
1156
原创 c++ string
string-----------[code="c++"]#include #include using std::string;int main(){ string aa="hao"; std::cout 0) { /* parent */ close(fd[0]); write(fd[1], "hello wo...
2011-10-31 14:08:12
130
原创 转 lsof
转http://wowubuntu.com/lsof.html[code="java"]Unix 调试的瑞士军刀:lsof23六 2011# 作者: 投稿/转载 / 本文采用CC BY-NC-SA 2.5协议授权,转载请注明本文链接。本文转载自黑客志 (这是一个多人协作的群体Blog,旨在为国内开发者提供新鲜和高质量的黑客文章,文章主要来源为 Hacker News。)...
2011-10-31 09:33:01
119
原创 windows route
转 http://wenku.baidu.com/view/2d80662c0066f5335a81215e.html
2011-10-28 19:04:40
104
原创 转载 linux安装中文语言包
转载http://312788172.iteye.com/blog/718083linux安装中文语言包 今天一开发组同事写了个程序,跑出来的东西有乱码,我了解了一下可能是语言包不全导致,给他用yum安装了相应的中文语言包问题就解决了,相关配置如下: yum install fonts-chinese.noarch yum install m17n-db-commo...
2011-10-28 17:27:45
393
原创 fork exec
[code="c"]#include #include #include #include int main(void){ pid_t result; result=fork(); if(result==-1){ // perrer("fork"); exit; }else if(result==0){ printf("result=%d,ppi...
2011-10-28 17:13:33
103
原创 有名管道 pipe fifo
两个终端运行,一个输入,一个输出[code="shell"]#!/bin/shif [ ! -p /root/mytest/testpipe ]then /bin/mknod /root/mytest/testpipe pfiwhile :do read msg if [ "$msg" = "" ] then ...
2011-10-25 16:11:29
90
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人