易截截图软件、单文件、免安装、纯绿色、仅160KB

linux fork()函数学习

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
    pid_t pid;
    static int n = 0;
    printf("fork!\n"); /*printf("fork!")*/
    switch (pid = fork())
    {
        case -1:
        {
            /* 这里pid为-1,fork函数失败 */
            /* 一些可能的原因是 */
            /* 进程数或虚拟内存用尽 */
            perror("The fork failed!");
            break;
        }
        case 0:
        {
            /* pid为0,子进程 */
            printf("[child]i am child!\n");
            printf("[child]getpid=[%d]\n", getpid() );
            printf("[child]pid=[%d]\n", pid );
            break;
        }
        default:
        {
            /* pid大于0,父进程 */
            printf("[parent]i am parent!\n" );
            printf("[parent]getpid=[%d]\n",getpid() );
            printf("[paren


相关文档:

实战Linux Bluetooth编程(三) HCI层编程

1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI)  就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......

实战Linux Bluetooth编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

在linux下安装配置svn独立服务器

在linux下安装配置svn独立服务器
 
subversion(以下简称svn)是近年来崛起的版本管理工具,是cvs的接班人。 svn服务器有2种运行方式:独立服务器和借助apache。2种方式各有利弊。
svn存储版本数据也有2种方式:BDB和FSFS。因为BDB方式在服务器中断时,有可能锁住数据(我在搞ldap时就深受其害,没法根治),所以还是 ......

Ubuntu Linux入门到精通

 
 
  
  
  本书全面介绍了Ubuntu Linux的相关知识,内容详实,论述清晰。主要内容包括Ubuntu介绍、文件系统管理、进程管理、压缩与查询系统、Shell应用、TCP/IP基础、网络管理、网络硬盘以及加密安全通信等内容。
  本书是一本理论与实践并重的书籍,可作为专业人员的参考书籍,也适合于对Ubuntu ......

Apache Linux上RPM包卸载 备忘

[root@apache02 home]# rpm -q -a|grep http
httpd-2.0.52-25.ent
httpd-manual-2.0.52-25.ent
system-config-httpd-1.3.1-1
httpd-devel-2.0.52-25.ent
httpd-suexec-2.0.52-25.ent
#rpm -e httpd-2.0.52-25.ent
error: Failed dependencies:
        httpd-mmn = 20020903 is ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号