OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / strtoimax.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .TH STRTOIMAX 3 2014-01-22 "" "Linux Programmer's Manual"
25 .SH NAME
26 strtoimax, strtoumax \- convert string to integer
27 .SH SYNOPSIS
28 .nf
29 .B #include <inttypes.h>
30 .sp
31 .BI "intmax_t strtoimax(const char *" nptr ", char **" endptr ", int " base );
32 .br
33 .BI "uintmax_t strtoumax(const char *" nptr ", char **" endptr ", int " base );
34 .fi
35 .SH DESCRIPTION
36 These functions are just like
37 .BR strtol (3)
38 and
39 .BR strtoul (3),
40 except that they return a value of type
41 .I intmax_t
42 and
43 .IR uintmax_t ,
44 respectively.
45 .SH RETURN VALUE
46 On success, the converted value is returned.
47 If nothing was found to convert, zero is returned.
48 On overflow or underflow
49 .B INTMAX_MAX
50 or
51 .B INTMAX_MIN
52 or
53 .B UINTMAX_MAX
54 is returned, and
55 .I errno
56 is set to
57 .BR ERANGE .
58 .SH ATTRIBUTES
59 .SS Multithreading (see pthreads(7))
60 The
61 .BR strtoimax ()
62 and
63 .BR strtoumax ()
64 functions are thread-safe with exceptions.
65 These functions can be safely used in multithreaded applications,
66 as long as
67 .BR setlocale (3)
68 is not called to change the locale during their execution.
69 .SH CONFORMING TO
70 C99, POSIX.1-2001.
71 .SH SEE ALSO
72 .BR imaxabs (3),
73 .BR imaxdiv (3),
74 .BR strtol (3),
75 .BR strtoul (3),
76 .BR wcstoimax (3)
77 .SH COLOPHON
78 This page is part of release 3.79 of the Linux
79 .I man-pages
80 project.
81 A description of the project,
82 information about reporting bugs,
83 and the latest version of this page,
84 can be found at
85 \%http://www.kernel.org/doc/man\-pages/.