154359Sroberto/*
254359Sroberto * This software was developed by the Computer Systems Engineering group
354359Sroberto * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66.
454359Sroberto *
554359Sroberto * Copyright (c) 1992 The Regents of the University of California.
654359Sroberto * All rights reserved.
754359Sroberto *
854359Sroberto * Redistribution and use in source and binary forms, with or without
954359Sroberto * modification, are permitted provided that the following conditions
1054359Sroberto * are met:
1154359Sroberto * 1. Redistributions of source code must retain the above copyright
1254359Sroberto *    notice, this list of conditions and the following disclaimer.
1354359Sroberto * 2. Redistributions in binary form must reproduce the above copyright
1454359Sroberto *    notice, this list of conditions and the following disclaimer in the
1554359Sroberto *    documentation and/or other materials provided with the distribution.
1654359Sroberto * 3. All advertising materials mentioning features or use of this software
1754359Sroberto *    must display the following acknowledgement:
1854359Sroberto *	This product includes software developed by the University of
1954359Sroberto *	California, Lawrence Berkeley Laboratory.
2054359Sroberto * 4. The name of the University may not be used to endorse or promote
2154359Sroberto *    products derived from this software without specific prior
2254359Sroberto *    written permission.
2354359Sroberto *
2454359Sroberto * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2554359Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2654359Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2754359Sroberto * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2854359Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2954359Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3054359Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3154359Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3254359Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3354359Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3454359Sroberto * SUCH DAMAGE.
3554359Sroberto */
3654359Sroberto
3754359Sroberto#ifndef TIOCGPPSEV
3854359Sroberto#define PPSCLOCKSTR	"ppsclock"
3954359Sroberto
4054359Sroberto#ifndef HAVE_STRUCT_PPSCLOCKEV
4154359Srobertostruct ppsclockev {
4254359Sroberto	struct timeval tv;
4354359Sroberto	u_int serial;
4454359Sroberto};
4554359Sroberto#endif
4654359Sroberto
4754359Sroberto#if defined(__STDC__) || defined(SYS_HPUX)
4854359Sroberto#ifdef	_IOR
4954359Sroberto#define CIOGETEV        _IOR('C', 0, struct ppsclockev)	/* get last pps event */
5054359Sroberto#else	/* XXX SOLARIS is different */
5154359Sroberto#define	CIO	('C'<<8)
5254359Sroberto#define CIOGETEV        (CIO|0)		/* get last pps event */
5354359Sroberto#endif	/* _IOR */
5454359Sroberto#else	/* __STDC__ */
5554359Sroberto#ifdef	_IOR
5654359Sroberto#define CIOGETEV        _IOR(C, 0, struct ppsclockev)	/* get last pps event */
5754359Sroberto#else	/* XXX SOLARIS is different */
5854359Sroberto#define	CIO	('C'<<8)
5954359Sroberto#define CIOGETEV        (CIO|0)		/* get last pps event */
6054359Sroberto#endif	/* _IOR */
6154359Sroberto#endif	/* __STDC__ */
6254359Sroberto#else
6354359Sroberto#define CIOGETEV TIOCGPPSEV
6454359Sroberto#endif
65