Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/grp.h
          +++ new/usr/src/head/grp.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 _GRP_H
  32   34  #define _GRP_H
  33   35  
  34      -#pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.3.3.1 */
  35      -
  36   36  #include <sys/feature_tests.h>
  37   37  
  38   38  #include <sys/types.h>
  39   39  
  40   40  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
  41   41  #include <stdio.h>
  42   42  #endif
  43   43  
  44   44  #ifdef  __cplusplus
  45   45  extern "C" {
  46   46  #endif
  47   47  
  48   48  struct  group { /* see getgrent(3C) */
  49   49          char    *gr_name;
  50   50          char    *gr_passwd;
  51   51          gid_t   gr_gid;
  52   52          char    **gr_mem;
  53   53  };
  54   54  
  55      -#if defined(__STDC__)
  56      -
  57   55  extern struct group *getgrgid(gid_t);           /* MT-unsafe */
  58   56  extern struct group *getgrnam(const char *);    /* MT-unsafe */
  59   57  
  60   58  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
  61   59  extern struct group *getgrent_r(struct group *, char *, int);
  62   60  extern struct group *fgetgrent_r(FILE *, struct group *, char *, int);
  63   61  
  64   62  
  65   63  extern struct group *fgetgrent(FILE *);         /* MT-unsafe */
  66   64  extern int initgroups(const char *, gid_t);
  67   65  #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
  68   66  
  69   67  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
  70   68  extern void endgrent(void);
  71   69  extern void setgrent(void);
  72   70  extern struct group *getgrent(void);            /* MT-unsafe */
  73   71  #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
  74   72  
  75      -#else
  76      -
  77      -extern struct group *getgrgid();                /* MT-unsafe */
  78      -extern struct group *getgrnam();                /* MT-unsafe */
  79      -
  80      -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
  81      -extern struct group *getgrent_r();
  82      -extern struct group *fgetgrent_r();
  83      -
  84      -extern struct group *fgetgrent();               /* MT-unsafe */
  85      -extern int initgroups();
  86      -#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
  87      -
  88      -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
  89      -extern void endgrent();
  90      -extern void setgrent();
  91      -extern struct group *getgrent();                /* MT-unsafe */
  92      -#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
  93      -
  94      -#endif  /* __STDC__ */
  95      -
  96      -
  97   73  /*
  98   74   * getgrgid_r() & getgrnam_r() prototypes are defined here.
  99   75   */
 100   76  
 101   77  /*
 102   78   * Previous releases of Solaris, starting at 2.3, provided definitions of
 103   79   * various functions as specified in POSIX.1c, Draft 6.  For some of these
 104   80   * functions, the final POSIX 1003.1c standard had a different number of
 105   81   * arguments and return values.
 106   82   *
↓ open down ↓ 19 lines elided ↑ open up ↑
 126  102   * implementation.  Unfortunately, the statics confuse lint so we fallback to
 127  103   * #define in that case.
 128  104   *
 129  105   * NOTE: Support for the Draft 6 definitions is provided for compatibility
 130  106   * only.  New applications/libraries should use the standard definitions.
 131  107   */
 132  108  
 133  109  #if     defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 134  110          (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 135  111  
 136      -#if     defined(__STDC__)
 137      -
 138  112  #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 139  113  
 140  114  #ifdef __PRAGMA_REDEFINE_EXTNAME
 141  115  #pragma redefine_extname getgrgid_r __posix_getgrgid_r
 142  116  #pragma redefine_extname getgrnam_r __posix_getgrnam_r
 143  117  extern int getgrgid_r(gid_t, struct group *, char *, int, struct group **);
 144  118  extern int getgrnam_r(const char *, struct group *, char *, int,
 145  119                                                          struct group **);
 146  120  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 147  121  
↓ open down ↓ 25 lines elided ↑ open up ↑
 173  147  #endif /* !__lint */
 174  148  #endif /* __PRAGMA_REDEFINE_EXTNAME */
 175  149  
 176  150  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 177  151  
 178  152  extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
 179  153  extern struct group *getgrnam_r(const char *, struct group *, char *, int);
 180  154  
 181  155  #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 182  156  
 183      -#else  /* __STDC__ */
 184      -
 185      -#if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 186      -
 187      -#ifdef __PRAGMA_REDEFINE_EXTNAME
 188      -#pragma redefine_extname getgrgid_r __posix_getgrgid_r
 189      -#pragma redefine_extname getgrnam_r __posix_getgrnam_r
 190      -extern int getgrgid_r();
 191      -extern int getgrnam_r();
 192      -#else  /* __PRAGMA_REDEFINE_EXTNAME */
 193      -
 194      -extern int __posix_getgrgid_r();
 195      -extern int __posix_getgrnam_r();
 196      -
 197      -#ifdef  __lint
 198      -
 199      -#define getgrgid_r __posix_getgrgid_r
 200      -#define getgrnam_r __posix_getgrnam_r
 201      -
 202      -#else   /* !__lint */
 203      -
 204      -static int
 205      -getgrgid_r(__gid, __grp, __buf, __len, __res)
 206      -        gid_t __gid;
 207      -        struct group *__grp;
 208      -        char *__buf;
 209      -        int __len;
 210      -        struct group **__res;
 211      -{
 212      -        return (__posix_getgrgid_r(__gid, __grp, __buf, __len, __res));
 213      -}
 214      -static int
 215      -getgrnam_r(__cb, __grp, __buf, __len, __res)
 216      -        char *__cb;
 217      -        struct group *__grp;
 218      -        char *__buf;
 219      -        int __len;
 220      -        struct group **__res;
 221      -{
 222      -        return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
 223      -}
 224      -
 225      -#endif /* !__lint */
 226      -#endif /* __PRAGMA_REDEFINE_EXTNAME */
 227      -
 228      -#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 229      -
 230      -extern struct group *getgrgid_r();
 231      -extern struct group *getgrnam_r();
 232      -
 233      -#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 234      -
 235      -#endif /* __STDC__ */
 236      -
 237  157  #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
 238  158  
 239  159  #ifdef  __cplusplus
 240  160  }
 241  161  #endif
 242  162  
 243  163  #endif  /* _GRP_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX