187017Sache/* 287017Sache * Copyright (c) 1988, 1993 387017Sache * The Regents of the University of California. All rights reserved. 487017Sache * 5227753Stheraven * Copyright (c) 2011 The FreeBSD Foundation 6227753Stheraven * All rights reserved. 7227753Stheraven * Portions of this software were developed by David Chisnall 8227753Stheraven * under sponsorship from the FreeBSD Foundation. 9227753Stheraven * 1087017Sache * Redistribution and use in source and binary forms, with or without 1187017Sache * modification, are permitted provided that the following conditions 1287017Sache * are met: 1387017Sache * 1. Redistributions of source code must retain the above copyright 1487017Sache * notice, this list of conditions and the following disclaimer. 1587017Sache * 2. Redistributions in binary form must reproduce the above copyright 1687017Sache * notice, this list of conditions and the following disclaimer in the 1787017Sache * documentation and/or other materials provided with the distribution. 18251069Semaste * 3. Neither the name of the University nor the names of its contributors 1987017Sache * may be used to endorse or promote products derived from this software 2087017Sache * without specific prior written permission. 2187017Sache * 2287017Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2387017Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2487017Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2587017Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2687017Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2787017Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2887017Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2987017Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3087017Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3187017Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3287017Sache * SUCH DAMAGE. 3387017Sache */ 3487017Sache 3592986Sobrien#include <sys/cdefs.h> 3692986Sobrien__FBSDID("$FreeBSD: releng/10.3/lib/libc/stdlib/atoll.c 251069 2013-05-28 20:57:40Z emaste $"); 3792986Sobrien 3887017Sache#include <stdlib.h> 39227753Stheraven#include <xlocale.h> 4087017Sache 4187017Sachelong long 4287017Sacheatoll(str) 4387017Sache const char *str; 4487017Sache{ 4588681Sache return strtoll(str, (char **)NULL, 10); 4687017Sache} 47227753Stheraven 48227753Stheravenlong long 49227753Stheravenatoll_l(str, locale) 50227753Stheraven const char *str; 51227753Stheraven locale_t locale; 52227753Stheraven{ 53227753Stheraven return strtoll_l(str, (char **)NULL, 10, locale); 54227753Stheraven} 55