Date: Mon, 14 Apr 2008 16:48:58 +0000 (GMT) From: Brother Seamus <brother_seamus@btinternet.com> To: freebsd-questions@freebsd.org Subject: advanced programming unix environment Message-ID: <774348.47840.qm@web86514.mail.ird.yahoo.com>
next in thread | raw e-mail | index | archive | help
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 <sys/acct.h>=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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?774348.47840.qm>