1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _SYS_LX_STAT_H
  27 #define _SYS_LX_STAT_H
  28 
  29 #pragma ident   "%Z%%M% %I%     %E% SMI"
  30 
  31 #ifdef  __cplusplus
  32 extern "C" {
  33 #endif
  34 
  35 #include <sys/lx_types.h>
  36 #include <sys/stat.h>
  37 
  38 #define LX_MAJORSHIFT           8
  39 #define LX_MINORMASK            ((1 << LX_MAJORSHIFT) - 1)
  40 #define LX_MAKEDEVICE(lx_maj, lx_min)   \
  41         ((lx_dev_t)((lx_maj) << LX_MAJORSHIFT | ((lx_min) & LX_MINORMASK)))
  42 
  43 #define LX_GETMAJOR(lx_dev)     ((lx_dev) >> LX_MAJORSHIFT)
  44 #define LX_GETMINOR(lx_dev)     ((lx_dev) & LX_MINORMASK)
  45 
  46 #undef st_atime
  47 #undef st_mtime
  48 #undef st_ctime
  49 
  50 struct lx_stat {
  51         lx_dev16_t              st_dev;
  52         uint16_t                st_pad1;
  53         lx_ino_t                st_ino;
  54         lx_mode16_t             st_mode;
  55         uint16_t                st_nlink;
  56         lx_uid16_t              st_uid;
  57         lx_gid16_t              st_gid;
  58         lx_dev16_t              st_rdev;
  59         uint16_t                st_pad2;
  60         lx_off_t                st_size;
  61         lx_blksize_t            st_blksize;
  62         lx_blkcnt_t             st_blocks;
  63         struct lx_timespec      st_atime;
  64         struct lx_timespec      st_mtime;
  65         struct lx_timespec      st_ctime;
  66         uint32_t                st_pad3;
  67         uint32_t                st_pad4;
  68 };
  69 
  70 struct lx_stat64 {
  71         lx_dev_t                st_dev;
  72         uint32_t                st_pad1;
  73         lx_ino_t                st_small_ino;
  74         lx_mode_t               st_mode;
  75         uint_t                  st_nlink;
  76         lx_uid_t                st_uid;
  77         lx_gid_t                st_gid;
  78         lx_dev_t                st_rdev;
  79         uint32_t                st_pad2;
  80         lx_off64_t              st_size;
  81         lx_blksize_t            st_blksize;
  82         lx_blkcnt64_t           st_blocks;
  83         struct lx_timespec      st_atime;
  84         struct lx_timespec      st_mtime;
  85         struct lx_timespec      st_ctime;
  86         lx_ino64_t              st_ino;
  87 };
  88 
  89 extern int lx_stat_init(void);
  90 
  91 #ifdef  __cplusplus
  92 }
  93 #endif
  94 
  95 #endif  /* _SYS_LX_STAT_H */