xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/core/sys/posix/stdlib.d (revision 0a3071956a3a9fdebdbf7f338cf2d439b45fc728)
1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Copyright Sean Kelly 2005 - 2009.
5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6  * Authors:   Sean Kelly
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 
10 /*          Copyright Sean Kelly 2005 - 2009.
11  * Distributed under the Boost Software License, Version 1.0.
12  *    (See accompanying file LICENSE or copy at
13  *          http://www.boost.org/LICENSE_1_0.txt)
14  */
15 module core.sys.posix.stdlib;
16 
17 import core.sys.posix.config;
18 public import core.stdc.stdlib;
19 public import core.sys.posix.sys.wait;
20 
21 version (OSX)
22     version = Darwin;
23 else version (iOS)
24     version = Darwin;
25 else version (TVOS)
26     version = Darwin;
27 else version (WatchOS)
28     version = Darwin;
29 
version(Posix)30 version (Posix):
31 extern (C):
32 nothrow:
33 @nogc:
34 @system:
35 
36 //
37 // Required (defined in core.stdc.stdlib)
38 //
39 /*
40 EXIT_FAILURE
41 EXIT_SUCCESS
42 NULL
43 RAND_MAX
44 MB_CUR_MAX
45 div_t
46 ldiv_t
47 lldiv_t
48 size_t
49 wchar_t
50 
51 void    _Exit(int);
52 void    abort();
53 int     abs(int);
54 int     atexit(void function());
55 double  atof(const scope char*);
56 int     atoi(const scope char*);
57 c_long  atol(const scope char*);
58 long    atoll(const scope char*);
59 void*   bsearch(const scope void*, const scope void*, size_t, size_t, int function(const scope void*, const scope void*));
60 void*   calloc(size_t, size_t);
61 div_t   div(int, int);
62 void    exit(int);
63 void    free(void*);
64 char*   getenv(const scope char*);
65 c_long  labs(c_long);
66 ldiv_t  ldiv(c_long, c_long);
67 long    llabs(long);
68 lldiv_t lldiv(long, long);
69 void*   malloc(size_t);
70 int     mblen(const scope char*, size_t);
71 size_t  mbstowcs(wchar_t*, const scope char*, size_t);
72 int     mbtowc(wchar_t*, const scope char*, size_t);
73 void    qsort(void*, size_t, size_t, int function(const scope void*, const scope void*));
74 int     rand();
75 void*   realloc(void*, size_t);
76 void    srand(uint);
77 double  strtod(const scope char*, char**);
78 float   strtof(const scope char*, char**);
79 c_long  strtol(const scope char*, char**, int);
80 real    strtold(const scope char*, char**);
81 long    strtoll(const scope char*, char**, int);
82 c_ulong strtoul(const scope char*, char**, int);
83 ulong   strtoull(const scope char*, char**, int);
84 int     system(const scope char*);
85 size_t  wcstombs(char*, const scope wchar_t*, size_t);
86 int     wctomb(char*, wchar_t);
87 */
88 
89 //
90 // Advisory Information (ADV)
91 //
92 /*
93 int posix_memalign(void**, size_t, size_t);
94 */
95 
96 version (CRuntime_Glibc)
97 {
98     int posix_memalign(void**, size_t, size_t);
99 }
version(FreeBSD)100 else version (FreeBSD)
101 {
102     int posix_memalign(void**, size_t, size_t);
103 }
version(NetBSD)104 else version (NetBSD)
105 {
106     int posix_memalign(void**, size_t, size_t);
107 }
version(OpenBSD)108 else version (OpenBSD)
109 {
110     int posix_memalign(void**, size_t, size_t);
111 }
version(DragonFlyBSD)112 else version (DragonFlyBSD)
113 {
114     int posix_memalign(void**, size_t, size_t);
115 }
version(Solaris)116 else version (Solaris)
117 {
118     int posix_memalign(void**, size_t, size_t);
119 }
version(Darwin)120 else version (Darwin)
121 {
122     int posix_memalign(void**, size_t, size_t);
123 }
version(CRuntime_Bionic)124 else version (CRuntime_Bionic)
125 {
126     // Added since Lollipop
127     int posix_memalign(void**, size_t, size_t);
128 }
version(CRuntime_Musl)129 else version (CRuntime_Musl)
130 {
131     int posix_memalign(void**, size_t, size_t);
132 }
version(CRuntime_UClibc)133 else version (CRuntime_UClibc)
134 {
135     int posix_memalign(void**, size_t, size_t);
136 }
137 
138 //
139 // C Extension (CX)
140 //
141 /*
142 int setenv(const scope char*, const scope char*, int);
143 int unsetenv(const scope char*);
144 */
145 
version(CRuntime_Glibc)146 version (CRuntime_Glibc)
147 {
148     int setenv(const scope char*, const scope char*, int);
149     int unsetenv(const scope char*);
150 
151     void* valloc(size_t); // LEGACY non-standard
152 }
version(Darwin)153 else version (Darwin)
154 {
155     int setenv(const scope char*, const scope char*, int);
156     int unsetenv(const scope char*);
157 
158     void* valloc(size_t); // LEGACY non-standard
159 }
version(FreeBSD)160 else version (FreeBSD)
161 {
162     int setenv(const scope char*, const scope char*, int);
163     int unsetenv(const scope char*);
164 
165     void* valloc(size_t); // LEGACY non-standard
166 }
version(NetBSD)167 else version (NetBSD)
168 {
169     int setenv(const scope char*, const scope char*, int);
170     int __unsetenv13(const scope char*);
171     alias __unsetenv13 unsetenv;
172     void* valloc(size_t); // LEGACY non-standard
173 }
version(OpenBSD)174 else version (OpenBSD)
175 {
176     int setenv(const scope char*, const scope char*, int);
177     int unsetenv(const scope char*);
178 
179     void* valloc(size_t); // LEGACY non-standard
180 }
version(DragonFlyBSD)181 else version (DragonFlyBSD)
182 {
183     int setenv(const scope char*, const scope char*, int);
184     int unsetenv(const scope char*);
185 
186     void* valloc(size_t); // LEGACY non-standard
187 }
version(CRuntime_Bionic)188 else version (CRuntime_Bionic)
189 {
190     int setenv(const scope char*, const scope char*, int);
191     int unsetenv(const scope char*);
192 
193     void* valloc(size_t);
194 }
version(Solaris)195 else version (Solaris)
196 {
197     int setenv(const scope char*, const scope char*, int);
198     int unsetenv(const scope char*);
199 
200     void* valloc(size_t); // LEGACY non-standard
201 }
version(CRuntime_Musl)202 else version (CRuntime_Musl)
203 {
204     int setenv(const scope char*, const scope char*, int);
205     int unsetenv(const scope char*);
206 }
version(CRuntime_UClibc)207 else version (CRuntime_UClibc)
208 {
209     int setenv(const scope char*, const scope char*, int);
210     int unsetenv(const scope char*);
211     void* valloc(size_t);
212 }
213 
214 //
215 // Thread-Safe Functions (TSF)
216 //
217 /*
218 int rand_r(uint*);
219 */
220 
version(CRuntime_Glibc)221 version (CRuntime_Glibc)
222 {
223     int rand_r(uint*);
224 }
version(Darwin)225 else version (Darwin)
226 {
227     int rand_r(uint*);
228 }
version(FreeBSD)229 else version (FreeBSD)
230 {
231     int rand_r(uint*);
232 }
version(NetBSD)233 else version (NetBSD)
234 {
235     int rand_r(uint*);
236 }
version(OpenBSD)237 else version (OpenBSD)
238 {
239     int rand_r(uint*);
240 }
version(DragonFlyBSD)241 else version (DragonFlyBSD)
242 {
243     int rand_r(uint*);
244 }
version(Solaris)245 else version (Solaris)
246 {
247     int rand_r(uint*);
248 }
version(CRuntime_UClibc)249 else version (CRuntime_UClibc)
250 {
251     int rand_r(uint*);
252 }
253 
254 //
255 // XOpen (XSI)
256 //
257 /*
258 WNOHANG     (defined in core.sys.posix.sys.wait)
259 WUNTRACED   (defined in core.sys.posix.sys.wait)
260 WEXITSTATUS (defined in core.sys.posix.sys.wait)
261 WIFEXITED   (defined in core.sys.posix.sys.wait)
262 WIFSIGNALED (defined in core.sys.posix.sys.wait)
263 WIFSTOPPED  (defined in core.sys.posix.sys.wait)
264 WSTOPSIG    (defined in core.sys.posix.sys.wait)
265 WTERMSIG    (defined in core.sys.posix.sys.wait)
266 
267 c_long a64l(const scope char*);
268 double drand48();
269 char*  ecvt(double, int, int *, int *); // LEGACY
270 double erand48(ref ushort[3]);
271 char*  fcvt(double, int, int *, int *); // LEGACY
272 char*  gcvt(double, int, char*); // LEGACY
273 // per spec: int getsubopt(char** char* const*, char**);
274 int    getsubopt(char**, const scope char**, char**);
275 int    grantpt(int);
276 char*  initstate(uint, char*, size_t);
277 c_long jrand48(ref ushort[3]);
278 char*  l64a(c_long);
279 void   lcong48(ref ushort[7]);
280 c_long lrand48();
281 char*  mktemp(char*); // LEGACY
282 int    mkstemp(char*);
283 int    mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
284 c_long mrand48();
285 c_long nrand48(ref ushort[3]);
286 int    posix_openpt(int);
287 char*  ptsname(int);
288 int    putenv(char*);
289 c_long random();
290 char*  realpath(const scope char*, char*);
291 ushort *seed48(ref ushort[3]);
292 void   setkey(const scope char*);
293 char*  setstate(const scope char*);
294 void   srand48(c_long);
295 void   srandom(uint);
296 int    unlockpt(int);
297 */
298 
version(CRuntime_Glibc)299 version (CRuntime_Glibc)
300 {
301     //WNOHANG     (defined in core.sys.posix.sys.wait)
302     //WUNTRACED   (defined in core.sys.posix.sys.wait)
303     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
304     //WIFEXITED   (defined in core.sys.posix.sys.wait)
305     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
306     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
307     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
308     //WTERMSIG    (defined in core.sys.posix.sys.wait)
309 
310     c_long a64l(const scope char*);
311     double drand48();
312     char*  ecvt(double, int, int *, int *); // LEGACY
313     double erand48(ref ushort[3]);
314     char*  fcvt(double, int, int *, int *); // LEGACY
315     char*  gcvt(double, int, char*); // LEGACY
316     int    getsubopt(char**, const scope char**, char**);
317     int    grantpt(int);
318     char*  initstate(uint, char*, size_t);
319     c_long jrand48(ref ushort[3]);
320     char*  l64a(c_long);
321     void   lcong48(ref ushort[7]);
322     c_long lrand48();
323     char*  mktemp(char*); // LEGACY
324     //int    mkstemp(char*);
325     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
326     c_long mrand48();
327     c_long nrand48(ref ushort[3]);
328     int    posix_openpt(int);
329     char*  ptsname(int);
330     int    putenv(char*);
331     c_long random();
332     char*  realpath(const scope char*, char*);
333     ushort *seed48(ref ushort[3]);
334     void   setkey(const scope char*);
335     char*  setstate(const scope char*);
336     void   srand48(c_long);
337     void   srandom(uint);
338     int    unlockpt(int);
339 
340   static if ( __USE_LARGEFILE64 )
341   {
342     int    mkstemp64(char*);
343     alias  mkstemp64 mkstemp;
344   }
345   else
346   {
347     int    mkstemp(char*);
348   }
349 }
version(Darwin)350 else version (Darwin)
351 {
352     //WNOHANG     (defined in core.sys.posix.sys.wait)
353     //WUNTRACED   (defined in core.sys.posix.sys.wait)
354     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
355     //WIFEXITED   (defined in core.sys.posix.sys.wait)
356     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
357     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
358     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
359     //WTERMSIG    (defined in core.sys.posix.sys.wait)
360 
361     c_long a64l(const scope char*);
362     double drand48();
363     char*  ecvt(double, int, int *, int *); // LEGACY
364     double erand48(ref ushort[3]);
365     char*  fcvt(double, int, int *, int *); // LEGACY
366     char*  gcvt(double, int, char*); // LEGACY
367     int    getsubopt(char**, const scope char**, char**);
368     int    grantpt(int);
369     char*  initstate(uint, char*, size_t);
370     c_long jrand48(ref ushort[3]);
371     char*  l64a(c_long);
372     void   lcong48(ref ushort[7]);
373     c_long lrand48();
374     char*  mktemp(char*); // LEGACY
375     int    mkstemp(char*);
376     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
377     c_long mrand48();
378     c_long nrand48(ref ushort[3]);
379     int    posix_openpt(int);
380     char*  ptsname(int);
381     int    putenv(char*);
382     c_long random();
383     char*  realpath(const scope char*, char*);
384     ushort *seed48(ref ushort[3]);
385     void   setkey(const scope char*);
386     char*  setstate(const scope char*);
387     void   srand48(c_long);
388     void   srandom(uint);
389     int    unlockpt(int);
390 }
version(FreeBSD)391 else version (FreeBSD)
392 {
393     //WNOHANG     (defined in core.sys.posix.sys.wait)
394     //WUNTRACED   (defined in core.sys.posix.sys.wait)
395     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
396     //WIFEXITED   (defined in core.sys.posix.sys.wait)
397     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
398     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
399     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
400     //WTERMSIG    (defined in core.sys.posix.sys.wait)
401 
402     c_long a64l(const scope char*);
403     double drand48();
404     //char*  ecvt(double, int, int *, int *); // LEGACY
405     double erand48(ref ushort[3]);
406     //char*  fcvt(double, int, int *, int *); // LEGACY
407     //char*  gcvt(double, int, char*); // LEGACY
408     int    getsubopt(char**, const scope char**, char**);
409     int    grantpt(int);
410     char*  initstate(uint, char*, size_t);
411     c_long jrand48(ref ushort[3]);
412     char*  l64a(c_long);
413     void   lcong48(ref ushort[7]);
414     c_long lrand48();
415     char*  mktemp(char*); // LEGACY
416     int    mkstemp(char*);
417     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
418     c_long mrand48();
419     c_long nrand48(ref ushort[3]);
420     int    posix_openpt(int);
421     char*  ptsname(int);
422     int    putenv(char*);
423     c_long random();
424     char*  realpath(const scope char*, char*);
425     ushort *seed48(ref ushort[3]);
426     void   setkey(const scope char*);
427     char*  setstate(const scope char*);
428     void   srand48(c_long);
429     void   srandom(uint);
430     int    unlockpt(int);
431 }
version(NetBSD)432 else version (NetBSD)
433 {
434     //WNOHANG     (defined in core.sys.posix.sys.wait)
435     //WUNTRACED   (defined in core.sys.posix.sys.wait)
436     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
437     //WIFEXITED   (defined in core.sys.posix.sys.wait)
438     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
439     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
440     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
441     //WTERMSIG    (defined in core.sys.posix.sys.wait)
442 
443     c_long a64l(const scope char*);
444     double drand48();
445     //char*  ecvt(double, int, int *, int *); // LEGACY
446     double erand48(ref ushort[3]);
447     //char*  fcvt(double, int, int *, int *); // LEGACY
448     //char*  gcvt(double, int, char*); // LEGACY
449     int    getsubopt(char**, const scope char**, char**);
450     int    grantpt(int);
451     char*  initstate(uint, char*, size_t);
452     c_long jrand48(ref ushort[3]);
453     char*  l64a(c_long);
454     void   lcong48(ref ushort[7]);
455     c_long lrand48();
456     char*  mktemp(char*); // LEGACY
457     int    mkstemp(char*);
458     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
459     c_long mrand48();
460     c_long nrand48(ref ushort[3]);
461     int    posix_openpt(int);
462     char*  ptsname(int);
463     int    putenv(char*);
464     c_long random();
465     char*  realpath(const scope char*, char*);
466     ushort *seed48(ref ushort[3]);
467     void   setkey(const scope char*);
468     char*  setstate(const scope char*);
469     void   srand48(c_long);
470     void   srandom(uint);
471     int    unlockpt(int);
472 }
version(OpenBSD)473 else version (OpenBSD)
474 {
475     //WNOHANG     (defined in core.sys.posix.sys.wait)
476     //WUNTRACED   (defined in core.sys.posix.sys.wait)
477     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
478     //WIFEXITED   (defined in core.sys.posix.sys.wait)
479     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
480     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
481     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
482     //WTERMSIG    (defined in core.sys.posix.sys.wait)
483 
484     c_long a64l(const scope char*);
485     double drand48();
486     //char*  ecvt(double, int, int *, int *); // LEGACY
487     double erand48(ref ushort[3]);
488     //char*  fcvt(double, int, int *, int *); // LEGACY
489     //char*  gcvt(double, int, char*); // LEGACY
490     int    getsubopt(char**, const scope char**, char**);
491     int    grantpt(int);
492     char*  initstate(uint, char*, size_t);
493     c_long jrand48(ref ushort[3]);
494     char*  l64a(c_long);
495     void   lcong48(ref ushort[7]);
496     c_long lrand48();
497     char*  mktemp(char*); // LEGACY
498     int    mkstemp(char*);
499     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
500     c_long mrand48();
501     c_long nrand48(ref ushort[3]);
502     int    posix_openpt(int);
503     char*  ptsname(int);
504     int    putenv(char*);
505     c_long random();
506     char*  realpath(const scope char*, char*);
507     ushort *seed48(ref ushort[3]);
508     // void   setkey(const scope char*); // not implemented
509     char*  setstate(const scope char*);
510     void   srand48(c_long);
511     void   srandom(uint);
512     int    unlockpt(int);
513 }
version(DragonFlyBSD)514 else version (DragonFlyBSD)
515 {
516     //WNOHANG     (defined in core.sys.posix.sys.wait)
517     //WUNTRACED   (defined in core.sys.posix.sys.wait)
518     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
519     //WIFEXITED   (defined in core.sys.posix.sys.wait)
520     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
521     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
522     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
523     //WTERMSIG    (defined in core.sys.posix.sys.wait)
524 
525     c_long a64l(const scope char*);
526     double drand48();
527     //char*  ecvt(double, int, int *, int *); // LEGACY
528     double erand48(ref ushort[3]);
529     //char*  fcvt(double, int, int *, int *); // LEGACY
530     //char*  gcvt(double, int, char*); // LEGACY
531     int    getsubopt(char**, const scope char**, char**);
532     int    grantpt(int);
533     char*  initstate(uint, char*, size_t);
534     c_long jrand48(ref ushort[3]);
535     char*  l64a(c_long);
536     void   lcong48(ref ushort[7]);
537     c_long lrand48();
538     char*  mktemp(char*); // LEGACY
539     int    mkstemp(char*);
540     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
541     c_long mrand48();
542     c_long nrand48(ref ushort[3]);
543     int    posix_openpt(int);
544     char*  ptsname(int);
545     int    putenv(char*);
546     c_long random();
547     char*  realpath(const scope char*, char*);
548     ushort *seed48(ref ushort[3]);
549     void   setkey(const scope char*);
550     char*  setstate(const scope char*);
551     void   srand48(c_long);
552     void   srandom(uint);
553     int    unlockpt(int);
554 }
version(CRuntime_Bionic)555 else version (CRuntime_Bionic)
556 {
557     double  drand48();
558     double  erand48(ref ushort[3]);
559     //int   grantpt(int); defined inline, but seems to do nothing in bionic
560     c_long  jrand48(ref ushort[3]);
561     c_long  lrand48();
562     char*   mktemp(char*); // LEGACY
563     int     mkstemp(char*);
564     char*   mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
565     c_long  mrand48();
566     c_long  nrand48(ref ushort[3]);
567     char*   ptsname(int);
568     int     putenv(const scope char*);
569     c_long  random() { return lrand48(); }
570     char*   realpath(const scope char*, char*);
571     ushort* seed48(ref ushort[3]);
572     void    srand48(c_long);
573     void    srandom(uint s) { srand48(s); }
574     int     unlockpt(int);
575 }
version(CRuntime_Musl)576 else version (CRuntime_Musl)
577 {
578     c_long a64l(const scope char*);
579     double drand48();
580     char*  ecvt(double, int, int *, int *); // LEGACY
581     double erand48(ref ushort[3]);
582     char*  fcvt(double, int, int *, int *); // LEGACY
583     char*  gcvt(double, int, char*); // LEGACY
584     int    getsubopt(char**, const scope char**, char**);
585     int    grantpt(int);
586     char*  initstate(uint, char*, size_t);
587     c_long jrand48(ref ushort[3]);
588     char*  l64a(c_long);
589     void   lcong48(ref ushort[7]);
590     c_long lrand48();
591     char*  mktemp(char*); // LEGACY
592     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
593     int    mkstemp(char*);
594     c_long mrand48();
595     c_long nrand48(ref ushort[3]);
596     int    posix_openpt(int);
597     char*  ptsname(int);
598     int    putenv(char*);
599     c_long random();
600     char*  realpath(const scope char*, char*);
601     ushort *seed48(ref ushort[3]);
602     void   setkey(const scope char*);
603     char*  setstate(const scope char*);
604     void   srand48(c_long);
605     void   srandom(uint);
606     int    unlockpt(int);
607 
608   static if ( __USE_LARGEFILE64 )
609   {
610     int    mkstemp64(char*);
611     alias  mkstemp64 mkstemp;
612   }
613   else
614   {
615     int    mkstemp(char*);
616   }
617 
618 }
version(Solaris)619 else version (Solaris)
620 {
621     //WNOHANG     (defined in core.sys.posix.sys.wait)
622     //WUNTRACED   (defined in core.sys.posix.sys.wait)
623     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
624     //WIFEXITED   (defined in core.sys.posix.sys.wait)
625     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
626     //WIFSTOPPED  (defined in core.sys.posix.sys.wait)
627     //WSTOPSIG    (defined in core.sys.posix.sys.wait)
628     //WTERMSIG    (defined in core.sys.posix.sys.wait)
629 
630     c_long a64l(const scope char*);
631     double drand48();
632     char*  ecvt(double, int, int *, int *); // LEGACY
633     double erand48(ref ushort[3]);
634     char*  fcvt(double, int, int *, int *); // LEGACY
635     char*  gcvt(double, int, char*); // LEGACY
636     int    getsubopt(char**, const scope char**, char**);
637     int    grantpt(int);
638     char*  initstate(uint, char*, size_t);
639     c_long jrand48(ref ushort[3]);
640     char*  l64a(c_long);
641     void   lcong48(ref ushort[7]);
642     c_long lrand48();
643     char*  mktemp(char*); // LEGACY
644     //int    mkstemp(char*);
645     char*  mkdtemp(char*); // Defined in IEEE 1003.1, 2008 Edition
646     c_long mrand48();
647     c_long nrand48(ref ushort[3]);
648     int    posix_openpt(int);
649     char*  ptsname(int);
650     int    putenv(char*);
651     c_long random();
652     char*  realpath(const scope char*, char*);
653     ushort *seed48(ref ushort[3]);
654     void   setkey(const scope char*);
655     char*  setstate(const scope char*);
656     void   srand48(c_long);
657     void   srandom(uint);
658     int    unlockpt(int);
659 
660     version (D_LP64)
661     {
662         int mkstemp(char*);
663 
664         static if ( __USE_LARGEFILE64 )
665             alias mkstemp mkstemp64;
666     }
667     else
668     {
669         int mkstemp64(char*);
670 
671         static if ( __USE_LARGEFILE64 )
672             alias mkstemp64 mkstemp;
673         else
674             int mkstemp(char*);
675     }
676 }
version(CRuntime_UClibc)677 else version (CRuntime_UClibc)
678 {
679     c_long a64l(const scope char*);
680     double drand48();
681     char*  ecvt(double, int, int *, int *);
682     double erand48(ref ushort[3]);
683     char*  fcvt(double, int, int *, int *);
684     char*  gcvt(double, int, char*);
685     int    getsubopt(char**, const scope char**, char**);
686     int    grantpt(int);
687     char*  initstate(uint, char*, size_t);
688     c_long jrand48(ref ushort[3]);
689     char*  l64a(c_long);
690     void   lcong48(ref ushort[7]);
691     c_long lrand48();
692     char*  mktemp(char*);
693     char*  mkdtemp(char*);
694     c_long mrand48();
695     c_long nrand48(ref ushort[3]);
696     int    posix_openpt(int);
697     char*  ptsname(int);
698     int    putenv(char*);
699     c_long random();
700     char*  realpath(const scope char*, char*);
701     ushort* seed48(ref ushort[3]);
702     void   setkey(const scope char*);
703     char*  setstate(const scope char*);
704     void   srand48(c_long);
705     void   srandom(uint);
706     int    unlockpt(int);
707 
708   static if ( __USE_LARGEFILE64 )
709   {
710     int    mkstemp64(char*);
711     alias  mkstemp64 mkstemp;
712   }
713   else
714   {
715     int    mkstemp(char*);
716   }
717 }
718