Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars

Split Close
Expand all
Collapse all
          --- old/usr/src/head/unistd.h
          +++ new/usr/src/head/unistd.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  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  
  22   22  /*
       23 + * Copyright (c) 2013 Gary Mills
       24 + *
  23   25   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   26   */
  25   27  
  26   28  /*      Copyright (c) 1988 AT&T */
  27   29  /*        All Rights Reserved   */
  28   30  
  29   31  #ifndef _UNISTD_H
  30   32  #define _UNISTD_H
  31   33  
  32   34  #include <sys/feature_tests.h>
↓ open down ↓ 307 lines elided ↑ open up ↑
 340  342  extern gid_t getgid(void);
 341  343  extern int getgroups(int, gid_t *);
 342  344  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 343  345  extern long gethostid(void);
 344  346  #endif
 345  347  #if defined(_XPG4_2)
 346  348  extern int gethostname(char *, size_t);
 347  349  #elif  !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 348  350  extern int gethostname(char *, int);
 349  351  #endif
      352 +
      353 +#ifndef __GETLOGIN_DEFINED      /* Avoid duplicate in stdlib.h */
      354 +#define __GETLOGIN_DEFINED
      355 +#ifndef __USE_LEGACY_LOGNAME__
      356 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
      357 +#pragma redefine_extname getlogin getloginx
      358 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      359 +extern char *getloginx(void);
      360 +#define getlogin        getloginx
      361 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      362 +#endif  /* __USE_LEGACY_LOGNAME__ */
 350  363  extern char *getlogin(void);
      364 +#endif  /* __GETLOGIN_DEFINED */
      365 +
 351  366  #if defined(_XPG4) || defined(__EXTENSIONS__)
 352  367  extern int  getopt(int, char *const *, const char *);
 353  368  extern char *optarg;
 354  369  extern int  opterr, optind, optopt;
 355  370  /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
 356  371  #if !defined(_XPG6) || defined(__EXTENSIONS__)
 357  372  extern char *getpass(const char *);
 358  373  #endif
 359  374  #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
 360  375  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
↓ open down ↓ 300 lines elided ↑ open up ↑
 661  676  extern gid_t getegid();
 662  677  extern uid_t geteuid();
 663  678  extern gid_t getgid();
 664  679  extern int getgroups();
 665  680  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 666  681  extern long gethostid();
 667  682  #endif
 668  683  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 669  684  extern int gethostname();
 670  685  #endif
      686 +
      687 +#ifndef __GETLOGIN_DEFINED      /* Avoid duplicate in stdlib.h */
      688 +#define __GETLOGIN_DEFINED
      689 +#ifndef __USE_LEGACY_LOGNAME__
      690 +#ifdef __PRAGMA_REDEFINE_EXTNAME
      691 +#pragma redefine_extname getlogin       getloginx
      692 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      693 +extern char *getloginx();
      694 +#define getlogin        getloginx
      695 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      696 +#endif  /* __USE_LEGACY_LOGNAME__ */
 671  697  extern char *getlogin();
      698 +#endif  /* __GETLOGIN_DEFINED */
      699 +
 672  700  #if defined(_XPG4) || defined(__EXTENSIONS__)
 673  701  extern int  getopt();
 674  702  extern char *optarg;
 675  703  extern int  opterr, optind, optopt;
 676  704  #if !defined(_XPG6) || defined(__EXTENSIONS__)
 677  705  extern char *getpass();
 678  706  #endif
 679  707  #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
 680  708  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 681  709  #if !defined(_XPG6) || defined(__EXTENSIONS__)
↓ open down ↓ 237 lines elided ↑ open up ↑
 919  947   */
 920  948  
 921  949  #if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
 922  950          !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 923  951          defined(_POSIX_PTHREAD_SEMANTICS)
 924  952  
 925  953  #if     defined(__STDC__)
 926  954  
 927  955  #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 928  956  
      957 +#ifndef __USE_LEGACY_LOGNAME__
      958 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
      959 +#pragma redefine_extname getlogin_r __posix_getloginx_r
      960 +extern int getlogin_r(char *, int);
      961 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      962 +extern int __posix_getloginx_r(char *, int);
      963 +#define getlogin_r      __posix_getloginx_r
      964 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      965 +#else   /* __USE_LEGACY_LOGNAME__ */
 929  966  #ifdef __PRAGMA_REDEFINE_EXTNAME
 930  967  #pragma redefine_extname getlogin_r __posix_getlogin_r
 931      -#pragma redefine_extname ttyname_r __posix_ttyname_r
 932  968  extern int getlogin_r(char *, int);
 933      -extern int ttyname_r(int, char *, size_t);
 934  969  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 935      -
 936  970  extern int __posix_getlogin_r(char *, int);
 937      -extern int __posix_ttyname_r(int, char *, size_t);
 938  971  
 939  972  #ifdef __lint
 940  973  
 941  974  #define getlogin_r      __posix_getlogin_r
 942      -#define ttyname_r       __posix_ttyname_r
 943  975  
 944  976  #else /* !__lint */
 945  977  
 946  978  static int
 947  979  getlogin_r(char *__name, int __len)
 948  980  {
 949  981          return (__posix_getlogin_r(__name, __len));
 950  982  }
 951  983  static int
      984 +
      985 +#endif /* !__lint */
      986 +#endif /* __PRAGMA_REDEFINE_EXTNAME */
      987 +#endif  /* __USE_LEGACY_LOGNAME__ */
      988 +
      989 +#ifdef __PRAGMA_REDEFINE_EXTNAME
      990 +#pragma redefine_extname ttyname_r __posix_ttyname_r
      991 +extern int ttyname_r(int, char *, size_t);
      992 +#else  /* __PRAGMA_REDEFINE_EXTNAME */
      993 +extern int __posix_ttyname_r(int, char *, size_t);
      994 +
      995 +#ifdef __lint
      996 +
      997 +#define ttyname_r       __posix_ttyname_r
      998 +
      999 +#else /* !__lint */
     1000 +
     1001 +static int
 952 1002  ttyname_r(int __fildes, char *__buf, size_t __size)
 953 1003  {
 954 1004          return (__posix_ttyname_r(__fildes, __buf, __size));
 955 1005  }
 956 1006  
 957 1007  #endif /* !__lint */
 958 1008  #endif /* __PRAGMA_REDEFINE_EXTNAME */
 959 1009  
 960 1010  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 961 1011  
     1012 +#ifndef __USE_LEGACY_LOGNAME__
     1013 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
     1014 +#pragma redefine_extname getlogin_r getloginx_r
     1015 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1016 +extern char *getloginx_r(char *, int);
     1017 +#define getlogin_r      getloginx_r
     1018 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1019 +#endif  /* __USE_LEGACY_LOGNAME__ */
 962 1020  extern char *getlogin_r(char *, int);
     1021 +
 963 1022  extern char *ttyname_r(int, char *, int);
 964 1023  
 965 1024  #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 966 1025  
 967 1026  #else  /* __STDC__ */
 968 1027  
 969 1028  #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 970 1029  
     1030 +#ifndef __USE_LEGACY_LOGNAME__
     1031 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
     1032 +#pragma redefine_extname getlogin_r __posix_getloginx_r
     1033 +extern int getlogin_r();
     1034 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1035 +extern int __posix_getloginx_r();
     1036 +#define getlogin_r      __posix_getloginx_r
     1037 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1038 +#else   /* __USE_LEGACY_LOGNAME__ */
 971 1039  #ifdef __PRAGMA_REDEFINE_EXTNAME
 972 1040  #pragma redefine_extname getlogin_r __posix_getlogin_r
 973      -#pragma redefine_extname ttyname_r __posix_ttyname_r
 974 1041  extern int getlogin_r();
 975      -extern int ttyname_r();
 976 1042  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 977      -
 978 1043  extern int __posix_getlogin_r();
 979      -extern int __posix_ttyname_r();
 980 1044  
 981 1045  #ifdef  __lint
 982 1046  
 983 1047  #define getlogin_r      __posix_getlogin_r
 984      -#define ttyname_r       __posix_ttyname_r
 985 1048  
 986 1049  #else /* !__lint */
 987 1050  
 988 1051  static int
 989 1052  getlogin_r(__name, __len)
 990 1053          char *__name;
 991 1054          int __len;
 992 1055  {
 993 1056          return (__posix_getlogin_r(__name, __len));
 994 1057  }
 995      -static int
     1058 +#endif /* !__lint */
     1059 +#endif /* __PRAGMA_REDEFINE_EXTNAME */
     1060 +#endif  /* __USE_LEGACY_LOGNAME__ */
     1061 +
     1062 +#ifdef __PRAGMA_REDEFINE_EXTNAME
     1063 +#pragma redefine_extname ttyname_r __posix_ttyname_r
     1064 +extern int ttyname_r();
     1065 +#else  /* __PRAGMA_REDEFINE_EXTNAME */
     1066 +
     1067 +extern int __posix_ttyname_r();
     1068 +
     1069 +#ifdef  __lint
     1070 +
     1071 +#define ttyname_r       __posix_ttyname_r
     1072 +
     1073 +#else /* !__lint */
     1074 +
 996 1075  ttyname_r(__fildes, __buf, __size)
 997 1076          int __fildes;
 998 1077          char *__buf;
 999 1078          size_t __size;
1000 1079  {
1001 1080          return (__posix_ttyname_r(__fildes, __buf, __size));
1002 1081  }
1003 1082  #endif /* !__lint */
1004 1083  #endif /* __PRAGMA_REDEFINE_EXTNAME */
1005 1084  
1006 1085  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1007 1086  
     1087 +#ifndef __USE_LEGACY_LOGNAME__
     1088 +#ifdef __PRAGMA_REDEFINE_EXTNAME
     1089 +#pragma redefine_extname getlogin_r     getloginx_r
     1090 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1091 +extern char *getloginx_r();
     1092 +#define getlogin_r      getloginx_r
     1093 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1094 +#endif  /* __USE_LEGACY_LOGNAME__ */
1008 1095  extern char *getlogin_r();
     1096 +
1009 1097  extern char *ttyname_r();
1010 1098  
1011 1099  #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1012 1100  
1013 1101  #endif /* __STDC__ */
1014 1102  
1015 1103  #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
1016 1104  
1017 1105  #ifdef  __cplusplus
1018 1106  }
1019 1107  #endif
1020 1108  
1021 1109  #endif /* _UNISTD_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX