文件名称:UNIXCcode
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:147.08kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用C语言编写的Unix代码实例 供大家参考 -#include <sys/sem.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <stdio.h>
#include <sys/stat.h>
#define VERIFYERR(a, b) if (a) fprintf(stderr, " s failed.\n", b) else fprintf(stderr, " s success.\n", b)
void main(int argc, char*argv[])
{
int semid, index, i
struct semid_ds ds
unsigned short array[100]
if (argc != 4) return
semid = atoi(argv[1])
index = atoi(argv[2])
if (argv[3][0] == c )
{ /* 创建信号量*/
VERIFYERR(semget(semid, index, 0666|IPC_CREAT|IPC_EXCL) < 0, "Create sem")
}
else if (argv[3][0] == d )
{ /* 删除消息队列*/
VERIFYERR(semctl(semid, 0, IPC_RMID, NULL) < 0, "Delete sem")
}
else if (argv[3][0] == v )
{ /* 查看信号量信息*/
fprintf(stderr, "T ID INDEX SEMVAL SEMPID SEMNCNT SEMZCNT\n")
fprintf(stderr, "s 6d 6d 10d 10d 10d 10d\n",
semid, /* 标识号*/
index, /* 信号量序号*/
semctl(semid, index, GETVAL), /* 信号量值*/
semct > Downloads > 源码/资料
#include <sys/types.h>
#include <sys/ipc.h>
#include <stdio.h>
#include <sys/stat.h>
#define VERIFYERR(a, b) if (a) fprintf(stderr, " s failed.\n", b) else fprintf(stderr, " s success.\n", b)
void main(int argc, char*argv[])
{
int semid, index, i
struct semid_ds ds
unsigned short array[100]
if (argc != 4) return
semid = atoi(argv[1])
index = atoi(argv[2])
if (argv[3][0] == c )
{ /* 创建信号量*/
VERIFYERR(semget(semid, index, 0666|IPC_CREAT|IPC_EXCL) < 0, "Create sem")
}
else if (argv[3][0] == d )
{ /* 删除消息队列*/
VERIFYERR(semctl(semid, 0, IPC_RMID, NULL) < 0, "Delete sem")
}
else if (argv[3][0] == v )
{ /* 查看信号量信息*/
fprintf(stderr, "T ID INDEX SEMVAL SEMPID SEMNCNT SEMZCNT\n")
fprintf(stderr, "s 6d 6d 10d 10d 10d 10d\n",
semid, /* 标识号*/
index, /* 信号量序号*/
semctl(semid, index, GETVAL), /* 信号量值*/
semct > Downloads > 源码/资料
(系统自动生成,下载前可以参看下载内容)
下载文件列表
UNIXCcode/code/chapter10/jmp1.c
UNIXCcode/code/chapter10/sig1.c
UNIXCcode/code/chapter10/sig2.c
UNIXCcode/code/chapter10/sig3.c
UNIXCcode/code/chapter10/time1.c
UNIXCcode/code/chapter10/time2.c
UNIXCcode/code/chapter10/time3.c
UNIXCcode/code/chapter10/time4.c
UNIXCcode/code/chapter10/timeout1.c
UNIXCcode/code/chapter10/timeout2.c
UNIXCcode/code/chapter10/timeout3.c
UNIXCcode/code/chapter11/fifo1.c
UNIXCcode/code/chapter11/fifo2.c
UNIXCcode/code/chapter11/pipe1.c
UNIXCcode/code/chapter11/pipe2.c
UNIXCcode/code/chapter11/pipe3.c
UNIXCcode/code/chapter11/pipe4.c
UNIXCcode/code/chapter12/ipcmsg
UNIXCcode/code/chapter12/ipcmsg.c
UNIXCcode/code/chapter12/msg1
UNIXCcode/code/chapter12/msg1.c
UNIXCcode/code/chapter12/msg2
UNIXCcode/code/chapter12/msg2.c
UNIXCcode/code/chapter13/ipcsem.c
UNIXCcode/code/chapter13/sema.c
UNIXCcode/code/chapter13/semb.c
UNIXCcode/code/chapter14/ipcshm.c
UNIXCcode/code/chapter14/shm1.c
UNIXCcode/code/chapter14/shm2.c
UNIXCcode/code/chapter15/http1.c
UNIXCcode/code/chapter15/http2.c
UNIXCcode/code/chapter15/http3.c
UNIXCcode/code/chapter15/http5.c
UNIXCcode/code/chapter15/http6.c
UNIXCcode/code/chapter15/makefile
UNIXCcode/code/chapter15/tcp1.c
UNIXCcode/code/chapter15/tcp2.c
UNIXCcode/code/chapter15/tcpopt.c
UNIXCcode/code/chapter15/transip.c
UNIXCcode/code/chapter15/transip1.c
UNIXCcode/code/chapter15/transport.c
UNIXCcode/code/chapter15/transserv.c
UNIXCcode/code/chapter16/desktop1.c
UNIXCcode/code/chapter16/makefile
UNIXCcode/code/chapter16/ser1.c
UNIXCcode/code/chapter16/trans1.c
UNIXCcode/code/chapter16/udpk1.c
UNIXCcode/code/chapter16/udps1.c
UNIXCcode/code/chapter17/inet1.c
UNIXCcode/code/chapter17/inet2.c
UNIXCcode/code/chapter17/makefile
UNIXCcode/code/chapter17/proxy1.c
UNIXCcode/code/chapter17/proxy2.c
UNIXCcode/code/chapter17/proxy3.c
UNIXCcode/code/chapter17/tcpto1.c
UNIXCcode/code/chapter17/tcpto2.c
UNIXCcode/code/chapter18/con1.c
UNIXCcode/code/chapter18/config.ini
UNIXCcode/code/chapter18/makefile
UNIXCcode/code/chapter18/str1.c
UNIXCcode/code/chapter18/str2.c
UNIXCcode/code/chapter19/config.ini
UNIXCcode/code/chapter19/htservice.c
UNIXCcode/code/chapter19/htservice1.c
UNIXCcode/code/chapter19/htservice2.c
UNIXCcode/code/chapter19/makefile
UNIXCcode/code/chapter20/config.ini
UNIXCcode/code/chapter20/file1.c
UNIXCcode/code/chapter20/file2.c
UNIXCcode/code/chapter20/filesys1.c
UNIXCcode/code/chapter20/filesys1sco.c
UNIXCcode/code/chapter20/filesys2.c
UNIXCcode/code/chapter20/filesys2sco.c
UNIXCcode/code/chapter20/makefile
UNIXCcode/code/chapter20/makefiledll
UNIXCcode/code/chapter20/monitor1.c
UNIXCcode/code/chapter20/monitor2.c
UNIXCcode/code/chapter20/monitor3.c
UNIXCcode/code/chapter20/msg1.c
UNIXCcode/code/chapter20/msg2.c
UNIXCcode/code/chapter20/opendll.c
UNIXCcode/code/chapter20/process1.c
UNIXCcode/code/chapter20/process2.c
UNIXCcode/code/chapter20/time1.c
UNIXCcode/code/chapter20/time2.c
UNIXCcode/code/chapter21/config.ini
UNIXCcode/code/chapter21/login1.c
UNIXCcode/code/chapter21/makefile
UNIXCcode/code/chapter21/trans1.c
UNIXCcode/code/chapter3/d1.c
UNIXCcode/code/chapter3/d2.c
UNIXCcode/code/chapter3/main.c
UNIXCcode/code/chapter3/pr1.c
UNIXCcode/code/chapter3/pr2.c
UNIXCcode/code/chapter3/tdl.c
UNIXCcode/code/chapter3/tds.c
UNIXCcode/code/chapter4/file1.c
UNIXCcode/code/chapter4/file1sco.c
UNIXCcode/code/chapter4/ls1.c
UNIXCcode/code/chapter5/buf1.c
UNIXCcode/code/chapter5/copyname.c
UNIXCcode/code/chapter5/copynameid.c
UNIXCcode/code/chapter5/feof.c
UNIXCcode/code/chapter5/mysum.c
UNIXCcode/code/chapter5/open.c
UNIXCcode/code/chapter5/print1.c
UNIXCcode/code/chapter5/rdata.c
UNIXCcode/code/chapter5/seek.c
UNIXCcode/code/chapter5/wdata.c
UNIXCcode/code/chapter6/fcntl1.c
UNIXCcode/code/chapter6/hole.c
UNIXCcode/code/chapter6/lock1.c
UNIXCcode/code/chapter6/read1.c
UNIXCcode/code/chapter6/unlink1.c
UNIXCcode/code/chapter6/write1.c
UNIXCcode/code/chapter7/cdir.c
UNIXCcode/code/chapter7/dir1.c
UNIXCcode/code/chapter7/ls2.c
UNIXCcode/code/chapter7/rdir.c
UNIXCcode/code/chapter8/term1.c
UNIXCcode/code/chapter8/term2.c
UNIXCcode/code/chapter8/term3.c
UNIXCcode/code/chapter9/arg1.c
UNIXCcode/code/chapter9/env1.c
UNIXCcode/code/chapter9/env2.c
UNIXCcode/code/chapter9/exec1.c
UNIXCcode/code/chapter9/exec2.c
UNIXCcode/code/chapter9/fork1.c
UNIXCcode/code/chapter9/id1.c
UNIXCcode/code/chapter9/sys1.c
UNIXCcode/code/chapter9/szomb1.c
UNIXCcode/code/chapter9/szomb2.c
UNIXCcode/code/chapter9/term1.c
UNIXCcode/code/chapter9/term2.c
UNIXCcode/code/chapter9/term3.c
UNIXCcode/code/chapter9/wait1.c
UNIXCcode/code/chapter9/wait2.c
UNIXCcode/code/comlib/bin/config.ini
UNIXCcode/code/comlib/include/comlib.h
UNIXCcode/code/comlib/libsrc/config.c
UNIXCcode/code/comlib/libsrc/debug.c
UNIXCcode/code/comlib/libsrc/file.c
UNIXCcode/code/comlib/libsrc/makefile
UNIXCcode/code/comlib/libsrc/makefile.aix
UNIXCcode/code/comlib/libsrc/makefile.hp
UNIXCcode/code/comlib/libsrc/makefile.linux
UNIXCcode/code/comlib/libsrc/makefile.sco
UNIXCcode/code/comlib/libsrc/msg.c
UNIXCcode/code/comlib/libsrc/pid.c
UNIXCcode/code/comlib/libsrc/sem.c
UNIXCcode/code/comlib/libsrc/shm.c
UNIXCcode/code/comlib/libsrc/str.c
UNIXCcode
UNIXCcode/code/chapter10/sig1.c
UNIXCcode/code/chapter10/sig2.c
UNIXCcode/code/chapter10/sig3.c
UNIXCcode/code/chapter10/time1.c
UNIXCcode/code/chapter10/time2.c
UNIXCcode/code/chapter10/time3.c
UNIXCcode/code/chapter10/time4.c
UNIXCcode/code/chapter10/timeout1.c
UNIXCcode/code/chapter10/timeout2.c
UNIXCcode/code/chapter10/timeout3.c
UNIXCcode/code/chapter11/fifo1.c
UNIXCcode/code/chapter11/fifo2.c
UNIXCcode/code/chapter11/pipe1.c
UNIXCcode/code/chapter11/pipe2.c
UNIXCcode/code/chapter11/pipe3.c
UNIXCcode/code/chapter11/pipe4.c
UNIXCcode/code/chapter12/ipcmsg
UNIXCcode/code/chapter12/ipcmsg.c
UNIXCcode/code/chapter12/msg1
UNIXCcode/code/chapter12/msg1.c
UNIXCcode/code/chapter12/msg2
UNIXCcode/code/chapter12/msg2.c
UNIXCcode/code/chapter13/ipcsem.c
UNIXCcode/code/chapter13/sema.c
UNIXCcode/code/chapter13/semb.c
UNIXCcode/code/chapter14/ipcshm.c
UNIXCcode/code/chapter14/shm1.c
UNIXCcode/code/chapter14/shm2.c
UNIXCcode/code/chapter15/http1.c
UNIXCcode/code/chapter15/http2.c
UNIXCcode/code/chapter15/http3.c
UNIXCcode/code/chapter15/http5.c
UNIXCcode/code/chapter15/http6.c
UNIXCcode/code/chapter15/makefile
UNIXCcode/code/chapter15/tcp1.c
UNIXCcode/code/chapter15/tcp2.c
UNIXCcode/code/chapter15/tcpopt.c
UNIXCcode/code/chapter15/transip.c
UNIXCcode/code/chapter15/transip1.c
UNIXCcode/code/chapter15/transport.c
UNIXCcode/code/chapter15/transserv.c
UNIXCcode/code/chapter16/desktop1.c
UNIXCcode/code/chapter16/makefile
UNIXCcode/code/chapter16/ser1.c
UNIXCcode/code/chapter16/trans1.c
UNIXCcode/code/chapter16/udpk1.c
UNIXCcode/code/chapter16/udps1.c
UNIXCcode/code/chapter17/inet1.c
UNIXCcode/code/chapter17/inet2.c
UNIXCcode/code/chapter17/makefile
UNIXCcode/code/chapter17/proxy1.c
UNIXCcode/code/chapter17/proxy2.c
UNIXCcode/code/chapter17/proxy3.c
UNIXCcode/code/chapter17/tcpto1.c
UNIXCcode/code/chapter17/tcpto2.c
UNIXCcode/code/chapter18/con1.c
UNIXCcode/code/chapter18/config.ini
UNIXCcode/code/chapter18/makefile
UNIXCcode/code/chapter18/str1.c
UNIXCcode/code/chapter18/str2.c
UNIXCcode/code/chapter19/config.ini
UNIXCcode/code/chapter19/htservice.c
UNIXCcode/code/chapter19/htservice1.c
UNIXCcode/code/chapter19/htservice2.c
UNIXCcode/code/chapter19/makefile
UNIXCcode/code/chapter20/config.ini
UNIXCcode/code/chapter20/file1.c
UNIXCcode/code/chapter20/file2.c
UNIXCcode/code/chapter20/filesys1.c
UNIXCcode/code/chapter20/filesys1sco.c
UNIXCcode/code/chapter20/filesys2.c
UNIXCcode/code/chapter20/filesys2sco.c
UNIXCcode/code/chapter20/makefile
UNIXCcode/code/chapter20/makefiledll
UNIXCcode/code/chapter20/monitor1.c
UNIXCcode/code/chapter20/monitor2.c
UNIXCcode/code/chapter20/monitor3.c
UNIXCcode/code/chapter20/msg1.c
UNIXCcode/code/chapter20/msg2.c
UNIXCcode/code/chapter20/opendll.c
UNIXCcode/code/chapter20/process1.c
UNIXCcode/code/chapter20/process2.c
UNIXCcode/code/chapter20/time1.c
UNIXCcode/code/chapter20/time2.c
UNIXCcode/code/chapter21/config.ini
UNIXCcode/code/chapter21/login1.c
UNIXCcode/code/chapter21/makefile
UNIXCcode/code/chapter21/trans1.c
UNIXCcode/code/chapter3/d1.c
UNIXCcode/code/chapter3/d2.c
UNIXCcode/code/chapter3/main.c
UNIXCcode/code/chapter3/pr1.c
UNIXCcode/code/chapter3/pr2.c
UNIXCcode/code/chapter3/tdl.c
UNIXCcode/code/chapter3/tds.c
UNIXCcode/code/chapter4/file1.c
UNIXCcode/code/chapter4/file1sco.c
UNIXCcode/code/chapter4/ls1.c
UNIXCcode/code/chapter5/buf1.c
UNIXCcode/code/chapter5/copyname.c
UNIXCcode/code/chapter5/copynameid.c
UNIXCcode/code/chapter5/feof.c
UNIXCcode/code/chapter5/mysum.c
UNIXCcode/code/chapter5/open.c
UNIXCcode/code/chapter5/print1.c
UNIXCcode/code/chapter5/rdata.c
UNIXCcode/code/chapter5/seek.c
UNIXCcode/code/chapter5/wdata.c
UNIXCcode/code/chapter6/fcntl1.c
UNIXCcode/code/chapter6/hole.c
UNIXCcode/code/chapter6/lock1.c
UNIXCcode/code/chapter6/read1.c
UNIXCcode/code/chapter6/unlink1.c
UNIXCcode/code/chapter6/write1.c
UNIXCcode/code/chapter7/cdir.c
UNIXCcode/code/chapter7/dir1.c
UNIXCcode/code/chapter7/ls2.c
UNIXCcode/code/chapter7/rdir.c
UNIXCcode/code/chapter8/term1.c
UNIXCcode/code/chapter8/term2.c
UNIXCcode/code/chapter8/term3.c
UNIXCcode/code/chapter9/arg1.c
UNIXCcode/code/chapter9/env1.c
UNIXCcode/code/chapter9/env2.c
UNIXCcode/code/chapter9/exec1.c
UNIXCcode/code/chapter9/exec2.c
UNIXCcode/code/chapter9/fork1.c
UNIXCcode/code/chapter9/id1.c
UNIXCcode/code/chapter9/sys1.c
UNIXCcode/code/chapter9/szomb1.c
UNIXCcode/code/chapter9/szomb2.c
UNIXCcode/code/chapter9/term1.c
UNIXCcode/code/chapter9/term2.c
UNIXCcode/code/chapter9/term3.c
UNIXCcode/code/chapter9/wait1.c
UNIXCcode/code/chapter9/wait2.c
UNIXCcode/code/comlib/bin/config.ini
UNIXCcode/code/comlib/include/comlib.h
UNIXCcode/code/comlib/libsrc/config.c
UNIXCcode/code/comlib/libsrc/debug.c
UNIXCcode/code/comlib/libsrc/file.c
UNIXCcode/code/comlib/libsrc/makefile
UNIXCcode/code/comlib/libsrc/makefile.aix
UNIXCcode/code/comlib/libsrc/makefile.hp
UNIXCcode/code/comlib/libsrc/makefile.linux
UNIXCcode/code/comlib/libsrc/makefile.sco
UNIXCcode/code/comlib/libsrc/msg.c
UNIXCcode/code/comlib/libsrc/pid.c
UNIXCcode/code/comlib/libsrc/sem.c
UNIXCcode/code/comlib/libsrc/shm.c
UNIXCcode/code/comlib/libsrc/str.c
UNIXCcode
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.