Merge the manual pages and call them deprecated there.
ok and manpage tweak jmc@, ok natano@
-/* $OpenBSD: stdlib.h,v 1.7 2016/03/13 18:34:21 guenther Exp $ */
+/* $OpenBSD: stdlib.h,v 1.8 2016/08/14 23:18:03 guenther Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
PROTO_DEPRECATED(posix_openpt);
PROTO_DEPRECATED(ptsname);
PROTO_NORMAL(putenv);
-PROTO_DEPRECATED(qabs);
-PROTO_DEPRECATED(qdiv);
+/*PROTO_DEPRECATED(qabs); alias of llabs */
+/*PROTO_DEPRECATED(qdiv); alias of lldiv */
PROTO_NORMAL(qsort);
PROTO_DEPRECATED(radixsort);
PROTO_STD_DEPRECATED(rand);
-# $OpenBSD: Makefile.inc,v 1.60 2016/05/02 12:59:24 millert Exp $
+# $OpenBSD: Makefile.inc,v 1.61 2016/08/14 23:18:03 guenther Exp $
# stdlib sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/stdlib ${LIBCSRCDIR}/stdlib
realpath.c remque.c setenv.c strtoimax.c \
strtol.c strtoll.c strtonum.c strtoul.c strtoull.c strtoumax.c \
system.c tfind.c tsearch.c _rand48.c drand48.c erand48.c jrand48.c \
- lcong48.c lrand48.c mrand48.c nrand48.c seed48.c srand48.c qabs.c \
- qdiv.c _Exit.c icdb.c
+ lcong48.c lrand48.c mrand48.c nrand48.c seed48.c srand48.c \
+ _Exit.c icdb.c
.if (${MACHINE_CPU} == "i386")
SRCS+= abs.S div.S labs.S ldiv.S
bsearch.3 div.3 ecvt.3 exit.3 getenv.3 getopt.3 getopt_long.3 \
getsubopt.3 hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 \
lldiv.3 lsearch.3 malloc.3 posix_memalign.3 posix_openpt.3 ptsname.3 \
- qabs.3 qdiv.3 qsort.3 radixsort.3 rand48.3 rand.3 random.3 realpath.3 \
+ qsort.3 radixsort.3 rand48.3 rand.3 random.3 realpath.3 \
strtod.3 strtonum.3 strtol.3 strtoul.3 system.3 tsearch.3
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: div.3,v 1.11 2013/06/05 03:39:23 tedu Exp $
+.\" $OpenBSD: div.3,v 1.12 2016/08/14 23:18:03 guenther Exp $
.\"
-.Dd $Mdocdate: June 5 2013 $
+.Dd $Mdocdate: August 14 2016 $
.Dt DIV 3
.Os
.Sh NAME
.Sh SEE ALSO
.Xr imaxdiv 3 ,
.Xr ldiv 3 ,
-.Xr lldiv 3 ,
-.Xr qdiv 3
+.Xr lldiv 3
.Sh STANDARDS
The
.Fn div
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: imaxdiv.3,v 1.6 2014/11/30 21:21:59 schwarze Exp $
+.\" $OpenBSD: imaxdiv.3,v 1.7 2016/08/14 23:18:03 guenther Exp $
.\"
-.Dd $Mdocdate: November 30 2014 $
+.Dd $Mdocdate: August 14 2016 $
.Dt IMAXDIV 3
.Os
.Sh NAME
.Sh SEE ALSO
.Xr div 3 ,
.Xr ldiv 3 ,
-.Xr lldiv 3 ,
-.Xr qdiv 3
+.Xr lldiv 3
.Sh STANDARDS
The
.Fn imaxdiv
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: labs.3,v 1.13 2014/11/30 21:21:59 schwarze Exp $
+.\" $OpenBSD: labs.3,v 1.14 2016/08/14 23:18:03 guenther Exp $
.\"
-.Dd $Mdocdate: November 30 2014 $
+.Dd $Mdocdate: August 14 2016 $
.Dt LABS 3
.Os
.Sh NAME
.Fn labs "long i"
.Ft long long
.Fn llabs "long long j"
+.Ft quad_t
+.Fn qabs "quad_t j"
.Sh DESCRIPTION
The
.Fn labs
.Fn llabs
function returns the absolute value of the long long integer
.Fa j .
+The
+.Fn qabs
+function is a deprecated equivalent of
+.Fn llabs .
.Sh SEE ALSO
.Xr abs 3 ,
.Xr cabs 3 ,
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: ldiv.3,v 1.12 2013/07/17 05:42:11 schwarze Exp $
+.\" $OpenBSD: ldiv.3,v 1.13 2016/08/14 23:18:03 guenther Exp $
.\"
-.Dd $Mdocdate: July 17 2013 $
+.Dd $Mdocdate: August 14 2016 $
.Dt LDIV 3
.Os
.Sh NAME
.Sh SEE ALSO
.Xr div 3 ,
.Xr imaxdiv 3 ,
-.Xr lldiv 3 ,
-.Xr qdiv 3
+.Xr lldiv 3
.Sh STANDARDS
The
.Fn ldiv
-/* $OpenBSD: llabs.c,v 1.3 2007/01/08 19:39:25 deraadt Exp $ */
+/* $OpenBSD: llabs.c,v 1.4 2016/08/14 23:18:03 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
{
return (j < 0 ? -j : j);
}
+
+__weak_alias(qabs, llabs);
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: lldiv.3,v 1.5 2014/11/30 21:21:59 schwarze Exp $
+.\" $OpenBSD: lldiv.3,v 1.6 2016/08/14 23:18:03 guenther Exp $
.\"
-.Dd $Mdocdate: November 30 2014 $
+.Dd $Mdocdate: August 14 2016 $
.Dt LLDIV 3
.Os
.Sh NAME
.In stdlib.h
.Ft lldiv_t
.Fn lldiv "long long num" "long long denom"
+.Ft qdiv_t
+.Fn qdiv "quad_t num" "quad_t denom"
.Sh DESCRIPTION
The
.Fn lldiv
.Fa quot
and
.Fa rem .
+The
+.Fn qdiv
+function is a deprecated equivalent of
+.Fn lldiv .
.Sh SEE ALSO
.Xr div 3 ,
.Xr imaxdiv 3 ,
-.Xr ldiv 3 ,
-.Xr qdiv 3
+.Xr ldiv 3
.Sh STANDARDS
The
.Fn lldiv
-/* $OpenBSD: lldiv.c,v 1.1 2006/01/13 17:58:09 millert Exp $ */
+/* $OpenBSD: lldiv.c,v 1.2 2016/08/14 23:18:03 guenther Exp $ */
/*
* Copyright (c) 1990 Regents of the University of California.
* All rights reserved.
}
return (r);
}
+
+__weak_alias(qdiv, lldiv);
+++ /dev/null
-.\" Copyright (c) 1990, 1991 The Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" the American National Standards Committee X3, on Information
-.\" Processing Systems.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $OpenBSD: qabs.3,v 1.13 2013/06/05 03:39:23 tedu Exp $
-.\"
-.Dd $Mdocdate: June 5 2013 $
-.Dt QABS 3
-.Os
-.Sh NAME
-.Nm qabs
-.Nd return the absolute value of a quad integer
-.Sh SYNOPSIS
-.In stdlib.h
-.Ft quad_t
-.Fn qabs "quad_t j"
-.Sh DESCRIPTION
-The
-.Fn qabs
-function returns the absolute value of the quad integer
-.Fa j .
-.Sh SEE ALSO
-.Xr abs 3 ,
-.Xr cabs 3 ,
-.Xr floor 3 ,
-.Xr imaxabs 3 ,
-.Xr labs 3
-.Sh BUGS
-The absolute value of the most negative integer remains negative.
+++ /dev/null
-/* $OpenBSD: qabs.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <stdlib.h>
-
-quad_t
-qabs(quad_t j)
-{
- return(j < 0 ? -j : j);
-}
+++ /dev/null
-.\" Copyright (c) 1990, 1991 The Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Chris Torek and the American National Standards Committee X3,
-.\" on Information Processing Systems.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $OpenBSD: qdiv.3,v 1.10 2013/06/05 03:39:23 tedu Exp $
-.\"
-.Dd $Mdocdate: June 5 2013 $
-.Dt QDIV 3
-.Os
-.Sh NAME
-.Nm qdiv
-.Nd return quotient and remainder from division
-.Sh SYNOPSIS
-.In stdlib.h
-.Ft qdiv_t
-.Fn qdiv "quad_t num" "quad_t denom"
-.Sh DESCRIPTION
-The
-.Fn qdiv
-function computes the value
-.Fa num Ns / Ns Fa denom
-and returns the quotient and remainder in a structure named
-.Li qdiv_t
-that contains two
-.Li quad integer
-members named
-.Fa quot
-and
-.Fa rem .
-.Sh SEE ALSO
-.Xr div 3 ,
-.Xr imaxdiv 3 ,
-.Xr ldiv 3 ,
-.Xr lldiv 3
+++ /dev/null
-/* $OpenBSD: qdiv.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
-/*
- * Copyright (c) 1990 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <stdlib.h> /* qdiv_t */
-
-qdiv_t
-qdiv(quad_t num, quad_t denom)
-{
- qdiv_t r;
-
- /* see div.c for comments */
-
- r.quot = num / denom;
- r.rem = num % denom;
- if (num >= 0 && r.rem < 0) {
- r.quot++;
- r.rem -= denom;
- }
- return (r);
-}