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  /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
  30   32  
  31   33  #ifndef _UNISTD_H
  32   34  #define _UNISTD_H
↓ open down ↓ 310 lines elided ↑ open up ↑
 343  345  extern gid_t getgid(void);
 344  346  extern int getgroups(int, gid_t *);
 345  347  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 346  348  extern long gethostid(void);
 347  349  #endif
 348  350  #if defined(_XPG4_2)
 349  351  extern int gethostname(char *, size_t);
 350  352  #elif  !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 351  353  extern int gethostname(char *, int);
 352  354  #endif
      355 +
      356 +#ifndef __GETLOGIN_DEFINED      /* Avoid duplicate in stdlib.h */
      357 +#define __GETLOGIN_DEFINED
      358 +#ifndef __USE_LEGACY_LOGNAME__
      359 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
      360 +#pragma redefine_extname getlogin getloginx
      361 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      362 +extern char *getloginx(void);
      363 +#define getlogin        getloginx
      364 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      365 +#endif  /* __USE_LEGACY_LOGNAME__ */
 353  366  extern char *getlogin(void);
      367 +#endif  /* __GETLOGIN_DEFINED */
      368 +
 354  369  #if defined(_XPG4) || defined(__EXTENSIONS__)
 355  370  extern int  getopt(int, char *const *, const char *);
 356  371  extern char *optarg;
 357  372  extern int  opterr, optind, optopt;
 358  373  /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
 359  374  #if !defined(_XPG6) || defined(__EXTENSIONS__)
 360  375  extern char *getpass(const char *);
 361  376  #endif
 362  377  #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
 363  378  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
↓ open down ↓ 310 lines elided ↑ open up ↑
 674  689  extern gid_t getegid();
 675  690  extern uid_t geteuid();
 676  691  extern gid_t getgid();
 677  692  extern int getgroups();
 678  693  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 679  694  extern long gethostid();
 680  695  #endif
 681  696  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 682  697  extern int gethostname();
 683  698  #endif
      699 +
      700 +#ifndef __GETLOGIN_DEFINED      /* Avoid duplicate in stdlib.h */
      701 +#define __GETLOGIN_DEFINED
      702 +#ifndef __USE_LEGACY_LOGNAME__
      703 +#ifdef __PRAGMA_REDEFINE_EXTNAME
      704 +#pragma redefine_extname getlogin       getloginx
      705 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      706 +extern char *getloginx();
      707 +#define getlogin        getloginx
      708 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      709 +#endif  /* __USE_LEGACY_LOGNAME__ */
 684  710  extern char *getlogin();
      711 +#endif  /* __GETLOGIN_DEFINED */
      712 +
 685  713  #if defined(_XPG4) || defined(__EXTENSIONS__)
 686  714  extern int  getopt();
 687  715  extern char *optarg;
 688  716  extern int  opterr, optind, optopt;
 689  717  #if !defined(_XPG6) || defined(__EXTENSIONS__)
 690  718  extern char *getpass();
 691  719  #endif
 692  720  #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
 693  721  #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 694  722  #if !defined(_XPG6) || defined(__EXTENSIONS__)
↓ open down ↓ 237 lines elided ↑ open up ↑
 932  960   */
 933  961  
 934  962  #if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
 935  963          !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 936  964          defined(_POSIX_PTHREAD_SEMANTICS)
 937  965  
 938  966  #if     defined(__STDC__)
 939  967  
 940  968  #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 941  969  
      970 +#ifndef __USE_LEGACY_LOGNAME__
      971 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
      972 +#pragma redefine_extname getlogin_r __posix_getloginx_r
      973 +extern int getlogin_r(char *, int);
      974 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
      975 +extern int __posix_getloginx_r(char *, int);
      976 +#define getlogin_r      __posix_getloginx_r
      977 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
      978 +#else   /* __USE_LEGACY_LOGNAME__ */
 942  979  #ifdef __PRAGMA_REDEFINE_EXTNAME
 943  980  #pragma redefine_extname getlogin_r __posix_getlogin_r
 944      -#pragma redefine_extname ttyname_r __posix_ttyname_r
 945  981  extern int getlogin_r(char *, int);
 946      -extern int ttyname_r(int, char *, size_t);
 947  982  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 948      -
 949  983  extern int __posix_getlogin_r(char *, int);
 950      -extern int __posix_ttyname_r(int, char *, size_t);
 951  984  
 952  985  #ifdef __lint
 953  986  
 954  987  #define getlogin_r      __posix_getlogin_r
 955      -#define ttyname_r       __posix_ttyname_r
 956  988  
 957  989  #else /* !__lint */
 958  990  
 959  991  static int
 960  992  getlogin_r(char *__name, int __len)
 961  993  {
 962  994          return (__posix_getlogin_r(__name, __len));
 963  995  }
      996 +
      997 +#endif /* !__lint */
      998 +#endif /* __PRAGMA_REDEFINE_EXTNAME */
      999 +#endif  /* __USE_LEGACY_LOGNAME__ */
     1000 +
     1001 +#ifdef __PRAGMA_REDEFINE_EXTNAME
     1002 +#pragma redefine_extname ttyname_r __posix_ttyname_r
     1003 +extern int ttyname_r(int, char *, size_t);
     1004 +#else  /* __PRAGMA_REDEFINE_EXTNAME */
     1005 +extern int __posix_ttyname_r(int, char *, size_t);
     1006 +
     1007 +#ifdef __lint
     1008 +
     1009 +#define ttyname_r       __posix_ttyname_r
     1010 +
     1011 +#else /* !__lint */
     1012 +
 964 1013  static int
 965 1014  ttyname_r(int __fildes, char *__buf, size_t __size)
 966 1015  {
 967 1016          return (__posix_ttyname_r(__fildes, __buf, __size));
 968 1017  }
 969 1018  
 970 1019  #endif /* !__lint */
 971 1020  #endif /* __PRAGMA_REDEFINE_EXTNAME */
 972 1021  
 973 1022  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 974 1023  
     1024 +#ifndef __USE_LEGACY_LOGNAME__
     1025 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
     1026 +#pragma redefine_extname getlogin_r getloginx_r
     1027 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1028 +extern char *getloginx_r(char *, int);
     1029 +#define getlogin_r      getloginx_r
     1030 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1031 +#endif  /* __USE_LEGACY_LOGNAME__ */
 975 1032  extern char *getlogin_r(char *, int);
     1033 +
 976 1034  extern char *ttyname_r(int, char *, int);
 977 1035  
 978 1036  #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 979 1037  
 980 1038  #else  /* __STDC__ */
 981 1039  
 982 1040  #if (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 983 1041  
     1042 +#ifndef __USE_LEGACY_LOGNAME__
     1043 +#ifdef  __PRAGMA_REDEFINE_EXTNAME
     1044 +#pragma redefine_extname getlogin_r __posix_getloginx_r
     1045 +extern int getlogin_r();
     1046 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1047 +extern int __posix_getloginx_r();
     1048 +#define getlogin_r      __posix_getloginx_r
     1049 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1050 +#else   /* __USE_LEGACY_LOGNAME__ */
 984 1051  #ifdef __PRAGMA_REDEFINE_EXTNAME
 985 1052  #pragma redefine_extname getlogin_r __posix_getlogin_r
 986      -#pragma redefine_extname ttyname_r __posix_ttyname_r
 987 1053  extern int getlogin_r();
 988      -extern int ttyname_r();
 989 1054  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 990      -
 991 1055  extern int __posix_getlogin_r();
 992      -extern int __posix_ttyname_r();
 993 1056  
 994 1057  #ifdef  __lint
 995 1058  
 996 1059  #define getlogin_r      __posix_getlogin_r
 997      -#define ttyname_r       __posix_ttyname_r
 998 1060  
 999 1061  #else /* !__lint */
1000 1062  
1001 1063  static int
1002 1064  getlogin_r(__name, __len)
1003 1065          char *__name;
1004 1066          int __len;
1005 1067  {
1006 1068          return (__posix_getlogin_r(__name, __len));
1007 1069  }
1008      -static int
     1070 +#endif /* !__lint */
     1071 +#endif /* __PRAGMA_REDEFINE_EXTNAME */
     1072 +#endif  /* __USE_LEGACY_LOGNAME__ */
     1073 +
     1074 +#ifdef __PRAGMA_REDEFINE_EXTNAME
     1075 +#pragma redefine_extname ttyname_r __posix_ttyname_r
     1076 +extern int ttyname_r();
     1077 +#else  /* __PRAGMA_REDEFINE_EXTNAME */
     1078 +
     1079 +extern int __posix_ttyname_r();
     1080 +
     1081 +#ifdef  __lint
     1082 +
     1083 +#define ttyname_r       __posix_ttyname_r
     1084 +
     1085 +#else /* !__lint */
     1086 +
1009 1087  ttyname_r(__fildes, __buf, __size)
1010 1088          int __fildes;
1011 1089          char *__buf;
1012 1090          size_t __size;
1013 1091  {
1014 1092          return (__posix_ttyname_r(__fildes, __buf, __size));
1015 1093  }
1016 1094  #endif /* !__lint */
1017 1095  #endif /* __PRAGMA_REDEFINE_EXTNAME */
1018 1096  
1019 1097  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1020 1098  
     1099 +#ifndef __USE_LEGACY_LOGNAME__
     1100 +#ifdef __PRAGMA_REDEFINE_EXTNAME
     1101 +#pragma redefine_extname getlogin_r     getloginx_r
     1102 +#else   /* __PRAGMA_REDEFINE_EXTNAME */
     1103 +extern char *getloginx_r();
     1104 +#define getlogin_r      getloginx_r
     1105 +#endif  /* __PRAGMA_REDEFINE_EXTNAME */
     1106 +#endif  /* __USE_LEGACY_LOGNAME__ */
1021 1107  extern char *getlogin_r();
     1108 +
1022 1109  extern char *ttyname_r();
1023 1110  
1024 1111  #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
1025 1112  
1026 1113  #endif /* __STDC__ */
1027 1114  
1028 1115  #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
1029 1116  
1030 1117  #ifdef  __cplusplus
1031 1118  }
1032 1119  #endif
1033 1120  
1034 1121  #endif /* _UNISTD_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX