🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #2257

һ��SCO UNIX�±������

#2257
From: Wangjun
Date: Tue, 06 Jan 1998 00:00
61 lines
2047 bytes
����SCO-UNIX��cc���³��������server.o, �����ܵõ�ִ�д��롣
��ϵͳ���Ѱ�װ��TCP/IP��������������λ��̡�
#cc server.c
undefined symbol           first referenced
  bind                        server.o
  bcopy                       server.o
   .                           .
   .                           .
   .                           . 
  accept                      server.o

ld fatal: Symbol referencing errors No output written to a.out


/*Server.c */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>

#define PORT (u_short)10000 
#define BUF_LEN 100
char hostname[]="wjsystem";
char buf[BUF_LEN];

main()
{struct hostent *myhost;
 struct sockaddr_in me;
 int s_waiting,s;
 
 myhost=gethostbyname(hostname);
 bzero((char *)&me,sizeof(me));
 me.sin_family=AF_INET;
 me.sin_port=PORT;
 bcopy(myhost->h_addr,(char *)&me.sin_addr,myhost->h_length);
 
 s_waiting=socket(AF_INET,SOCK_STREAM,0);
 bind(s_waiting,&me,sizeof(me));

 listen(s_waiting,1);
 s=accept(s_waiting,NULL,NULL);
 close(s_waiting);
 write(1,"Wait!\n",6);
 do
  {
   int n;
   n=read(0,buf,BUF_LEN);
   write(s,buf,n);
   n=read(s,buf,BUF_LEN);
   write(1,buf,n);
   }
  while (strncmp(buf,"quit",4)!=0);
 close(s);
}
   
------------------------------------
лл��
wangjun@public.hf.ah.cn
Technical Details
Message-ID: <34B1D750.15FD@public.hf.ah.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,a039729adbe68b70,start
X-Google-Attributes: gidfc86e,public
From: Wangjun <wangjun@public.hf.ah.cn>
Subject: һ��SCO UNIX�±������
Date: 1998/01/06
Message-ID: <34B1D750.15FD@public.hf.ah.cn>
X-Deja-AN: 313219355
Content-Transfer-Encoding: 8bit
X-Server-Date: 6 Jan 1998 07:05:01 GMT
Mime-Version: 1.0
Reply-To: wangjun@public.hf.ah.cn
Content-Type: text/plain; charset=iso-8859-1
Organization: Chinese Linux User Group
Newsgroups: cn.bbs.comp.program