Print this page
5187 missing functions in stdlib.h : mkostemp, mkostemps & mkdtemp
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/head/stdlib.h
          +++ new/usr/src/head/stdlib.h
↓ open down ↓ 86 lines elided ↑ open up ↑
  87   87  #define _UID_T
  88   88  typedef unsigned int    uid_t;          /* UID type             */
  89   89  #endif  /* !_UID_T */
  90   90  
  91   91  /* large file compilation environment setup */
  92   92  #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
  93   93  
  94   94  #ifdef  __PRAGMA_REDEFINE_EXTNAME
  95   95  #pragma redefine_extname        mkstemp         mkstemp64
  96   96  #pragma redefine_extname        mkstemps        mkstemps64
       97 +#pragma redefine_extname        mkostemp        mkostemp64
       98 +#pragma redefine_extname        mkostemps       mkostemps64
  97   99  #else   /* __PRAGMA_REDEFINE_EXTNAME */
  98  100  #define mkstemp                 mkstemp64
  99  101  #define mkstemps                mkstemps64
      102 +#define mkostemp                mkostemp64
      103 +#define mkostemps               mkostemps64
 100  104  #endif  /* __PRAGMA_REDEFINE_EXTNAME */
 101  105  
 102  106  #endif  /* _FILE_OFFSET_BITS == 64 */
 103  107  
 104  108  /* In the LP64 compilation environment, all APIs are already large file */
 105  109  #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
 106  110  
 107  111  #ifdef  __PRAGMA_REDEFINE_EXTNAME
 108  112  #pragma redefine_extname        mkstemp64       mkstemp
 109  113  #pragma redefine_extname        mkstemps64      mkstemps
      114 +#pragma redefine_extname        mkostemp64      mkostemp
      115 +#pragma redefine_extname        mkostemps64     mkostemps
 110  116  #else   /* __PRAGMA_REDEFINE_EXTNAME */
 111  117  #define mkstemp64               mkstemp
 112  118  #define mkstemps64              mkstemps
      119 +#define mkostemp64              mkostemp
      120 +#define mkostemps64             mkostemps
 113  121  #endif  /* __PRAGMA_REDEFINE_EXTNAME */
 114  122  
 115  123  #endif  /* _LP64 && _LARGEFILE64_SOURCE */
 116  124  
 117  125  #if defined(__EXTENSIONS__) || \
 118  126          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 119  127          (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
 120  128  extern int rand_r(unsigned int *);
 121  129  #endif
 122  130  
↓ open down ↓ 47 lines elided ↑ open up ↑
 170  178  #endif
 171  179  #endif /* defined(__EXTENSIONS__) ... */
 172  180  
 173  181  #if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 174  182              !defined(__PRAGMA_REDEFINE_EXTNAME))
 175  183  extern int      mkstemp64(char *);
 176  184  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 177  185  extern int      mkstemps64(char *, int);
 178  186  #endif
 179  187  #endif  /* _LARGEFILE64_SOURCE... */
      188 +
      189 +#if !defined(_STRICT_SYMBOLS) || defined(_XPG7)
      190 +extern char     *mkdtemp(char *);
      191 +#endif  /* !defined(_STRICT_SYMBOLS) || defined(_XPG7) */
      192 +
      193 +#if !defined(_STRICT_SYMBOLS)
      194 +extern int              mkostemp(char *, int);
      195 +extern int              mkostemps(char *, int, int);
      196 +#if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
      197 +                !defined(__PRAGMA_REDEFINE_EXTNAME))
      198 +extern int              mkostemp64(char *, int);
      199 +extern int              mkostemps64(char *, int, int);
      200 +#endif  /* defined(_LARGEFILE64_SOURCE) || !((_FILE_OFFSET_BITS == 64) ... */
      201 +#endif  /* !defined(_STRICT_SYMBOLS) */
 180  202  
 181  203  #if defined(__EXTENSIONS__) || \
 182  204          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 183  205          defined(_XPG4_2)
 184  206  extern long a64l(const char *);
 185  207  extern char *ecvt(double, int, int *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 186  208  extern char *fcvt(double, int, int *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 187  209  extern char *gcvt(double, int, char *);
 188  210  extern int getsubopt(char **, char *const *, char **);
 189  211  extern int  grantpt(int);
↓ open down ↓ 89 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX