![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Socket Learning
文章平均质量分 76
iteye_19019
这个作者很懒,什么都没留下…
展开
-
unp.h
/* include unph */ /* Our own header. Tabs are set for 4 spaces, not 8 */ #ifndef __unp_h #define __unp_h #include "../config.h" /* configuration options for current OS */ /* "../conf...原创 2010-05-18 21:59:05 · 171 阅读 · 0 评论 -
wrapsock.c
/* * Socket wrapper functions. * These could all go into separate files, so only the ones needed cause * the corresponding function to be added to the executable. If sockets * are a library (...原创 2010-05-18 22:01:27 · 73 阅读 · 0 评论 -
readn.c
/* include readn */ #include "unp.h" ssize_t /* Read "n" bytes from a descriptor. */ readn(int fd, void *vptr, size_t n) { size_t nleft; ssize_t nread; char *ptr; ptr = vptr; nl...原创 2010-05-18 22:02:38 · 98 阅读 · 0 评论 -
readline.c
/* include readline */ #include "unp.h" static ssize_t my_read(int fd, char *ptr) { static int read_cnt = 0; static char *read_ptr; static char read_buf[MAXLINE]; if (read_cnt原创 2010-05-18 22:03:25 · 102 阅读 · 0 评论 -
writen.c
/* include writen */ #include "unp.h" ssize_t /* Write "n" bytes to a descriptor. */ writen(int fd, const void *vptr, size_t n) { size_t nleft; ssize_t nwritten; const char *ptr; ...原创 2010-05-18 22:03:57 · 126 阅读 · 0 评论 -
Makefile文件编写
一个简单的makefile示例及其注释 相信在unix下编程的没有不知道makefile的,刚开始学习unix平台 下的东西,了解了下makefile的制作,觉得有点东西可以记录下。 下面是一个极其简单的例子: 现在我要编译一个Hello world,需要如下三个文件: 1. print.h #include void printhello(); ...原创 2010-05-19 11:35:39 · 108 阅读 · 0 评论