From owner-freebsd-questions@FreeBSD.ORG Mon Apr 14 17:15:40 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B39151065673 for ; Mon, 14 Apr 2008 17:15:40 +0000 (UTC) (envelope-from brother_seamus@btinternet.com) Received: from web86514.mail.ird.yahoo.com (web86514.mail.ird.yahoo.com [217.146.189.166]) by mx1.freebsd.org (Postfix) with SMTP id 319CB8FC16 for ; Mon, 14 Apr 2008 17:15:39 +0000 (UTC) (envelope-from brother_seamus@btinternet.com) Received: (qmail 49211 invoked by uid 60001); 14 Apr 2008 16:48:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=btinternet.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=HiwHcgGbJVblGPqqpJ9i8srRCKFbqWM96VB2bd4zrBnnVG1WxcUsGCNrL//WGgymjhR22Z270RoeTEL+3rzkkZeIWiKNLf7ZZKBfNDdGLzTGdytcAWyiDlBmDY71LRw0LDjdfBNgTuyoU8uif14oJjWRw3Gke8bb1Nrrn2JhX8A=; X-YMail-OSG: HrUPrigVM1l75CXWh1EaEnsvXJwgopy_aoS3FETCYIa19NEPQKkwzF16D4kCEAObL_CKsg-- Received: from [217.42.59.28] by web86514.mail.ird.yahoo.com via HTTP; Mon, 14 Apr 2008 16:48:58 GMT X-Mailer: YahooMailRC/902.40 YahooMailWebService/0.7.162 Date: Mon, 14 Apr 2008 16:48:58 +0000 (GMT) From: Brother Seamus To: freebsd-questions@freebsd.org MIME-Version: 1.0 Message-ID: <774348.47840.qm@web86514.mail.ird.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: advanced programming unix environment X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 17:15:40 -0000 I am trying to build the neccesary files for the stevens/rago APUE.2e book = on FreeBSD 7.0=0A=0Aas instructed i get the source from here: http://www.ap= uebook.com/src.tar.gz=0A=0Aunzip & untar to:=0A=0A/home/seamus/apue.2e=0A= =0Acd /home/seamus/apue.2e=0A=0Aamend "Make.defines.freebsd" as instructed = so:=0A"WKDIR=3D/home/seamus/apue.2e"=0A=0Aand then run "make" from this dir= ectory.=0A=0AI get the following error:=0A+++++++++++++++++++++++++++++++++= ++++++++=0Apracct.c ../lib/libapue.a =0Apracct.c: In function 'main':=0Apr= acct.c:31: error: storage size of 'acdata' isn't known=0Apracct.c:31: warni= ng: unused variable 'acdata'=0A*** Error code 1=0A=0AStop in /usr/home/seam= us/apue.2e/proc.=0A*** Error code 1=0A=0AStop in /usr/home/seamus/apue.2e.= =0A*** Error code 1=0A=0AStop in /usr/home/seamus/apue.2e.=0A++++++++++++++= +++++++++++++++++++++++++++=0A=0AI would appreciate any help.=0A=0A++++++++= +++++++++++++++++++++++++++++++++=0AMake.defines.freebsd=0A++++++++++++++++= +++++++++++++++++++++++++=0A=0A# Common make definitions, customized for ea= ch platform=0A=0A# Definitions required in all program directories to compi= le and link=0A# C programs using gcc.=0A=0AWKDIR=3D/home/seamus/apue.2e=0AC= C=3Dgcc=0ACOMPILE.c=3D$(CC) $(CFLAGS) $(CPPFLAGS) -c=0ALINK.c=3D$(CC) $(CFL= AGS) $(CPPFLAGS) $(LDDIR) $(LDFLAGS)=0ALDDIR=3D-L../lib=0ALDLIBS=3D../lib/l= ibapue.a $(EXTRALIBS)=0ACFLAGS=3D-ansi -I$(WKDIR)/include -Wall -DBSD $(EXT= RA)=0A=0A# Our library that almost every program needs.=0ALIB=3D../libapue.= a=0A=0A# Common temp files to delete from each directory.=0ATEMPFILES=3Dcor= e core.* *.o temp.* *.out typescript*=0A=0A++++++++++++++++++++++++++++++++= +++++++++=0Apracct.c=0A+++++++++++++++++++++++++++++++++++++++++=0A=0A#incl= ude "apue.h"=0A#include =0A=0A#ifdef HAS_SA_STAT=0A#define FMT = "%-*.*s e =3D %6ld, chars =3D %7ld, stat =3D %3u: %c %c %c %c\n"=0A#else= =0A#define FMT "%-*.*s e =3D %6ld, chars =3D %7ld, %c %c %c %c\n"=0A#endif= =0A#ifndef HAS_ACORE=0A#define ACORE 0=0A#endif=0A#ifndef HAS_AXSIG=0A#defi= ne AXSIG 0=0A#endif=0A=0Astatic unsigned long=0Acompt2ulong(comp_t comptime= ) /* convert comp_t to unsigned long */=0A{=0A unsigned long val;= =0A int exp;=0A=0A val =3D comptime & 0x1fff; /* 13= -bit fraction */=0A exp =3D (comptime >> 13) & 7; /* 3-bit exponent (= 0-7) */=0A while (exp-- > 0)=0A val *=3D 8;=0A return(val);=0A= }=0Aint=0Amain(int argc, char *argv[])=0A{=0A struct acct acdata;= =0A FILE *fp;=0A=0A if (argc !=3D 2)=0A err_quit("u= sage: pracct filename");=0A if ((fp =3D fopen(argv[1], "r")) =3D=3D NULL= )=0A err_sys("can't open %s", argv[1]);=0A while (fread(&acdata, = sizeof(acdata), 1, fp) =3D=3D 1) {=0A printf(FMT, (int)sizeof(acdata= .ac_comm),=0A (int)sizeof(acdata.ac_comm), acdata.ac_comm,=0A = compt2ulong(acdata.ac_etime), compt2ulong(acdata.ac_io),=0A#ifdef = HAS_SA_STAT=0A (unsigned char) acdata.ac_stat,=0A#endif=0A = acdata.ac_flag & ACORE ? 'D' : ' ',=0A acdata.ac_flag & AX= SIG ? 'X' : ' ',=0A acdata.ac_flag & AFORK ? 'F' : ' ',=0A = acdata.ac_flag & ASU ? 'S' : ' ');=0A }=0A if (ferror(fp))=0A= err_sys("read error");=0A exit(0);=0A}=0A=0A=0A=0A=0A