OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / atoi.3
index 3055ecd..13fa966 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
@@ -28,7 +30,7 @@
 .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu)
 .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers
 .\"
-.TH ATOI 3  2007-07-26 "GNU" "Linux Programmer's Manual"
+.TH ATOI 3  2014-01-22 "GNU" "Linux Programmer's Manual"
 .SH NAME
 atoi, atol, atoll, atoq \- convert a string to an integer
 .SH SYNOPSIS
@@ -51,9 +53,14 @@ Feature Test Macro Requirements for glibc (see
 .sp
 .ad l
 .BR atoll ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
+.RS 4
+_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
+_POSIX_C_SOURCE\ >=\ 200112L;
+.br
+or
 .I cc\ -std=c99
-.ad b
+.RE
+.ad
 .SH DESCRIPTION
 The
 .BR atoi ()
@@ -63,7 +70,7 @@ pointed to by \fInptr\fP to
 The behavior is the same as
 .sp
 .in +4n
-strtol(nptr, (char **) NULL, 10);
+strtol(nptr, NULL, 10);
 .in
 .sp
 except that
@@ -81,9 +88,21 @@ string to their return type of \fIlong\fP or \fIlong long\fP.
 .BR atoq ()
 is an obsolete name for
 .BR atoll ().
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 The converted value.
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR atoi (),
+.BR atol (),
+and
+.BR atoll ()
+functions are thread-safe with exceptions.
+These functions can be safely used in multithreaded applications,
+as long as
+.BR setlocale (3)
+is not called to change the locale during their execution.
+.SH CONFORMING TO
 SVr4, POSIX.1-2001, 4.3BSD, C99.
 C89 and
 POSIX.1-1996 include the functions
@@ -103,8 +122,17 @@ The
 .BR atoll ()
 function is present in glibc 2 since version 2.0.2, but
 not in libc4 or libc5.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR atof (3),
 .BR strtod (3),
 .BR strtol (3),
 .BR strtoul (3)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.