svr4_types.h revision 43412
143412Snewton/* 243412Snewton * Copyright (c) 1998 Mark Newton 343412Snewton * Copyright (c) 1994 Christos Zoulas 443412Snewton * All rights reserved. 543412Snewton * 643412Snewton * Redistribution and use in source and binary forms, with or without 743412Snewton * modification, are permitted provided that the following conditions 843412Snewton * are met: 943412Snewton * 1. Redistributions of source code must retain the above copyright 1043412Snewton * notice, this list of conditions and the following disclaimer. 1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright 1243412Snewton * notice, this list of conditions and the following disclaimer in the 1343412Snewton * documentation and/or other materials provided with the distribution. 1443412Snewton * 3. The name of the author may not be used to endorse or promote products 1543412Snewton * derived from this software without specific prior written permission 1643412Snewton * 1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2743412Snewton */ 2843412Snewton 2943412Snewton#ifndef _SVR4_TYPES_H_ 3043412Snewton#define _SVR4_TYPES_H_ 3143412Snewton 3243412Snewtontypedef u_quad_t svr4_ino64_t; 3343412Snewtontypedef quad_t svr4_off64_t; 3443412Snewtontypedef quad_t svr4_blkcnt64_t; 3543412Snewtontypedef u_quad_t svr4_fsblkcnt64_t; 3643412Snewton 3743412Snewtontypedef long svr4_off_t; 3843412Snewtontypedef u_long svr4_dev_t; 3943412Snewtontypedef u_long svr4_ino_t; 4043412Snewtontypedef u_long svr4_mode_t; 4143412Snewtontypedef u_long svr4_nlink_t; 4243412Snewtontypedef long svr4_uid_t; 4343412Snewtontypedef long svr4_gid_t; 4443412Snewtontypedef long svr4_daddr_t; 4543412Snewtontypedef long svr4_pid_t; 4643412Snewtontypedef long svr4_time_t; 4743412Snewtontypedef long svr4_blkcnt_t; 4843412Snewtontypedef u_long svr4_fsblkcnt_t; 4943412Snewtontypedef char *svr4_caddr_t; 5043412Snewtontypedef u_int svr4_size_t; 5143412Snewton 5243412Snewtontypedef short svr4_o_dev_t; 5343412Snewtontypedef short svr4_o_pid_t; 5443412Snewtontypedef u_short svr4_o_ino_t; 5543412Snewtontypedef u_short svr4_o_mode_t; 5643412Snewtontypedef short svr4_o_nlink_t; 5743412Snewtontypedef u_short svr4_o_uid_t; 5843412Snewtontypedef u_short svr4_o_gid_t; 5943412Snewtontypedef long svr4_clock_t; 6043412Snewtontypedef int svr4_key_t; 6143412Snewton 6243412Snewtontypedef struct timespec svr4_timestruc_t; 6343412Snewton 6443412Snewton#define svr4_omajor(x) ((int32_t)((((x) & 0x7f00) >> 8))) 6543412Snewton#define svr4_ominor(x) ((int32_t)((((x) & 0x00ff) >> 0))) 6643412Snewton#define svr4_omakedev(x,y) ((svr4_o_dev_t)((((x) << 8) & 0x7f00) | \ 6743412Snewton (((y) << 0) & 0x00ff))) 6843412Snewton 6943412Snewton#define svr4_to_bsd_odev_t(d) makedev(svr4_omajor(d), svr4_ominor(d)) 7043412Snewton#define bsd_to_svr4_odev_t(d) svr4_omakedev(major(d), minor(d)) 7143412Snewton 7243412Snewton#define svr4_major(x) ((int32_t)((((x) & 0xfffc0000) >> 18))) 7343412Snewton#define svr4_minor(x) ((int32_t)((((x) & 0x0003ffff) >> 0))) 7443412Snewton#define svr4_makedev(x,y) ((svr4_dev_t)((((x) << 18) & 0xfffc0000) | \ 7543412Snewton (((y) << 0) & 0x0003ffff))) 7643412Snewton#define svr4_to_bsd_dev_t(d) makedev(svr4_major(d), svr4_minor(d)) 7743412Snewton#define bsd_to_svr4_dev_t(d) svr4_makedev(major(d), minor(d)) 7843412Snewton 7943412Snewton#endif /* !_SVR4_TYPES_H_ */ 80