From owner-freebsd-hackers Thu Oct 8 10:23:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA06339 for freebsd-hackers-outgoing; Thu, 8 Oct 1998 10:23:48 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from symbion.srrc.usda.gov ([199.78.118.118]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA06046 for ; Thu, 8 Oct 1998 10:22:08 -0700 (PDT) (envelope-from glenn@nola.srrc.usda.gov) Received: from nola.srrc.usda.gov (localhost.srrc.usda.gov [127.0.0.1]) by symbion.srrc.usda.gov (8.9.1/8.9.1) with ESMTP id MAA00871 for ; Thu, 8 Oct 1998 12:21:42 -0500 (CDT) (envelope-from glenn@nola.srrc.usda.gov) Message-Id: <199810081721.MAA00871@symbion.srrc.usda.gov> X-Mailer: exmh version 2.0.2 2/24/98 To: hackers@FreeBSD.ORG From: Glenn Johnson Subject: incomplete type errors Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 08 Oct 1998 12:21:42 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am trying to compile the code below: #include #ifdef _TIMES #include #include #include #else #include #endif #include #include "libU77.h" real etime_(real t[2]) { #ifdef _TIMES struct tms tm; times(&tm); t[0] = (real) (tm.tms_utime + tm.tms_cutime) / (real) CLOCKS_PER_SEC; t[1] = (real) (tm.tms_stime + tm.tms_cstime) / (real) CLOCKS_PER_SEC; #else struct rusage tm; float meg = 1000000.0; getrusage(RUSAGE_SELF, &tm); t[0] = (real) (tm.ru_utime.tv_sec + (tm.ru_utime.tv_usec) / meg); t[1] = (real) (tm.ru_stime.tv_sec + (tm.ru_stime.tv_usec) / meg); #endif return (real) (t[0]+t[1]); } I get the following error upon compilation: In file included from etime.c:56: /usr/include/sys/resource.h:58: field `ru_utime' has incomplete type /usr/include/sys/resource.h:59: field `ru_stime' has incomplete type *** Error code 1 Stop. The /usr/include/sys/resource.h contains the following: /* * Resource utilization information. */ #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN -1 struct rusage { struct timeval ru_utime; /* user time used */ struct timeval ru_stime; /* system time used */ long ru_maxrss; /* max resident set size */ What do I need to do to the code to make it right? Thanks in advance. -- Glenn Johnson Technician USDA, ARS, SRRC New Orleans, LA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message