Print this page
    
NEX-16818 Add fksmbcl development tool
NEX-17264 SMB client test tp_smbutil_013 fails after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
and: (fix ref leaks)
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/common/sys/dirent.h
          +++ new/usr/src/uts/common/sys/dirent.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  
  24   24  
  25   25  /*
  26   26   * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  27   27   *
  28   28   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  29   29   * Use is subject to license terms.
  30   30   */
  31   31  
  32   32  #ifndef _SYS_DIRENT_H
  33   33  #define _SYS_DIRENT_H
  34   34  
  35   35  #include <sys/feature_tests.h>
  36   36  
  37   37  #ifdef  __cplusplus
  38   38  extern "C" {
  39   39  #endif
  40   40  
  41   41  /*
  42   42   * File-system independent directory entry.
  43   43   */
  44   44  typedef struct dirent {
  45   45          ino_t           d_ino;          /* "inode number" of entry */
  46   46          off_t           d_off;          /* offset of disk directory entry */
  47   47          unsigned short  d_reclen;       /* length of this record */
  48   48          char            d_name[1];      /* name of file */
  49   49  } dirent_t;
  50   50  
  51   51  #if defined(_SYSCALL32)
  52   52  
  53   53  /* kernel's view of user ILP32 dirent */
  54   54  
  55   55  typedef struct dirent32 {
  56   56          ino32_t         d_ino;          /* "inode number" of entry */
  57   57          off32_t         d_off;          /* offset of disk directory entry */
  58   58          uint16_t        d_reclen;       /* length of this record */
  59   59          char            d_name[1];      /* name of file */
  60   60  } dirent32_t;
  61   61  
  62   62  #endif  /* _SYSCALL32 */
  63   63  
  64   64  #ifdef  _LARGEFILE64_SOURCE
  65   65  
  66   66  /*
  67   67   * transitional large file interface version AND kernel internal version
  68   68   */
  
    | 
      ↓ open down ↓ | 
    68 lines elided | 
    
      ↑ open up ↑ | 
  
  69   69  typedef struct dirent64 {
  70   70          ino64_t         d_ino;          /* "inode number" of entry */
  71   71          off64_t         d_off;          /* offset of disk directory entry */
  72   72          unsigned short  d_reclen;       /* length of this record */
  73   73          char            d_name[1];      /* name of file */
  74   74  } dirent64_t;
  75   75  
  76   76  #endif  /* _LARGEFILE64_SOURCE */
  77   77  
  78   78  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  79      -#if defined(_KERNEL)
       79 +#if defined(_KERNEL) || defined(_FAKE_KERNEL)
  80   80  #define DIRENT64_RECLEN(namelen)        \
  81   81          ((offsetof(dirent64_t, d_name[0]) + 1 + (namelen) + 7) & ~ 7)
  82   82  #define DIRENT64_NAMELEN(reclen)        \
  83   83          ((reclen) - (offsetof(dirent64_t, d_name[0])))
  84   84  #define DIRENT32_RECLEN(namelen)        \
  85   85          ((offsetof(dirent32_t, d_name[0]) + 1 + (namelen) + 3) & ~ 3)
  86   86  #define DIRENT32_NAMELEN(reclen)        \
  87   87          ((reclen) - (offsetof(dirent32_t, d_name[0])))
  88   88  #endif
  89   89  
  90   90  /*
  91   91   * This is the maximum number of bytes that getdents(2) will store in
  92   92   * user-supplied dirent buffers.
  93   93   */
  94   94  #define MAXGETDENTS_SIZE        (64 * 1024)
  95   95  
  96   96  #if !defined(_KERNEL)
  97   97  
  98   98  /*
  99   99   * large file compilation environment setup
 100  100   *
 101  101   * In the LP64 compilation environment, map large file interfaces
 102  102   * back to native versions where possible. (This only works because
 103  103   * a 'struct dirent' == 'struct dirent64').
 104  104   */
 105  105  
 106  106  #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
 107  107  #ifdef  __PRAGMA_REDEFINE_EXTNAME
 108  108  #pragma redefine_extname        getdents        getdents64
 109  109  #else
 110  110  #define getdents                getdents64
 111  111  #endif
 112  112  #endif  /* !_LP64 && _FILE_OFFSET_BITS == 64 */
 113  113  
 114  114  #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
 115  115  #ifdef  __PRAGMA_REDEFINE_EXTNAME
 116  116  #pragma redefine_extname        getdents64      getdents
 117  117  #else
 118  118  #define getdents64              getdents
 119  119  #define dirent64                dirent
 120  120  #define dirent64_t              dirent_t
 121  121  #endif
 122  122  #endif  /* _LP64 && _LARGEFILE64_SOURCE */
 123  123  
 124  124  extern int getdents(int, struct dirent *, size_t);
 125  125  
 126  126  /* N.B.: transitional large file interface version deliberately not provided */
 127  127  
 128  128  #endif /* !defined(_KERNEL) */
 129  129  #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 130  130  
 131  131  #ifdef  __cplusplus
 132  132  }
 133  133  #endif
 134  134  
 135  135  #endif  /* _SYS_DIRENT_H */
  
    | 
      ↓ open down ↓ | 
    46 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX