xref: /openbsd-src/lib/libc/stdlib/atoll.c (revision 6580fee3295c971a919cc04bfc3598c5f8bcd2b1)
109919f81Smillert /*
209919f81Smillert  * Copyright (c) 1988 Regents of the University of California.
309919f81Smillert  * All rights reserved.
409919f81Smillert  *
509919f81Smillert  * Redistribution and use in source and binary forms, with or without
609919f81Smillert  * modification, are permitted provided that the following conditions
709919f81Smillert  * are met:
809919f81Smillert  * 1. Redistributions of source code must retain the above copyright
909919f81Smillert  *    notice, this list of conditions and the following disclaimer.
1009919f81Smillert  * 2. Redistributions in binary form must reproduce the above copyright
1109919f81Smillert  *    notice, this list of conditions and the following disclaimer in the
1209919f81Smillert  *    documentation and/or other materials provided with the distribution.
13*6580fee3Smillert  * 3. Neither the name of the University nor the names of its contributors
1409919f81Smillert  *    may be used to endorse or promote products derived from this software
1509919f81Smillert  *    without specific prior written permission.
1609919f81Smillert  *
1709919f81Smillert  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1809919f81Smillert  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1909919f81Smillert  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2009919f81Smillert  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2109919f81Smillert  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2209919f81Smillert  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2309919f81Smillert  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2409919f81Smillert  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2509919f81Smillert  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2609919f81Smillert  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2709919f81Smillert  * SUCH DAMAGE.
2809919f81Smillert  */
2909919f81Smillert 
3009919f81Smillert #if defined(LIBC_SCCS) && !defined(lint)
31*6580fee3Smillert static char *rcsid = "$OpenBSD: atoll.c,v 1.2 2003/06/02 20:18:37 millert Exp $";
3209919f81Smillert #endif /* LIBC_SCCS and not lint */
3309919f81Smillert 
3409919f81Smillert #include <stdlib.h>
3509919f81Smillert 
3609919f81Smillert long long
3709919f81Smillert atoll(str)
3809919f81Smillert 	const char *str;
3909919f81Smillert {
4009919f81Smillert 	return(strtoll(str, (char **)NULL, 10));
4109919f81Smillert }
42