ppsclock.h revision 285612
134689Sbde/* 250476Speter * This software was developed by the Computer Systems Engineering group 31573Srgrimes * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66. 434689Sbde * 534689Sbde * Copyright (c) 1992 The Regents of the University of California. 634689Sbde * All rights reserved. 738752Sbde * 881920Skris * Redistribution and use in source and binary forms, with or without 979471Smarkm * modification, are permitted provided that the following conditions 1081133Stmm * are met: 1159897Sjoe * 1. Redistributions of source code must retain the above copyright 1279471Smarkm * notice, this list of conditions and the following disclaimer. 1350731Speter * 2. Redistributions in binary form must reproduce the above copyright 1459353Skris * notice, this list of conditions and the following disclaimer in the 1541257Sjdp * documentation and/or other materials provided with the distribution. 1641257Sjdp * 3. All advertising materials mentioning features or use of this software 1756081Sbde * must display the following acknowledgement: 1874840Sken * This product includes software developed by the University of 1934689Sbde * California, Lawrence Berkeley Laboratory. 2034689Sbde * 4. The name of the University may not be used to endorse or promote 2134689Sbde * products derived from this software without specific prior 2281133Stmm * written permission. 2379471Smarkm * 2478560Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2578560Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2678560Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2781133Stmm * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2856058Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2981920Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3062414Sn_hibma * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3134689Sbde * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3238632Sjb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3338632Sjb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3472309Sobrien * SUCH DAMAGE. 3534689Sbde */ 3672309Sobrien 3772309Sobrien#ifndef TIOCGPPSEV 381573Srgrimes#define PPSCLOCKSTR "ppsclock" 391573Srgrimes 4034330Sjb#ifndef HAVE_STRUCT_PPSCLOCKEV 4134689Sbdestruct ppsclockev { 4217706Sjulian struct timeval tv; 4317706Sjulian u_int serial; 4453927Speter}; 4553922Speter#endif 4653922Speter 4753922Speter#if defined(__STDC__) || defined(SYS_HPUX) 4834689Sbde#ifdef _IOR 4938477Sgpalmer#define CIOGETEV _IOR('C', 0, struct ppsclockev) /* get last pps event */ 5052228Sbp#else /* XXX SOLARIS is different */ 5134689Sbde#define CIO ('C'<<8) 5236026Sjb#define CIOGETEV (CIO|0) /* get last pps event */ 5334689Sbde#endif /* _IOR */ 5441912Sdfr#else /* __STDC__ */ 5541912Sdfr#ifdef _IOR 5672309Sobrien#define CIOGETEV _IOR(C, 0, struct ppsclockev) /* get last pps event */ 5741912Sdfr#else /* XXX SOLARIS is different */ 5841912Sdfr#define CIO ('C'<<8) 5951994Smarkm#define CIOGETEV (CIO|0) /* get last pps event */ 6051994Smarkm#endif /* _IOR */ 6174813Sru#endif /* __STDC__ */ 6234689Sbde#else 6334689Sbde#define CIOGETEV TIOCGPPSEV 6420845Speter#endif 6581054Ssobomax