Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * <<perror>>---print an error message on standard error
23 * void perror(char *<[prefix]>);
24 * void _perror_r(void *<[reent]>, char *<[prefix]>);
27 * void perror(<[prefix]>)
29 * void _perror_r(<[reent]>, <[prefix]>)
32 * Use <<perror>> to print (on standard error) an error message
33 * corresponding to the current value of the global variable <<errno>>.
34 * Unless you use <<NULL>> as the value of the argument <[prefix]>, the
35 * error message will begin with the string at <[prefix]>, followed by a
36 * colon and a space (<<: >>). The remainder of the error message is one
37 * of the strings described for <<strerror>>.
38 * The alternate function <<_perror_r>> is a reentrant version. The
39 * extra argument <[reent]> is a pointer to a reentrancy structure.
41 * <<perror>> returns no result.
43 * ANSI C requires <<perror>>, but the strings issued vary from one
44 * implementation to another.
45 * Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
46 * <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
58 A reentrant version of perror().
61 _perror_r (struct _reent *ptr, const char *s)
64 FILE *efp = _stderr_r(ptr);
66 if (s != NULL && *s != '\0')
72 error = strerror (ptr->_errno);
74 fprintf (efp, "error %d\n", ptr->_errno);
85 perror (const char *s)
87 _perror_r (_REENT, s);