Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb17928

Browse files
committed
g
1 parent920e630 commitbb17928

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

‎60/fatal.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include<stdio.h>
2+
#include<stdlib.h>
3+
4+
#defineError(Str) FatalError(Str)
5+
#defineFatalError(Str) fprintf(stderr, "%s\n", Str);exit(1)

‎60/id_echo.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include<unistd.h>
2+
#include<stdio.h>
3+
#include<socket.h>
4+
#include"fatal.h"
5+
#include<stdlib.h>
6+
7+
8+
#defineSERVICE "echo"
9+
#defineBUF_SIZE 500

‎60/id_echo_sv.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include<syslog.h>
2+
#include"id_echo.h"
3+
4+
intmain(intargc,char*argv[]){
5+
intsfd;
6+
ssize_tnumRead;
7+
socklen_taddrlen,len;
8+
structsockaddr_storagecladdr;
9+
charbuf[BUF_SIZE];
10+
charaddrStr[IS_ADDR_STR_LEN];
11+
12+
13+
}

‎63/t_select.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include<sys/time.h>
2+
#include<sys/select.h>
3+
#include<stdio.h>
4+
#incldue <stdlib.h>
5+
6+
staticvoidusageError(constchar*progName){
7+
fprintf(stderr,"Usage: %s {timeout|-} fd-num[rw]...\n",progName);
8+
fprintf(stderr," - means infinite timeout; \n");
9+
fprintf(stderr," r = monitor for read\n");
10+
fprintf(stderr," w = monitor for write\n\n");
11+
fprintf(stderr," e.g.: %s - 0rw 1w\n",progName);
12+
exit(EXIT_FAILURE);
13+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp