From owner-p4-projects@FreeBSD.ORG Sat Oct 20 22:46:09 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 05CCB16A41A; Sat, 20 Oct 2007 22:46:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C2D116A418 for ; Sat, 20 Oct 2007 22:46:08 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 587F713C458 for ; Sat, 20 Oct 2007 22:46:08 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l9KMk8TC069677 for ; Sat, 20 Oct 2007 22:46:08 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l9KMk7Na069674 for perforce@freebsd.org; Sat, 20 Oct 2007 22:46:07 GMT (envelope-from jb@freebsd.org) Date: Sat, 20 Oct 2007 22:46:07 GMT Message-Id: <200710202246.l9KMk7Na069674@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 127856 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2007 22:46:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=127856 Change 127856 by jb@jb_freebsd1 on 2007/10/20 22:45:39 Solaris compatibility definitions. Affected files ... .. //depot/projects/dtrace/src/sys/sys/param.h#20 edit .. //depot/projects/dtrace6/src/include/elf.h#2 edit .. //depot/projects/dtrace6/src/include/stdlib.h#2 edit .. //depot/projects/dtrace6/src/include/strings.h#2 edit .. //depot/projects/dtrace6/src/sys/sys/fcntl.h#2 edit .. //depot/projects/dtrace6/src/sys/sys/param.h#2 edit .. //depot/projects/dtrace6/src/sys/sys/stat.h#2 edit .. //depot/projects/dtrace6/src/sys/sys/time.h#2 edit .. //depot/projects/dtrace6/src/sys/sys/types.h#2 edit Differences ... ==== //depot/projects/dtrace/src/sys/sys/param.h#20 (text+ko) ==== @@ -316,7 +316,7 @@ * FreeBSD headers provide to OpenSolaris code. Perhaps one day there * will be a really, really Single Unix Specification. */ -#define __OpenSolaris_version 20060731 +#define __OpenSolaris_version 20071001 #endif #endif /* _SYS_PARAM_H_ */ ==== //depot/projects/dtrace6/src/include/elf.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/include/elf.h,v 1.8 2002/07/04 11:05:39 markm Exp $ + * $FreeBSD: src/include/elf.h,v 1.9 2006/10/04 07:25:55 jb Exp $ */ /* @@ -38,4 +38,8 @@ #include #include +#ifdef _SOLARIS_C_SOURCE +#include +#endif + #endif /* !_ELF_H_ */ ==== //depot/projects/dtrace6/src/include/stdlib.h#2 (text+ko) ==== @@ -281,6 +281,10 @@ extern char *suboptarg; /* getsubopt(3) external variable */ #endif /* __BSD_VISIBLE */ + +#ifdef _SOLARIS_C_SOURCE +#define getexecname getprogname +#endif __END_DECLS #endif /* !_STDLIB_H_ */ ==== //depot/projects/dtrace6/src/include/strings.h#2 (text+ko) ==== @@ -53,4 +53,8 @@ int strncasecmp(const char *, const char *, size_t) __pure; __END_DECLS +#ifdef _SOLARIS_C_SOURCE +#include +#endif + #endif /* _STRINGS_H_ */ ==== //depot/projects/dtrace6/src/sys/sys/fcntl.h#2 (text+ko) ==== @@ -223,6 +223,15 @@ #if __BSD_VISIBLE int flock(int, int); #endif + +/* + * Solaris compatibility definitions. + */ +#ifdef _SOLARIS_C_SOURCE + +#define open64 open + +#endif __END_DECLS #endif ==== //depot/projects/dtrace6/src/sys/sys/param.h#2 (text+ko) ==== @@ -327,4 +327,20 @@ #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) +/* + * Solaris compatibility definitions. + */ +#ifdef _SOLARIS_C_SOURCE +#define PAGESIZE PAGE_SIZE + +/* + * The OpenSolaris version is set according to the version last imported + * from http://dlc.sun.com/osol/on/downloads/current/. In FreeBSD header + * files it can be used to determine the level of compatibility that the + * FreeBSD headers provide to OpenSolaris code. Perhaps one day there + * will be a really, really Single Unix Specification. + */ +#define __OpenSolaris_version 20071001 +#endif + #endif /* _SYS_PARAM_H_ */ ==== //depot/projects/dtrace6/src/sys/sys/stat.h#2 (text+ko) ==== @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * @(#)stat.h 8.12 (Berkeley) 6/16/95 - * $FreeBSD: src/sys/sys/stat.h,v 1.41 2005/03/22 01:19:18 das Exp $ + * $FreeBSD: src/sys/sys/stat.h,v 1.42 2006/08/04 23:47:30 jb Exp $ */ #ifndef _SYS_STAT_H_ @@ -304,6 +304,14 @@ #endif /* __BSD_VISIBLE */ +/* + * Solaris compatibility definitions. + */ +#ifdef _SOLARIS_C_SOURCE +#define stat64 stat +#define fstat64 fstat +#endif + #ifndef _KERNEL __BEGIN_DECLS #if __BSD_VISIBLE ==== //depot/projects/dtrace6/src/sys/sys/time.h#2 (text+ko) ==== @@ -314,4 +314,27 @@ #endif /* !_KERNEL */ +/* + * Solaris compatibility definitions. + */ +#ifdef _SOLARIS_C_SOURCE +/* + * Definitions for commonly used resolutions. + */ +#define SEC 1 +#define MILLISEC 1000 +#define MICROSEC 1000000 +#define NANOSEC 1000000000 + +typedef longlong_t hrtime_t; + +#ifndef _KERNEL +static __inline hrtime_t gethrtime(void) { + struct timespec ts; + clock_gettime(CLOCK_UPTIME,&ts); + return (((u_int64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec); +} +#endif +#endif /* _SOLARIS_C_SOURCE */ + #endif /* !_SYS_TIME_H_ */ ==== //depot/projects/dtrace6/src/sys/sys/types.h#2 (text+ko) ==== @@ -291,6 +291,36 @@ #endif /* !_KERNEL */ /* + * Solaris compatibility definitions. + */ +#ifdef _SOLARIS_C_SOURCE +typedef u_int uint_t; +typedef u_char uchar_t; +typedef u_short ushort_t; +typedef u_long ulong_t; + +typedef long long longlong_t; +typedef unsigned long long u_longlong_t; + +typedef off_t off64_t; + +typedef id_t taskid_t; +typedef id_t projid_t; +typedef id_t poolid_t; +typedef id_t zoneid_t; +typedef id_t ctid_t; + +#ifndef _KERNEL +#if defined(__XOPEN_OR_POSIX) +typedef enum { _B_FALSE, _B_TRUE } boolean_t; +#else +typedef enum { B_FALSE, B_TRUE } boolean_t; +#endif /* defined(__XOPEN_OR_POSIX) */ +#endif + +#endif /* _SOLARIS_C_SOURCE */ + +/* * The following are all things that really shouldn't exist in this header, * since its purpose is to provide typedefs, not miscellaneous doodads. */