当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: perl函数的参考手册,留着查阅方便。
 

 

 ·iptables howto(中文版)    »显示摘要«
    摘要:iptables -adc 指定链的规则 [-a 添加 -d 删除 -c 修改] ; -d chain rule num[option] ; -lfz 链名 [选项] ; -[nx] 指定链 ;-p chain target[options];-e old-chain-name new-chain-name iptables - ip包过滤器管理name iptables - ip包过滤器管理 总......
 ·linux filesystem hierarchy    »显示摘要«
    摘要:一直想深入的了解一些/proc目录下面的文件信息,google到了这里,暂时记录,等周二回来再看吧:)http://www.linuxforum.com/linux-filesystem/index.html好东西,老外写的东西真不错http://www.linuxforum.com/linux_tutorials/89/1.php......


perl附录(1)
上一页   ...

函数名 syscall 调用语法 syscall (list); 解说 调用系统函数,list第一个元素是系统调用名,其余为参数.

如果参数是数字,就转化成c的整型数(type int).否则传递字符串的指针.详见unix的帮助或perl文档. 【程序编程相关:关于Linux可执行文件的格式问题

【推荐阅读:Linux 170个常见问题的详细解答

使用syscall必须包含文件syscall.pl,即: 【扩展信息:安装CVS

require ("syscall.ph"); 例子

结果输出

2.进程终止函数

函数名 die 调用语法 die (message); 解说 终止程序并向stderr输出错误信息.message可以为字符串或列表.如果最后一个参数不包含换行符,则程序文件名与行号也被输出. 例子 die ("cannot open input file"); 结果输出 cannot open input file at myprog line 6.

函数名 warn 调用语法 warn (message); 解说 与die类似,区别是不终止程序. 例子 warn("danger! danger!\n"); 结果输出 danger! danger!

函数名 exit 调用语法 exit (retcode); 解说 终止程序并指定返回值. 例子 exit(2); 结果输出 无

函数名 kill 调用语法 kill (signal, proclist); 解说 给一组进程发送信号.

signal是发送的数字信号,9为杀掉进程.

proclist是进程id列表.详见kill的unix帮助. 例子

结果输出

3.进程控制函数

函数名 sleep 调用语法 sleep (time); 解说 将程序暂停一段时间.time是停止的秒数.返回值为实际停止的秒数. 例子 sleep (5); 结果输出 无

函数名 wait 调用语法 procid = wait(); 解说 暂停程序执行,等待子进程终止.

不需要参数,返回值为子进程id,如果没有子进程,返回-1. 例子

结果输出

函数名 waitpid 调用语法 waitpid (procid, waitflag); 解说 暂停程序执行,等待特定的子进程终止.procid为等待的进程id 例子 $procid = fork();

if ($procid == 0) {

# this is the child process

print ("this line is printed first\n");

exit(0);

} else {

# this is the parent process

waitpid ($procid, 0);

print ("this line is printed last\n");

} 结果输出 $ program

this line is printed first

this line is printed last

$

4.其它控制函数


...   下一页
 ·redirect http to https    »显示摘要«
    摘要:tuesday, june 14 2005 @ 03:39 pm cdtcontributed by: semioticaviews: 1567 a quick overview of doing redirects from non-ssl to ssl websites. ed. note: while you should be able to do th......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE