Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/pwd.h
          +++ new/usr/src/head/pwd.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*      Copyright (c) 1988 AT&T */
  23   23  /*        All Rights Reserved   */
  24   24  
  25   25  
  26   26  /*
       27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       28 + *
  27   29   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28   30   * Use is subject to license terms.
  29   31   */
  30   32  
  31   33  #ifndef _PWD_H
  32   34  #define _PWD_H
  33   35  
  34      -#pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.3.1.9 */
  35      -
  36   36  #include <sys/feature_tests.h>
  37   37  
  38   38  #include <sys/types.h>
  39   39  
  40   40  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  41   41  #include <stdio.h>
  42   42  #endif
  43   43  
  44   44  #ifdef  __cplusplus
  45   45  extern "C" {
↓ open down ↓ 13 lines elided ↑ open up ↑
  59   59  
  60   60  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  61   61  struct comment {
  62   62          char    *c_dept;
  63   63          char    *c_name;
  64   64          char    *c_acct;
  65   65          char    *c_bin;
  66   66  };
  67   67  #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
  68   68  
  69      -#if defined(__STDC__)
  70      -
  71   69  extern struct passwd *getpwuid(uid_t);          /* MT-unsafe */
  72   70  extern struct passwd *getpwnam(const char *);   /* MT-unsafe */
  73   71  
  74   72  #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  75   73  extern struct passwd *getpwent_r(struct passwd *, char *, int);
  76   74  extern struct passwd *fgetpwent_r(FILE *, struct passwd *, char *, int);
  77   75  extern struct passwd *fgetpwent(FILE *);        /* MT-unsafe */
  78   76  extern int putpwent(const struct passwd *, FILE *);
  79   77  #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
  80   78  
  81   79  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
  82   80          defined(__EXTENSIONS__)
  83   81  extern void endpwent(void);
  84   82  extern struct passwd *getpwent(void);           /* MT-unsafe */
  85   83  extern void setpwent(void);
  86   84  #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) ... */
  87   85  
  88      -#else  /* (__STDC__) */
  89      -
  90      -extern struct passwd *getpwuid();               /* MT-unsafe */
  91      -extern struct passwd *getpwnam();               /* MT-unsafe */
  92      -
  93      -#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  94      -extern struct passwd *getpwent_r();
  95      -extern struct passwd *fgetpwent_r();
  96      -
  97      -extern struct passwd *fgetpwent();              /* MT-unsafe */
  98      -extern int putpwent();
  99      -#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 100      -
 101      -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
 102      -        defined(__EXTENSIONS__)
 103      -extern void endpwent();
 104      -extern struct passwd *getpwent();               /* MT-unsafe */
 105      -extern void setpwent();
 106      -#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) ... */
 107      -
 108      -#endif /* (__STDC__) */
 109      -
 110   86  /*
 111   87   * getpwuid_r() & getpwnam_r() prototypes are defined here.
 112   88   */
 113   89  
 114   90  /*
 115   91   * Previous releases of Solaris, starting at 2.3, provided definitions of
 116   92   * various functions as specified in POSIX.1c, Draft 6.  For some of these
 117   93   * functions, the final POSIX 1003.1c standard had a different number of
 118   94   * arguments and return values.
 119   95   *
↓ open down ↓ 19 lines elided ↑ open up ↑
 139  115   * implementation.  Unfortunately, the statics confuse lint so we fallback to
 140  116   * #define in that case.
 141  117   *
 142  118   * NOTE: Support for the Draft 6 definitions is provided for compatibility
 143  119   * only.  New applications/libraries should use the standard definitions.
 144  120   */
 145  121  
 146  122  #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 147  123          defined(_POSIX_PTHREAD_SEMANTICS) || defined(__EXTENSIONS__)
 148  124  
 149      -#if defined(__STDC__)
 150      -
 151  125  #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 152  126  
 153  127  #ifdef __PRAGMA_REDEFINE_EXTNAME
 154  128  #pragma redefine_extname getpwuid_r __posix_getpwuid_r
 155  129  #pragma redefine_extname getpwnam_r __posix_getpwnam_r
 156  130  extern int getpwuid_r(uid_t, struct passwd *, char *, int, struct passwd **);
 157  131  extern int getpwnam_r(const char *, struct passwd *, char *,
 158  132                                                          int, struct passwd **);
 159  133  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 160  134  
↓ open down ↓ 25 lines elided ↑ open up ↑
 186  160  #endif /* !__lint */
 187  161  #endif /* __PRAGMA_REDEFINE_EXTNAME */
 188  162  
 189  163  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 190  164  
 191  165  extern struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
 192  166  extern struct passwd *getpwnam_r(const char *, struct passwd *, char *, int);
 193  167  
 194  168  #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 195  169  
 196      -#else  /* __STDC__ */
 197      -
 198      -#if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 199      -
 200      -#ifdef __PRAGMA_REDEFINE_EXTNAME
 201      -#pragma redefine_extname getpwuid_r __posix_getpwuid_r
 202      -#pragma redefine_extname getpwnam_r __posix_getpwnam_r
 203      -extern int getpwuid_r();
 204      -extern int getpwnam_r();
 205      -#else  /* __PRAGMA_REDEFINE_EXTNAME */
 206      -
 207      -extern int __posix_getpwuid_r();
 208      -extern int __posix_getpwnam_r();
 209      -
 210      -#ifdef  __lint
 211      -
 212      -#define getpwuid_r __posix_getpwuid_r
 213      -#define getpwnam_r __posix_getpwnam_r
 214      -
 215      -#else   /* !__lint */
 216      -
 217      -static int
 218      -getpwuid_r(__uid, __pwd, __buf, __len, __res)
 219      -        uid_t __uid;
 220      -        struct passwd *__pwd;
 221      -        char *__buf;
 222      -        int __len;
 223      -        struct passwd **__res;
 224      -{
 225      -        return (__posix_getpwuid_r(__uid, __pwd, __buf, __len, __res));
 226      -}
 227      -static int
 228      -getpwnam_r(__cb, __pwd, __buf, __len, __res)
 229      -        char *__cb;
 230      -        struct passwd *__pwd;
 231      -        char *__buf;
 232      -        int __len;
 233      -        struct passwd **__res;
 234      -{
 235      -        return (__posix_getpwnam_r(__cb, __pwd, __buf, __len, __res));
 236      -}
 237      -
 238      -#endif /* !__lint */
 239      -#endif /* __PRAGMA_REDEFINE_EXTNAME */
 240      -
 241      -#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 242      -
 243      -extern struct passwd *getpwuid_r();
 244      -extern struct passwd *getpwnam_r();
 245      -
 246      -#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 247      -
 248      -#endif /* __STDC__ */
 249      -
 250  170  #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L)... */
 251  171  
 252  172  #ifdef  __cplusplus
 253  173  }
 254  174  #endif
 255  175  
 256  176  #endif /* _PWD_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX