Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

UNIX network programming volume 2 source code use

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Download the source code, the home page of W. Richard Stevens: http://www.kohala.com/start/

Wget http://www.kohala.com/start/unpv22e/unpv22e.tar.gz-P / usr/local/src

two。 Decompression

Tar xvf / usr/local/src/unpv22e.tar.gz-C / root/bin

3. Compile library files

Cd / root/bin/unpv22e/./configure

Edit and generate the config.h file and comment on the following lines

Vi config.h56 / / # define uint8_t unsigned char / * * / 57 / / # define uint16_t unsigned short / * * / 58 / / # define uint32_t unsigned int / * /

Add MSG_R and MSG_W definition

Vi config.h66 / / add by jcq67 typedef unsigned long ulong_t;68 # define MSG_R 040069 # define MSG_W 0200

Add _ GNU_SOURCE definition

Vi config.h#define _ GNU_SOURCE

Compile warpunix.c and replace the mktemp function with the mkstemp function

Cd lib181 void182 Mktemp (char * template) 183 {184 if (mkstemp (template) = = NULL | | template [0] = = 0) 185 err_quit ("mktemp error"); 186}

Compile and generate libunpipc.a

Cd libmake

4. Build your own directory for writing code

Mkdir-p / root/bin/unpv2cd-cp / root/bin/unpv22e/libunpipc.a / root/bin/unpv22e/config.h / root/bin/unpv22e/Make.defines.

5. Compile your own files for each directory

Copy the * .h header files and Makfile files from each subdirectory, and then execute

Cp / root/bin/unpv22e/dir/*.h / root/bin/unpv22e/dir/Makefile / root/bin/unpv2

Make filename

You can compile the code in each subdirectory

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report