]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/stdlib.h
Add Socket Libraries.
[mirror_edk2.git] / StdLib / Include / stdlib.h
1 /** @file
2 The header <stdlib.h> declares five types and several functions of general
3 utility, and defines several macros.
4
5 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 #ifndef _STDLIB_H
16 #define _STDLIB_H
17 #include <sys/EfiCdefs.h>
18
19 #ifdef _EFI_SIZE_T_
20 typedef _EFI_SIZE_T_ size_t;
21 #undef _EFI_SIZE_T_
22 #undef _BSD_SIZE_T_
23 #endif
24
25 #ifndef __cplusplus
26 #ifdef _EFI_WCHAR_T
27 typedef _EFI_WCHAR_T wchar_t;
28 #undef _EFI_WCHAR_T
29 #undef _BSD_WCHAR_T_
30 #endif
31 #endif
32
33 /// A structure type that is the type of the value returned by the div function.
34 typedef struct {
35 int quot; /* quotient */
36 int rem; /* remainder */
37 } div_t;
38
39 /// A structure type that is the type of the value returned by the ldiv function.
40 typedef struct {
41 long quot;
42 long rem;
43 } ldiv_t;
44
45 /// A structure type that is the type of the value returned by the lldiv function.
46 typedef struct {
47 long long quot;
48 long long rem;
49 } lldiv_t;
50
51 /** Expand to integer constant expressions that can be used as the argument to
52 the exit function to return unsuccessful or successful termination status,
53 respectively, to the host environment.
54 **/
55 #define EXIT_FAILURE 1
56 #define EXIT_SUCCESS 0
57
58 /** Expands to an integer constant expression that is the maximum value
59 returned by the rand function.
60
61 The value of the RAND_MAX macro shall be at least 32767.
62 **/
63 #define RAND_MAX 0x7fffffff
64
65 /** Expands to a positive integer expression with type size_t that is the
66 maximum number of bytes in a multibyte character for the extended character
67 set specified by the current locale (category LC_CTYPE), which is never
68 greater than MB_LEN_MAX.
69 **/
70 #define MB_CUR_MAX 2
71
72 /** Maximum number of functions that can be registered by atexit.
73
74 The C standard states that the implementation shall support the
75 registration of at least 32 functions.
76 **/
77 #define ATEXIT_MAX 32
78
79 __BEGIN_DECLS
80
81 /* ################ Communication with the environment ################## */
82
83 /** The abort function causes abnormal program termination to occur, unless
84 the signal SIGABRT is being caught and the signal handler does not return.
85
86 Open streams with unwritten buffered data are not flushed, open
87 streams are not closed, and temporary files are not removed by abort.
88
89 Unsuccessful termination is returned to the host environment by means of
90 the function call, raise(SIGABRT).
91
92 @sa signal.h
93 **/
94 void abort(void) __noreturn;
95
96 /** The atexit function registers the function pointed to by func, to be
97 called without arguments at normal program termination.
98
99 The implementation supports the registration of up to 32 functions.
100
101 @return The atexit function returns zero if the registration succeeds,
102 nonzero if it fails.
103 **/
104 int atexit(void (*)(void));
105
106 /** The exit function causes normal program termination to occur. If more than
107 one call to the exit function is executed by a program,
108 the behavior is undefined.
109
110 First, all functions registered by the atexit function are called, in the
111 reverse order of their registration, except that a function is called
112 after any previously registered functions that had already been called at
113 the time it was registered. If, during the call to any such function, a
114 call to the longjmp function is made that would terminate the call to the
115 registered function, the behavior is undefined.
116
117 Next, all open streams with unwritten buffered data are flushed, all open
118 streams are closed, and all files created by the tmpfile function
119 are removed.
120
121 Finally, control is returned to the host environment. If the value of
122 status is zero, or EXIT_SUCCESS, status is returned unchanged. If the value
123 of status is EXIT_FAILURE, EAPPLICATION is returned.
124 Otherwise, status is returned unchanged.
125
126 While this function does not return, it can NOT be marked as "__noreturn"
127 without causing a warning to be emitted because the compilers can not
128 determine that the function truly does not return.
129 **/
130 void exit(int status) __noreturn;
131
132 /** The _Exit function causes normal program termination to occur and control
133 to be returned to the host environment.
134
135 No functions registered by the atexit function or signal handlers
136 registered by the signal function are called. Open streams with unwritten
137 buffered data are not flushed, open streams are not closed, and temporary
138 files are not removed by abort.
139
140 While this function does not return, it can NOT be marked as "__noreturn"
141 without causing a warning to be emitted because the compilers can not
142 determine that the function truly does not return.
143
144 The status returned to the host environment is determined in the same way
145 as for the exit function.
146 **/
147 void _Exit(int status) __noreturn;
148
149 /** The getenv function searches an environment list, provided by the host
150 environment, for a string that matches the string pointed to by name. The
151 set of environment names and the method for altering the environment list
152 are determined by the underlying UEFI Shell implementation.
153
154 @return The getenv function returns a pointer to a string associated with
155 the matched list member. The string pointed to shall not be
156 modified by the program, but may be overwritten by a subsequent
157 call to the getenv function. If the specified name cannot be
158 found, a null pointer is returned.
159 **/
160 char *getenv(const char *name);
161
162 /**
163 Add or update a variable in the environment list
164
165 @param name Address of a zero terminated name string
166 @param value Address of a zero terminated value string
167 @param rewrite TRUE allows overwriting existing values
168
169 @retval Returns 0 upon success
170 @retval Returns -1 upon failure, sets errno with more information
171
172 **/
173 int
174 setenv (
175 register const char * name,
176 register const char * value,
177 int rewrite
178 );
179
180 /** If string is a null pointer, the system function determines whether the
181 host environment has a command processor. If string is not a null pointer,
182 the system function passes the string pointed to by string to that command
183 processor to be executed in a manner which the implementation shall
184 document; this might then cause the program calling system to behave in a
185 non-conforming manner or to terminate.
186
187 @return If the argument is a null pointer, the system function returns
188 nonzero only if a command processor is available. If the argument
189 is not a null pointer, and the system function does return, it
190 returns an implementation-defined value.
191 **/
192 int system(const char *string);
193
194
195 /* ################ Integer arithmetic functions ######################## */
196
197 /** Computes the absolute value of an integer j.
198
199 @return The absolute value of j.
200 **/
201 int abs(int j);
202
203 /** Computes the absolute value of an integer j.
204
205 @return The absolute value of j.
206 **/
207 long labs(long j);
208
209 /** Computes the absolute value of an integer j.
210
211 @return The absolute value of j.
212 **/
213 long long
214 llabs(long long j);
215
216 /** Computes numer / denom and numer % denom in a single operation.
217
218 @return Returns a structure of type div_t, comprising both the
219 quotient and the remainder.
220 **/
221 div_t div(int numer, int denom);
222
223 /** Computes numer / denom and numer % denom in a single operation.
224
225 @return Returns a structure of type ldiv_t, comprising both the
226 quotient and the remainder.
227 **/
228 ldiv_t ldiv(long numer, long denom);
229
230 /** Computes numer / denom and numer % denom in a single operation.
231
232 @return Returns a structure of type lldiv_t, comprising both the
233 quotient and the remainder.
234 **/
235 lldiv_t lldiv(long long numer, long long denom);
236
237 /* ############ Integer Numeric conversion functions #################### */
238
239 /** The atoi function converts the initial portion of the string pointed to by
240 nptr to int representation. Except for the behavior on error, it is
241 equivalent to:
242 - atoi: (int)strtol(nptr, (char **)NULL, 10)
243
244 @return The atoi function returns the converted value.
245 **/
246 int atoi(const char *nptr);
247
248 /** The atol function converts the initial portion of the string pointed to by
249 nptr to long int representation. Except for the behavior on error, it is
250 equivalent to:
251 - atol: strtol(nptr, (char **)NULL, 10)
252
253 @return The atol function returns the converted value.
254 **/
255 long atol(const char *nptr);
256
257 /** The atoll function converts the initial portion of the string pointed to by
258 nptr to long long int representation. Except for the behavior on error, it
259 is equivalent to:
260 - atoll: strtoll(nptr, (char **)NULL, 10)
261
262 @return The atoll function returns the converted value.
263 **/
264 long long
265 atoll(const char *nptr);
266
267 /** The strtol, strtoll, strtoul, and strtoull functions convert the initial
268 portion of the string pointed to by nptr to long int, long long int,
269 unsigned long int, and unsigned long long int representation, respectively.
270 First, they decompose the input string into three parts: an initial,
271 possibly empty, sequence of white-space characters (as specified by the
272 isspace function), a subject sequence resembling an integer represented in
273 some radix determined by the value of base, and a final string of one or
274 more unrecognized characters, including the terminating null character of
275 the input string. Then, they attempt to convert the subject sequence to an
276 integer, and return the result.
277
278 If the value of base is zero, the expected form of the subject sequence is
279 that of an integer constant as described in 6.4.4.1, optionally preceded
280 by a plus or minus sign, but not including an integer suffix. If the value
281 of base is between 2 and 36 (inclusive), the expected form of the subject
282 sequence is a sequence of letters and digits representing an integer with
283 the radix specified by base, optionally preceded by a plus or minus sign,
284 but not including an integer suffix. The letters from a (or A) through z
285 (or Z) are ascribed the values 10 through 35; only letters and digits whose
286 ascribed values are less than that of base are permitted. If the value of
287 base is 16, the characters 0x or 0X may optionally precede the sequence of
288 letters and digits, following the sign if present.
289
290 The subject sequence is defined as the longest initial subsequence of the
291 input string, starting with the first non-white-space character, that is of
292 the expected form. The subject sequence contains no characters if the input
293 string is empty or consists entirely of white space, or if the first
294 non-white-space character is other than a sign or a permissible letter or digit.
295
296 If the subject sequence has the expected form and the value of base is
297 zero, the sequence of characters starting with the first digit is
298 interpreted as an integer constant. If the subject sequence has the
299 expected form and the value of base is between 2 and 36, it is used as the
300 base for conversion, ascribing to each letter its value as given above. If
301 the subject sequence begins with a minus sign, the value resulting from the
302 conversion is negated (in the return type). A pointer to the final string
303 is stored in the object pointed to by endptr, provided that endptr is
304 not a null pointer.
305
306 In other than the "C" locale, additional locale-specific subject sequence
307 forms may be accepted.
308
309 If the subject sequence is empty or does not have the expected form, no
310 conversion is performed; the value of nptr is stored in the object pointed
311 to by endptr, provided that endptr is not a null pointer.
312
313 @return The strtol, strtoll, strtoul, and strtoull functions return the
314 converted value, if any. If no conversion could be performed, zero
315 is returned. If the correct value is outside the range of
316 representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX,
317 ULONG_MAX, or ULLONG_MAX is returned (according to the return type
318 and sign of the value, if any), and the value of the macro ERANGE
319 is stored in errno.
320 **/
321 long strtol(const char * __restrict nptr, char ** __restrict endptr, int base);
322
323 /** The strtoul function converts the initial portion of the string pointed to
324 by nptr to unsigned long int representation.
325
326 See the description for strtol for more information.
327
328 @return The strtoul function returns the converted value, if any. If no
329 conversion could be performed, zero is returned. If the correct
330 value is outside the range of representable values, ULONG_MAX is
331 returned and the value of the macro ERANGE is stored in errno.
332 **/
333 unsigned long
334 strtoul(const char * __restrict nptr, char ** __restrict endptr, int base);
335
336 /** The strtoll function converts the initial portion of the string pointed to
337 by nptr to long long int representation.
338
339 See the description for strtol for more information.
340
341 @return The strtoll function returns the converted value, if any. If no
342 conversion could be performed, zero is returned. If the correct
343 value is outside the range of representable values, LLONG_MIN or
344 LLONG_MAX is returned (according to the sign of the value, if any),
345 and the value of the macro ERANGE is stored in errno.
346 **/
347 long long
348 strtoll(const char * __restrict nptr, char ** __restrict endptr, int base);
349
350 /** The strtoull function converts the initial portion of the string pointed to
351 by nptr to unsigned long long int representation.
352
353 See the description for strtol for more information.
354
355 @return The strtoull function returns the converted value, if any. If no
356 conversion could be performed, zero is returned. If the correct
357 value is outside the range of representable values, ULLONG_MAX is
358 returned and the value of the macro ERANGE is stored in errno.
359 **/
360 unsigned long long
361 strtoull(const char * __restrict nptr, char ** __restrict endptr, int base);
362
363 /* ######### Floating-point Numeric conversion functions ################ */
364
365 /**
366
367 @return
368 **/
369 double atof(const char *);
370
371 /**
372
373 @return
374 **/
375 double strtod(const char * __restrict nptr, char ** __restrict endptr);
376
377 /**
378
379 @return
380 **/
381 float strtof(const char * __restrict nptr, char ** __restrict endptr);
382
383 /**
384
385 @return
386 **/
387 long double
388 strtold(const char * __restrict nptr, char ** __restrict endptr);
389
390 /* ################ Pseudo-random sequence generation functions ######### */
391
392 /** The rand function computes a sequence of pseudo-random integers in the
393 range 0 to RAND_MAX.
394
395 @return The rand function returns a pseudo-random integer.
396 **/
397 int rand(void);
398
399 /** The srand function uses the argument as a seed for a new sequence of
400 pseudo-random numbers to be returned by subsequent calls to rand.
401
402 If srand is then called with the same seed value, the sequence of
403 pseudo-random numbers shall be repeated. If rand is called before any calls
404 to srand have been made, the same sequence shall be generated as when srand
405 is first called with a seed value of 1.
406 **/
407 void srand(unsigned seed);
408
409 /* ################ Memory management functions ######################### */
410
411 /** The calloc function allocates space for an array of Num objects, each of
412 whose size is Size. The space is initialized to all bits zero.
413
414 @return NULL is returned if the space could not be allocated and errno
415 contains the cause. Otherwise, a pointer to an 8-byte aligned
416 region of the requested size is returned.
417 **/
418 void *calloc(size_t Num, size_t Size);
419
420 /** The free function causes the space pointed to by Ptr to be deallocated,
421 that is, made available for further allocation.
422
423 If Ptr is a null pointer, no action occurs. Otherwise, if the argument
424 does not match a pointer earlier returned by the calloc, malloc, or realloc
425 function, or if the space has been deallocated by a call to free or
426 realloc, the behavior is undefined.
427
428 @param Ptr Pointer to a previously allocated region of memory to be freed.
429
430 **/
431 void free(void *);
432
433 /** The malloc function allocates space for an object whose size is specified
434 by size and whose value is indeterminate.
435
436 This implementation uses the UEFI memory allocation boot services to get a
437 region of memory that is 8-byte aligned and of the specified size. The
438 region is allocated with type EfiLoaderData.
439
440 @param size Size, in bytes, of the region to allocate.
441
442 @return NULL is returned if the space could not be allocated and errno
443 contains the cause. Otherwise, a pointer to an 8-byte aligned
444 region of the requested size is returned.<BR>
445 If NULL is returned, errno may contain:
446 - EINVAL: Requested Size is zero.
447 - ENOMEM: Memory could not be allocated.
448 **/
449 void *malloc(size_t);
450
451 /** The realloc function changes the size of the object pointed to by Ptr to
452 the size specified by NewSize.
453
454 The contents of the object are unchanged up to the lesser of the new and
455 old sizes. If the new size is larger, the value of the newly allocated
456 portion of the object is indeterminate.
457
458 If Ptr is a null pointer, the realloc function behaves like the malloc
459 function for the specified size.
460
461 If Ptr does not match a pointer earlier returned by the calloc, malloc, or
462 realloc function, or if the space has been deallocated by a call to the free
463 or realloc function, the behavior is undefined.
464
465 If the space cannot be allocated, the object pointed to by Ptr is unchanged.
466
467 If NewSize is zero and Ptr is not a null pointer, the object it points to
468 is freed.
469
470 This implementation uses the UEFI memory allocation boot services to get a
471 region of memory that is 8-byte aligned and of the specified size. The
472 region is allocated with type EfiLoaderData.
473
474 @param Ptr Pointer to a previously allocated region of memory to be resized.
475 @param NewSize Size, in bytes, of the new object to allocate space for.
476
477 @return NULL is returned if the space could not be allocated and errno
478 contains the cause. Otherwise, a pointer to an 8-byte aligned
479 region of the requested size is returned. If NewSize is zero,
480 NULL is returned and errno will be unchanged.
481 **/
482 void *realloc(void *Ptr, size_t NewSize);
483
484 /* ################ Searching and Sorting utilities ##################### */
485
486 /** The bsearch function searches an array of nmemb objects, the initial
487 element of which is pointed to by base, for an element that matches the
488 object pointed to by key. The size of each element of the array is
489 specified by size.
490
491 The comparison function pointed to by compar is called with two arguments
492 that point to the key object and to an array element, in that order. The
493 function returns an integer less than, equal to, or greater than zero if
494 the key object is considered, respectively, to be less than, to match, or
495 to be greater than the array element. The array consists of: all the
496 elements that compare less than, all the elements that compare equal to,
497 and all the elements that compare greater than the key object,
498 in that order.
499
500 @return The bsearch function returns a pointer to a matching element of the
501 array, or a null pointer if no match is found. If two elements
502 compare as equal, which element is matched is unspecified.
503 **/
504 void *
505 bsearch( const void *key, const void *base0,
506 size_t nmemb, size_t size,
507 int (*compar)(const void *, const void *)
508 );
509
510 /** The qsort function sorts an array of nmemb objects, the initial element of
511 which is pointed to by base. The size of each object is specified by size.
512
513 The contents of the array are sorted into ascending order according to a
514 comparison function pointed to by compar, which is called with two
515 arguments that point to the objects being compared. The function shall
516 return an integer less than, equal to, or greater than zero if the first
517 argument is considered to be respectively less than, equal to, or greater
518 than the second.
519
520 If two elements compare as equal, their order in the resulting sorted array
521 is unspecified.
522 **/
523 void qsort( void *base, size_t nmemb, size_t size,
524 int (*compar)(const void *, const void *));
525
526 /* ################ Multibyte/wide character conversion functions ####### */
527
528 /** Determine the number of bytes comprising a multibyte character.
529
530 If s is not a null pointer, the mblen function determines the number of bytes
531 contained in the multibyte character pointed to by s. Except that the
532 conversion state of the mbtowc function is not affected, it is equivalent to
533 mbtowc((wchar_t *)0, s, n);
534
535 The implementation shall behave as if no library function calls the mblen
536 function.
537
538 @return If s is a null pointer, the mblen function returns a nonzero or
539 zero value, if multibyte character encodings, respectively, do
540 or do not have state-dependent encodings. If s is not a null
541 pointer, the mblen function either returns 0 (if s points to the
542 null character), or returns the number of bytes that are contained
543 in the multibyte character (if the next n or fewer bytes form a
544 valid multibyte character), or returns -1 (if they do not form a
545 valid multibyte character).
546 **/
547 int mblen(const char *, size_t);
548
549 /** Convert a multibyte character into a wide character.
550
551 If s is not a null pointer, the mbtowc function inspects at most n bytes
552 beginning with the byte pointed to by s to determine the number of bytes
553 needed to complete the next multibyte character (including any shift
554 sequences). If the function determines that the next multibyte character
555 is complete and valid, it determines the value of the corresponding wide
556 character and then, if pwc is not a null pointer, stores that value in
557 the object pointed to by pwc. If the corresponding wide character is the
558 null wide character, the function is left in the initial conversion state.
559
560 The implementation shall behave as if no library function calls the
561 mbtowc function.
562
563 @return If s is a null pointer, the mbtowc function returns a nonzero or
564 zero value, if multibyte character encodings, respectively, do
565 or do not have state-dependent encodings. If s is not a null
566 pointer, the mbtowc function either returns 0 (if s points to
567 the null character), or returns the number of bytes that are
568 contained in the converted multibyte character (if the next n or
569 fewer bytes form a valid multibyte character), or returns -1
570 (if they do not form a valid multibyte character).
571
572 In no case will the value returned be greater than n or the value
573 of the MB_CUR_MAX macro.
574 **/
575 int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
576
577 /**
578 The wctomb function determines the number of bytes needed to represent the multibyte
579 character corresponding to the wide character given by wc (including any shift
580 sequences), and stores the multibyte character representation in the array whose first
581 element is pointed to by s (if s is not a null pointer). At most MB_CUR_MAX characters
582 are stored. If wc is a null wide character, a null byte is stored, preceded by any shift
583 sequence needed to restore the initial shift state, and the function is left in the initial
584 conversion state.
585
586 The implementation shall behave as if no library function calls the wctomb function.
587
588 @return
589 If s is a null pointer, the wctomb function returns a nonzero or zero value, if multibyte
590 character encodings, respectively, do or do not have state-dependent encodings. If s is
591 not a null pointer, the wctomb function returns -1 if the value of wc does not correspond
592 to a valid multibyte character, or returns the number of bytes that are contained in the
593 multibyte character corresponding to the value of wc.
594
595 In no case will the value returned be greater than the value of the MB_CUR_MAX macro.
596
597 **/
598 int wctomb(char *, wchar_t);
599
600 /* ################ Multibyte/wide string conversion functions ########## */
601
602 /** Convert a multibyte character string into a wide-character string.
603
604 The mbstowcs function converts a sequence of multibyte characters that
605 begins in the initial shift state from the array pointed to by src into
606 a sequence of corresponding wide characters and stores not more than limit
607 wide characters into the array pointed to by dest. No multibyte
608 characters that follow a null character (which is converted into a null
609 wide character) will be examined or converted. Each multibyte character
610 is converted as if by a call to the mbtowc function, except that the
611 conversion state of the mbtowc function is not affected.
612
613 No more than limit elements will be modified in the array pointed to by dest.
614 If copying takes place between objects that overlap,
615 the behavior is undefined.
616
617 @return If an invalid multibyte character is encountered, the mbstowcs
618 function returns (size_t)(-1). Otherwise, the mbstowcs function
619 returns the number of array elements modified, not including a
620 terminating null wide character, if any.
621
622 **/
623 size_t mbstowcs(wchar_t * __restrict dest, const char * __restrict src, size_t limit);
624
625 /** Convert a wide-character string into a multibyte character string.
626
627 The wcstombs function converts a sequence of wide characters from the
628 array pointed to by src into a sequence of corresponding multibyte
629 characters that begins in the initial shift state, and stores these
630 multibyte characters into the array pointed to by dest, stopping if a
631 multibyte character would exceed the limit of limit total bytes or if a
632 null character is stored. Each wide character is converted as if by
633 a call to the wctomb function, except that the conversion state of
634 the wctomb function is not affected.
635
636 No more than limit bytes will be modified in the array pointed to by dest.
637 If copying takes place between objects that overlap,
638 the behavior is undefined.
639
640 @return If a wide character is encountered that does not correspond to a
641 valid multibyte character, the wcstombs function returns
642 (size_t)(-1). Otherwise, the wcstombs function returns the number
643 of bytes modified, not including a terminating null character,
644 if any.
645 **/
646 size_t wcstombs(char * __restrict dest, const wchar_t * __restrict src, size_t limit);
647
648 /**
649 The realpath() function shall derive, from the pathname pointed to by
650 file_name, an absolute pathname that names the same file, whose resolution
651 does not involve '.', '..', or symbolic links. The generated pathname shall
652 be stored as a null-terminated string, up to a maximum of {PATH_MAX} bytes,
653 in the buffer pointed to by resolved_name.
654
655 If resolved_name is a null pointer, the behavior of realpath() is
656 implementation-defined.
657
658 @param[in] file_name The filename to convert.
659 @param[in,out] resolved_name The resultant name.
660
661 @retval NULL An error occured.
662 @return resolved_name.
663 **/
664 char * realpath(char *file_name, char *resolved_name);
665
666 /**
667 The getprogname() function returns the name of the program. If the name
668 has not been set yet, it will return NULL.
669
670 @retval The name of the program.
671 @retval NULL The name has not been set.
672 **/
673 const char * getprogname(void);
674
675 /**
676 The setprogname() function sets the name of the program.
677
678 @param[in] The name of the program. This memory must be retained
679 by the caller until no calls to "getprogname" will be
680 called.
681 **/
682 void setprogname(const char *progname);
683
684 __END_DECLS
685
686 #endif /* _STDLIB_H */