sync with OpenBSD -current

This commit is contained in:
purplerain 2024-04-16 02:31:24 +00:00
parent 9d8ac7f158
commit 382ecd9441
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
108 changed files with 9152 additions and 5077 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: options.c,v 1.107 2023/12/09 23:00:11 jca Exp $ */
/* $OpenBSD: options.c,v 1.109 2024/04/15 22:07:08 caspar Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
@ -238,7 +238,11 @@ FSUB fsub[] = {
#define F_CPIO 3 /* format when called as cpio */
#define F_OTAR 4 /* format when called as tar -o */
#define F_TAR 5 /* format when called as tar */
#define DEFLT 5 /* default write format from list above */
#ifdef SMALL
# define DEFLT 5 /* default write format when called as pax: ustar */
#else
# define DEFLT 10 /* default write format when called as pax: pax */
#endif
/*
* ford is the archive search order used by get_arc() to determine what kind

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: pax.1,v 1.77 2023/12/09 23:00:11 jca Exp $
.\" $OpenBSD: pax.1,v 1.78 2024/04/15 17:33:10 jca Exp $
.\" $NetBSD: pax.1,v 1.3 1995/03/21 09:07:37 cgd Exp $
.\"
.\" Copyright (c) 1992 Keith Muller.
@ -34,7 +34,7 @@
.\"
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\"
.Dd $Mdocdate: December 9 2023 $
.Dd $Mdocdate: April 15 2024 $
.Dt PAX 1
.Os
.Sh NAME
@ -810,7 +810,7 @@ field as described in
for more information about device IDs.
.It Fl x Ar format
Specify the output archive format, with the default format being
.Cm ustar .
.Cm pax .
.Nm
currently supports the following formats:
.Bl -tag -width "sv4cpio"

View File

@ -727,9 +727,9 @@
./usr/lib/crtendS.o
./usr/lib/gcrt0.o
./usr/lib/libagentx.so.1.1
./usr/lib/libc.so.99.0
./usr/lib/libc.so.100.0
./usr/lib/libcbor.so.2.0
./usr/lib/libcrypto.so.53.0
./usr/lib/libcrypto.so.54.0
./usr/lib/libcurses.so.15.0
./usr/lib/libedit.so.6.0
./usr/lib/libelf.so.3.0
@ -758,10 +758,10 @@
./usr/lib/librpcsvc.so.3.0
./usr/lib/libskey.so.6.0
./usr/lib/libsndio.so.7.2
./usr/lib/libssl.so.56.0
./usr/lib/libssl.so.57.0
./usr/lib/libtermcap.so.15.0
./usr/lib/libtermlib.so.15.0
./usr/lib/libtls.so.29.0
./usr/lib/libtls.so.30.0
./usr/lib/libusbhid.so.7.1
./usr/lib/libutil.so.18.0
./usr/lib/libz.so.7.0
@ -2963,8 +2963,8 @@
./usr/share/relink/usr/bin/ssh-agent
./usr/share/relink/usr/bin/ssh-agent/ssh-agent.tar
./usr/share/relink/usr/lib
./usr/share/relink/usr/lib/libc.so.99.0.a
./usr/share/relink/usr/lib/libcrypto.so.53.0.a
./usr/share/relink/usr/lib/libc.so.100.0.a
./usr/share/relink/usr/lib/libcrypto.so.54.0.a
./usr/share/relink/usr/libexec
./usr/share/relink/usr/libexec/ld.so.a
./usr/share/relink/usr/sbin

View File

@ -1 +1 @@
# SecBSD 1.5-cc34b9f: Tue Apr 9 00:00:00 UTC 2024 (Yatagarasu)
# SecBSD 1.5-62ce95a: Tue Apr 16 00:00:00 UTC 2024 (Yatagarasu)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dirent.h,v 1.34 2016/09/09 18:12:37 millert Exp $ */
/* $OpenBSD: dirent.h,v 1.35 2024/04/15 15:47:58 florian Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*-
@ -90,6 +90,9 @@ int readdir_r(DIR *__restrict, struct dirent *__restrict,
#if __POSIX_VISIBLE >= 200809
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *),
int (*)(const struct dirent **, const struct dirent **));
int scandirat(int, const char *, struct dirent ***,
int (*)(const struct dirent *),
int (*)(const struct dirent **, const struct dirent **));
int alphasort(const struct dirent **, const struct dirent **);
#elif __BSD_VISIBLE
int scandir(const char *, struct dirent ***, int (*)(struct dirent *),

View File

@ -750,6 +750,7 @@ readdir_r
readpassphrase
rewinddir
scandir
scandirat
seekdir
setclasscontext
setdomainname

View File

@ -1,5 +1,3 @@
__bswap16
__bswap32
__mcount
__multf3
_fpgetmask

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile.inc,v 1.2 2020/07/06 13:33:05 pirofti Exp $
# $OpenBSD: Makefile.inc,v 1.3 2024/04/15 15:21:11 naddy Exp $
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $
SRCS+= byte_swap_2.S byte_swap_4.S fabs.c flt_rounds.c infinity.c
SRCS+= fabs.c flt_rounds.c infinity.c
SRCS+= ldexp.c modf.c nan.c
SRCS+= setjmp.S _setjmp.S sigsetjmp.S
SRCS+= clz_tab.c

View File

@ -1,48 +0,0 @@
/* $OpenBSD: byte_swap_2.S,v 1.3 2022/05/24 22:34:02 guenther Exp $ */
/* $NetBSD: byte_swap_2.S,v 1.3 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Charles M. Hannum.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "DEFS.h"
_ENTRY(__bswap16)
_ENTRY_NB(ntohs)
ENTRY_NB(htons)
RETGUARD_SETUP(__bswap16, x15)
and w8, w0, #0xffff
ubfx w0, w0, #8, #8
bfi w0, w8, #8, #16
RETGUARD_CHECK(__bswap16, x15)
ret
END(htons)
_END(ntohs)
_END(__bswap16)
.weak htons
.weak ntohs

View File

@ -1,46 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.3 2022/05/24 22:34:02 guenther Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Neil A. Carson
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "DEFS.h"
_ENTRY(__bswap32)
_ENTRY_NB(ntohl)
ENTRY_NB(htonl)
RETGUARD_SETUP(__bswap32, x15)
rev w0, w0
RETGUARD_CHECK(__bswap32, x15)
ret
END(htonl)
_END(ntohl)
_END(__bswap32)
.weak htonl
.weak ntohl

View File

@ -1,4 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.4 1996/11/13 22:05:02 niklas Exp $
# $NetBSD: Makefile.inc,v 1.2 1996/04/17 22:36:42 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View File

@ -1,48 +0,0 @@
/* $OpenBSD: byte_swap_2.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: byte_swap_2.S,v 1.2 1996/10/17 03:08:08 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <machine/asm.h>
#ifndef NAME
#define NAME byte_swap_2
#endif
/*
* Byte-swap a 2-byte quantity. (Convert 0x0123 to 0x2301.)
*
* Argument is an unsigned 2-byte integer (u_int16_t).
*/
LEAF(NAME, 1) /* a0 contains 0x0123 */
extbl a0, 0, t0 /* t0 = 0x 23 */
extbl a0, 1, t1 /* t1 = 0x 01 */
sll t0, 8, t0 /* t1 = 0x23 */
or t0, t1, v0 /* v0 = 0x2301 */
RET
END(NAME)

View File

@ -1,54 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 1996/10/17 03:08:09 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <machine/asm.h>
#ifndef NAME
#define NAME byte_swap_4
#endif
/*
* Byte-swap a 4-byte quantity. (Convert 0x01234567 to 0x67452301.)
*
* Argument is an unsigned 4-byte integer (u_int32_t).
*/
LEAF(NAME, 1) /* a0 contains 0x01234567 */
extbl a0, 0, t0 /* t0 = 0x 67 */
extbl a0, 1, t1 /* t1 = 0x 45 */
extbl a0, 2, t2 /* t2 = 0x 23 */
extbl a0, 3, t3 /* t3 = 0x 01 */
sll t0, 24, t0 /* t0 = 0x67 */
sll t1, 16, t1 /* t1 = 0x 45 */
sll t2, 8, t2 /* t2 = 0x 23 */
or t3, t0, v0 /* v0 = 0x67 01 */
or t1, t2, t1 /* t1 = 0x 4523 */
or t1, v0, v0 /* v0 = 0x67452301 */
RET
END(NAME)

View File

@ -1,33 +0,0 @@
/* $OpenBSD: htonl.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: htonl.S,v 1.1 1996/04/17 22:36:52 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME htonl
#include "byte_swap_4.S"

View File

@ -1,33 +0,0 @@
/* $OpenBSD: htons.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: htons.S,v 1.1 1996/04/17 22:36:54 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME htons
#include "byte_swap_2.S"

View File

@ -1,33 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: ntohl.S,v 1.1 1996/04/17 22:36:57 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME ntohl
#include "byte_swap_4.S"

View File

@ -1,33 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
/* $NetBSD: ntohs.S,v 1.1 1996/04/17 22:37:02 cgd Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#define NAME ntohs
#include "byte_swap_2.S"

View File

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View File

@ -1,13 +0,0 @@
/* $OpenBSD: htonl.S,v 1.3 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(htonl)
RETGUARD_SETUP(htonl, r11)
movl %edi,%eax
bswapl %eax
RETGUARD_CHECK(htonl, r11)
ret
END(htonl)

View File

@ -1,13 +0,0 @@
/* $OpenBSD: htons.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(htons)
RETGUARD_SETUP(htons, r11)
movl %edi,%eax
xchgb %ah,%al
RETGUARD_CHECK(htons, r11)
ret
END(htons)

View File

@ -1,13 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(ntohl)
RETGUARD_SETUP(ntohl, r11)
movl %edi,%eax
bswapl %eax
RETGUARD_CHECK(ntohl, r11)
ret
END(ntohl)

View File

@ -1,13 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.4 2018/07/03 23:14:05 mortimer Exp $ */
/* Written by Artur Grabowski. Public Domain */
#include <machine/asm.h>
ENTRY(ntohs)
RETGUARD_SETUP(ntohs, r11)
movl %edi,%eax
xchgb %ah,%al
RETGUARD_CHECK(ntohs, r11)
ret
END(ntohs)

View File

@ -1,7 +1,5 @@
__adddf3
__addsf3
__bswap16
__bswap32
__divdf3
__divsf3
__divsi3

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile.inc,v 1.16 2020/07/06 13:33:05 pirofti Exp $
# $OpenBSD: Makefile.inc,v 1.17 2024/04/15 15:21:11 naddy Exp $
# $NetBSD: Makefile.inc,v 1.6 2003/08/01 17:03:47 lukem Exp $
SRCS+= byte_swap_2.S byte_swap_4.S divsi3.S fabs.c flt_rounds.c infinity.c
SRCS+= divsi3.S fabs.c flt_rounds.c infinity.c
SRCS+= ldexp.c modf.c nan.c usertc.c
SRCS+= setjmp.S _setjmp.S sigsetjmp.S

View File

@ -1,47 +0,0 @@
/* $OpenBSD: byte_swap_4.S,v 1.4 2022/05/24 17:15:23 guenther Exp $ */
/* $NetBSD: byte_swap_4.S,v 1.2 2003/04/05 23:08:51 bjh21 Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Neil A. Carson
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "DEFS.h"
_ENTRY(__bswap32)
_ENTRY_NB(ntohl)
ENTRY_NB(htonl)
eor r1, r0, r0, ror #16
bic r1, r1, #0x00FF0000
mov r0, r0, ror #8
eor r0, r0, r1, lsr #8
mov pc, lr
END(htonl)
_END(ntohl)
_END(__bswap32)
.weak htonl
.weak ntohl

View File

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2004/10/26 04:49:58 mickey Exp $
SRCS+= ntohl.c ntohs.c htons.c htonl.c

View File

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.4 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View File

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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 <machine/asm.h>
/* netorder = htonl(hostorder) */
ENTRY(htonl)
movl 4(%esp),%eax
rorw $8,%ax
roll $16,%eax
rorw $8,%ax
ret

View File

@ -1,39 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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 <machine/asm.h>
/* netorder = htons(hostorder) */
ENTRY(htons)
movzwl 4(%esp),%eax
rorw $8,%ax
ret

View File

@ -1,41 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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 <machine/asm.h>
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
movl 4(%esp),%eax
rorw $8,%ax
roll $16,%eax
rorw $8,%ax
ret

View File

@ -1,39 +0,0 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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 <machine/asm.h>
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
movzwl 4(%esp),%eax
rorw $8,%ax
ret

View File

@ -1,3 +0,0 @@
# $NetBSD: Makefile.inc,v 1.1 1995/02/25 14:58:55 cgd Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View File

@ -1,42 +0,0 @@
/* $OpenBSD: htonl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* 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 "DEFS.h"
/* netorder = htonl(hostorder) */
ENTRY(htonl)
jmp %r1
END(htonl)

View File

@ -1,43 +0,0 @@
/* $OpenBSD: htons.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* 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 "DEFS.h"
/* hostorder = htons(netorder) */
ENTRY(htons)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
END(htons)

View File

@ -1,42 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* 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 "DEFS.h"
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
jmp %r1
END(ntohl)

View File

@ -1,43 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department.
*
* 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 "DEFS.h"
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
END(ntohs)

View File

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.2 2012/09/04 03:10:42 okan Exp $
SRCS+= htonl.S htons.S

View File

@ -1,60 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* 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 <machine/asm.h>
/*
* netorder = htonl(hostorder)
* hostorder = ntohl(netorder)
*/
ALEAF(ntohl)
NLEAF(htonl, 0) # a0 = 0x11223344, return 0x44332211
.set reorder
#ifdef __MIPSEL__
srl v1, a0, 24 # v1 = 0x00000011
sll v0, a0, 24 # v0 = 0x44000000
or v0, v0, v1
and v1, a0, 0xff00
sll v1, v1, 8 # v1 = 0x00330000
or v0, v0, v1
srl v1, a0, 8
and v1, v1, 0xff00 # v1 = 0x00002200
or v0, v0, v1
#else
#ifdef __MIPSEB__
move v0, a0
#else
ERROR
#endif
#endif
j ra
END(htonl)

View File

@ -1,56 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* 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 <machine/asm.h>
/*
* netorder = htons(hostorder)
* hostorder = ntohs(netorder)
*/
ALEAF(ntohs)
NLEAF(htons, 0)
.set reorder
#ifdef __MIPSEL__
srl v0, a0, 8
and v0, v0, 0xff
sll v1, a0, 8
and v1, v1, 0xff00
or v0, v0, v1
#else
#ifdef __MIPSEB__
move v0, a0
#else
ERROR
#endif
#endif
j ra
END(htons)

View File

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View File

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View File

@ -1 +0,0 @@
SRCS += ntohl.c ntohs.c htons.c htonl.c

View File

@ -1,4 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $
# $NetBSD: Makefile.inc,v 1.1 2000/01/05 14:07:36 msaitoh Exp $
SRCS+= htonl.c htons.c ntohl.c ntohs.c

View File

@ -1,58 +0,0 @@
/* $OpenBSD: htonl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htonl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)htonl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef htonl
/* hostorder = htonl(netorder) */
u_int32_t
htonl(x)
u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_int32_t y = 0;
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
#else
return x;
#endif
}

View File

@ -1,52 +0,0 @@
/* $OpenBSD: htons.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htons.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)htonl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef htons
/* netorder = htons(hostorder) */
u_int16_t
htons(x)
u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
#endif
return x;
}

View File

@ -1,58 +0,0 @@
/* $OpenBSD: ntohl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef ntohl
/* netorder = ntohl(hostorder) */
u_int32_t
ntohl(x)
u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_int32_t y = 0;
__asm("swap.b %1, %0" : "=r" (y) : "r" (x));
__asm("swap.w %1, %0" : "=r" (y) : "r" (y));
__asm("swap.b %1, %0" : "=r" (y) : "r" (y));
return y;
#else
return x;
#endif
}

View File

@ -1,52 +0,0 @@
/* $OpenBSD: ntohs.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohs.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
*
* from: @(#)ntohl.s 5.2 (Berkeley) 12/17/90
*/
#include <sys/types.h>
#include <endian.h>
#undef ntohs
/* hostorder = ntohs(netorder) */
u_int16_t
ntohs(x)
u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
__asm("swap.b %1, %0" : "=r" (x) : "r" (x));
#endif
return x;
}

View File

@ -1,3 +0,0 @@
# $OpenBSD: Makefile.inc,v 1.1 2001/08/28 22:06:44 art Exp $
SRCS+= htonl.S htons.S ntohl.S ntohs.S

View File

@ -1,45 +0,0 @@
/* $OpenBSD: htonl.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* 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.
*
* from: Header: htonl.s,v 1.1 92/06/25 12:47:05 torek Exp
*/
#include <machine/asm.h>
/* netorder = htonl(hostorder) */
ENTRY(htonl)
retl
srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */

View File

@ -1,45 +0,0 @@
/* $OpenBSD: htons.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* 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.
*
* from: Header: htons.s,v 1.1 92/06/25 12:47:05 torek Exp
*/
#include <machine/asm.h>
/* netorder = htons(hostorder) */
ENTRY(htons)
sethi %hi(0xffff0000), %o1
signx %o1, %o1
retl
andn %o0, %o1, %o0

View File

@ -1,43 +0,0 @@
/* $OpenBSD: ntohl.S,v 1.2 2003/06/02 20:18:32 millert Exp $ */
/* $NetBSD: ntohl.S,v 1.1 1998/09/11 04:56:31 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* 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.
*
* from: Header: ntohl.s,v 1.1 92/06/25 12:47:06 torek Exp
*/
#include <machine/asm.h>
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
retl
signx %o0, %o0

View File

@ -1,48 +0,0 @@
/* $OpenBSD: ntohs.S,v 1.3 2009/10/28 06:49:55 deraadt Exp $ */
/* $NetBSD: ntohs.S,v 1.1 1998/09/11 04:56:31 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* 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.
*
* from: Header: ntohs.s,v 1.1 92/06/25 12:47:07 torek Exp
*/
#include <machine/asm.h>
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
sethi %hi(0xffff0000), %o1
signx %o1, %o1
retl
andn %o0, %o1, %o0

View File

@ -1,4 +1,4 @@
/* $OpenBSD: opendir.c,v 1.30 2016/09/21 04:38:56 guenther Exp $ */
/* $OpenBSD: opendir.c,v 1.31 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@ -39,7 +39,6 @@
#include "telldir.h"
static DIR *__fdopendir(int fd);
/*
* Open a directory specified by name.
@ -89,7 +88,7 @@ fdopendir(int fd)
}
DEF_WEAK(fdopendir);
static DIR *
DIR *
__fdopendir(int fd)
{
DIR *dirp;

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: scandir.3,v 1.16 2021/06/17 18:18:15 jmc Exp $
.\" $OpenBSD: scandir.3,v 1.17 2024/04/15 15:47:58 florian Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -27,11 +27,12 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd $Mdocdate: June 17 2021 $
.Dd $Mdocdate: April 15 2024 $
.Dt SCANDIR 3
.Os
.Sh NAME
.Nm scandir ,
.Nm scandirat ,
.Nm alphasort
.Nd scan a directory
.Sh SYNOPSIS
@ -45,6 +46,14 @@
.Fa "int (*compar)(const struct dirent **, const struct dirent **)"
.Fc
.Ft int
.Fo scandirat
.Fa "int dirfd"
.Fa "const char *dirname"
.Fa "struct dirent ***namelist"
.Fa "int (*select)(const struct dirent *)"
.Fa "int (*compar)(const struct dirent **, const struct dirent **)"
.Fc
.Ft int
.Fn alphasort "const struct dirent **d1" "const struct dirent **d2"
.Sh DESCRIPTION
The
@ -91,6 +100,30 @@ parameter to sort the array alphabetically.
The memory allocated for the array can be deallocated with
.Xr free 3 ,
by freeing each pointer in the array and then the array itself.
.Pp
The
.Fn scandirat
function is similar to
.Fn scandir ,
but takes an additional
.Fa dirfd
argument.
If
.Fa dirname
is relative,
.Fa dirfd
must be a valid file descriptor referencing a directory, in which case the
.Fa dirname
lookup is performed relative to the directory referenced by
.Fa dirfd .
If
.Fa dirfd
has the special value
.Va AT_FDCWD ,
then the current process directory is used as the base for relative lookups.
See
.Xr openat 2
for additional details.
.Sh DIAGNOSTICS
Returns \-1 if the directory cannot be opened for reading or if
.Xr malloc 3

View File

@ -1,4 +1,4 @@
/* $OpenBSD: scandir.c,v 1.22 2024/04/14 11:21:08 florian Exp $ */
/* $OpenBSD: scandir.c,v 1.23 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@ -39,9 +39,11 @@
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "telldir.h"
#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
@ -57,8 +59,8 @@
((sizeof(struct dirent) - sizeof(dp)->d_name) + \
(((dp)->d_namlen + 1 + 3) &~ 3))
int
scandir(const char *dirname, struct dirent ***namelist,
static int
scandir_dirp(DIR *dirp, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
@ -66,10 +68,7 @@ scandir(const char *dirname, struct dirent ***namelist,
size_t nitems = 0;
struct stat stb;
long arraysz;
DIR *dirp;
if ((dirp = opendir(dirname)) == NULL)
return (-1);
if (fstat(dirp->dd_fd, &stb) == -1)
goto fail;
@ -140,6 +139,38 @@ fail:
return (-1);
}
int
scandir(const char *dirname, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
DIR *dirp;
if ((dirp = opendir(dirname)) == NULL)
return (-1);
return (scandir_dirp(dirp, namelist, select, dcomp));
}
int
scandirat(int dirfd, const char *dirname, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*dcomp)(const struct dirent **, const struct dirent **))
{
DIR *dirp;
int fd;
fd = HIDDEN(openat)(dirfd, dirname, O_RDONLY | O_DIRECTORY | O_CLOEXEC);
if (fd == -1)
return (-1);
dirp = __fdopendir(fd);
if (dirp == NULL) {
HIDDEN(close)(fd);
return (-1);
}
return (scandir_dirp(dirp, namelist, select, dcomp));
}
/*
* Alphabetic order comparison routine for those who want it.
*/

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dirent.h,v 1.1 2015/09/12 13:34:22 guenther Exp $ */
/* $OpenBSD: dirent.h,v 1.2 2024/04/15 15:47:58 florian Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@ -20,6 +20,10 @@
#include_next <dirent.h>
__BEGIN_HIDDEN_DECLS
DIR *__fdopendir(int fd);
__END_HIDDEN_DECLS
PROTO_DEPRECATED(alphasort);
PROTO_NORMAL(closedir);
PROTO_NORMAL(dirfd);
@ -30,6 +34,7 @@ PROTO_NORMAL(readdir);
PROTO_DEPRECATED(readdir_r);
PROTO_DEPRECATED(rewinddir);
PROTO_DEPRECATED(scandir);
PROTO_DEPRECATED(scandirat);
PROTO_NORMAL(seekdir);
PROTO_NORMAL(telldir);

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile.inc,v 1.60 2019/08/30 18:33:17 deraadt Exp $
# $OpenBSD: Makefile.inc,v 1.61 2024/04/15 14:30:48 naddy Exp $
# net sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/net ${LIBCSRCDIR}/net
.PATH: ${LIBCSRCDIR}/net
CFLAGS+=-DRESOLVSORT
@ -10,10 +10,11 @@ SRCS+= base64.c ethers.c freeaddrinfo.c \
getifaddrs.c getnameinfo.c getnetent.c \
getnetnamadr.c getpeereid.c getproto.c getprotoent.c getprotoname.c \
getservbyname.c getservbyport.c getservent.c getrrsetbyname.c \
herror.c if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \
herror.c htonl.c htons.c \
if_indextoname.c if_nameindex.c if_nametoindex.c inet_addr.c \
inet_lnaof.c inet_makeaddr.c inet_neta.c inet_netof.c inet_network.c \
inet_net_ntop.c inet_net_pton.c inet_ntoa.c inet_ntop.c inet_pton.c \
linkaddr.c rcmd.c rcmdsh.c ruserok.c \
linkaddr.c ntohl.c ntohs.c rcmd.c rcmdsh.c ruserok.c \
rresvport.c recv.c res_comp.c res_data.c \
res_debug.c res_debug_syms.c res_init.c res_mkquery.c res_query.c \
res_random.c res_send.c \
@ -22,12 +23,6 @@ SRCS+= base64.c ethers.c freeaddrinfo.c \
# IPv6
SRCS+= ip6opt.c rthdr.c vars6.c
# machine-dependent net sources
# m-d Makefile.inc must include sources for:
# htonl() htons() ntohl() ntohs()
.include "${LIBCSRCDIR}/arch/${MACHINE_CPU}/net/Makefile.inc"
MAN+= htobe64.3 ether_aton.3 gai_strerror.3 getaddrinfo.3 gethostbyname.3 \
getifaddrs.3 getnameinfo.3 getnetent.3 getpeereid.3 getprotoent.3 \
getrrsetbyname.3 getservent.3 htonl.3 if_indextoname.3 \

View File

@ -1,6 +1,5 @@
/* $OpenBSD: htonl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: htonl.c,v 1.8 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef htonl
u_int32_t
htonl(u_int32_t x)
uint32_t
htonl(uint32_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&x;
return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return x;
#endif
return htobe32(x);
}

View File

@ -1,6 +1,5 @@
/* $OpenBSD: htons.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: htons.c,v 1.10 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef htons
u_int16_t
htons(u_int16_t x)
uint16_t
htons(uint16_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif
return htobe16(x);
}

View File

@ -1,6 +1,5 @@
/* $OpenBSD: ntohl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: ntohl.c,v 1.8 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef ntohl
u_int32_t
ntohl(u_int32_t x)
uint32_t
ntohl(uint32_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&x;
return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return x;
#endif
return be32toh(x);
}

View File

@ -1,6 +1,5 @@
/* $OpenBSD: ntohs.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/* $OpenBSD: ntohs.c,v 1.10 2024/04/15 14:30:48 naddy Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
@ -9,13 +8,8 @@
#undef ntohs
u_int16_t
ntohs(u_int16_t x)
uint16_t
ntohs(uint16_t x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif
return be16toh(x);
}

View File

@ -1,4 +1,4 @@
major=99
major=100
minor=0
# note: If changes were made to include/thread_private.h or if system calls
# were added/changed then librthread/shlib_version must also be updated.

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.192 2024/03/29 07:36:38 jsing Exp $
# $OpenBSD: Makefile,v 1.193 2024/04/15 15:55:01 tb Exp $
LIB= crypto
LIBREBUILD=y
@ -69,7 +69,6 @@ SRCS+= malloc-wrapper.c
SRCS+= mem_clr.c
SRCS+= mem_dbg.c
SRCS+= o_fips.c
SRCS+= o_str.c
# aes/
SRCS+= aes.c

View File

@ -197,7 +197,6 @@ ASN1_put_eoc
ASN1_put_object
ASN1_tag2bit
ASN1_tag2str
ASN1_time_tm_clamp_notafter
ASRange_free
ASRange_it
ASRange_new
@ -218,8 +217,6 @@ BF_encrypt
BF_ofb64_encrypt
BF_set_key
BIGNUM_it
BIO_CONNECT_free
BIO_CONNECT_new
BIO_accept
BIO_callback_ctrl
BIO_clear_flags
@ -803,7 +800,6 @@ DH_size
DH_test_flags
DH_up_ref
DHparams_dup
DHparams_it
DHparams_print
DHparams_print_fp
DIRECTORYSTRING_free
@ -824,7 +820,6 @@ DSAPublicKey_it
DSA_OpenSSL
DSA_SIG_free
DSA_SIG_get0
DSA_SIG_it
DSA_SIG_new
DSA_SIG_set0
DSA_bits
@ -880,7 +875,6 @@ ECDSA_SIG_free
ECDSA_SIG_get0
ECDSA_SIG_get0_r
ECDSA_SIG_get0_s
ECDSA_SIG_it
ECDSA_SIG_new
ECDSA_SIG_set0
ECDSA_do_sign
@ -888,12 +882,6 @@ ECDSA_do_verify
ECDSA_sign
ECDSA_size
ECDSA_verify
ECPARAMETERS_free
ECPARAMETERS_it
ECPARAMETERS_new
ECPKPARAMETERS_free
ECPKPARAMETERS_it
ECPKPARAMETERS_new
ECPKParameters_print
ECPKParameters_print_fp
ECParameters_dup
@ -1012,9 +1000,6 @@ EC_POINT_set_compressed_coordinates_GFp
EC_POINT_set_to_infinity
EC_POINTs_make_affine
EC_POINTs_mul
EC_PRIVATEKEY_free
EC_PRIVATEKEY_it
EC_PRIVATEKEY_new
EC_curve_nid2nist
EC_curve_nist2nid
EC_get_builtin_curves
@ -1100,15 +1085,12 @@ ERR_set_mark
ERR_unload_strings
ESS_CERT_ID_dup
ESS_CERT_ID_free
ESS_CERT_ID_it
ESS_CERT_ID_new
ESS_ISSUER_SERIAL_dup
ESS_ISSUER_SERIAL_free
ESS_ISSUER_SERIAL_it
ESS_ISSUER_SERIAL_new
ESS_SIGNING_CERT_dup
ESS_SIGNING_CERT_free
ESS_SIGNING_CERT_it
ESS_SIGNING_CERT_new
EVP_AEAD_CTX_cleanup
EVP_AEAD_CTX_free
@ -1725,8 +1707,6 @@ OPENSSL_init_crypto
OPENSSL_load_builtin_modules
OPENSSL_no_config
OPENSSL_posix_to_tm
OPENSSL_strcasecmp
OPENSSL_strncasecmp
OPENSSL_timegm
OPENSSL_tm_to_posix
OPENSSL_uni2asc
@ -2197,7 +2177,6 @@ TS_ACCURACY_free
TS_ACCURACY_get_micros
TS_ACCURACY_get_millis
TS_ACCURACY_get_seconds
TS_ACCURACY_it
TS_ACCURACY_new
TS_ACCURACY_set_micros
TS_ACCURACY_set_millis
@ -2223,7 +2202,6 @@ TS_MSG_IMPRINT_dup
TS_MSG_IMPRINT_free
TS_MSG_IMPRINT_get_algo
TS_MSG_IMPRINT_get_msg
TS_MSG_IMPRINT_it
TS_MSG_IMPRINT_new
TS_MSG_IMPRINT_print_bio
TS_MSG_IMPRINT_set_algo
@ -2246,7 +2224,6 @@ TS_REQ_get_msg_imprint
TS_REQ_get_nonce
TS_REQ_get_policy_id
TS_REQ_get_version
TS_REQ_it
TS_REQ_new
TS_REQ_print_bio
TS_REQ_set_cert_req
@ -2280,7 +2257,6 @@ TS_RESP_free
TS_RESP_get_status_info
TS_RESP_get_token
TS_RESP_get_tst_info
TS_RESP_it
TS_RESP_new
TS_RESP_print_bio
TS_RESP_set_status_info
@ -2293,7 +2269,6 @@ TS_STATUS_INFO_free
TS_STATUS_INFO_get0_failure_info
TS_STATUS_INFO_get0_status
TS_STATUS_INFO_get0_text
TS_STATUS_INFO_it
TS_STATUS_INFO_new
TS_STATUS_INFO_print_bio
TS_STATUS_INFO_set_status
@ -2318,7 +2293,6 @@ TS_TST_INFO_get_serial
TS_TST_INFO_get_time
TS_TST_INFO_get_tsa
TS_TST_INFO_get_version
TS_TST_INFO_it
TS_TST_INFO_new
TS_TST_INFO_print_bio
TS_TST_INFO_set_accuracy
@ -2540,7 +2514,6 @@ X509_LOOKUP_file
X509_LOOKUP_free
X509_LOOKUP_hash_dir
X509_LOOKUP_mem
X509_NAME_ENTRIES_it
X509_NAME_ENTRY_create_by_NID
X509_NAME_ENTRY_create_by_OBJ
X509_NAME_ENTRY_create_by_txt
@ -2553,7 +2526,6 @@ X509_NAME_ENTRY_new
X509_NAME_ENTRY_set
X509_NAME_ENTRY_set_data
X509_NAME_ENTRY_set_object
X509_NAME_INTERNAL_it
X509_NAME_add_entry
X509_NAME_add_entry_by_NID
X509_NAME_add_entry_by_OBJ
@ -2923,14 +2895,6 @@ X509v3_get_ext_by_NID
X509v3_get_ext_by_OBJ
X509v3_get_ext_by_critical
X509v3_get_ext_count
X9_62_CHARACTERISTIC_TWO_free
X9_62_CHARACTERISTIC_TWO_it
X9_62_CHARACTERISTIC_TWO_new
X9_62_CURVE_it
X9_62_FIELDID_it
X9_62_PENTANOMIAL_free
X9_62_PENTANOMIAL_it
X9_62_PENTANOMIAL_new
ZLONG_it
_CONF_add_string
_CONF_free_data
@ -3007,13 +2971,11 @@ d2i_DSAparams
d2i_DSAparams_bio
d2i_DSAparams_fp
d2i_ECDSA_SIG
d2i_ECPKPARAMETERS
d2i_ECPKParameters
d2i_ECParameters
d2i_ECPrivateKey
d2i_ECPrivateKey_bio
d2i_ECPrivateKey_fp
d2i_EC_PRIVATEKEY
d2i_EC_PUBKEY
d2i_EC_PUBKEY_bio
d2i_EC_PUBKEY_fp
@ -3197,13 +3159,11 @@ i2d_DSAparams
i2d_DSAparams_bio
i2d_DSAparams_fp
i2d_ECDSA_SIG
i2d_ECPKPARAMETERS
i2d_ECPKParameters
i2d_ECParameters
i2d_ECPrivateKey
i2d_ECPrivateKey_bio
i2d_ECPrivateKey_fp
i2d_EC_PRIVATEKEY
i2d_EC_PUBKEY
i2d_EC_PUBKEY_bio
i2d_EC_PUBKEY_fp

View File

@ -1,4 +1,4 @@
/* $OpenBSD: x_name.c,v 1.42 2024/04/09 13:55:02 beck Exp $ */
/* $OpenBSD: x_name.c,v 1.43 2024/04/15 15:52:01 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -159,7 +159,7 @@ static const ASN1_TEMPLATE X509_NAME_ENTRIES_item_tt = {
.item = &X509_NAME_ENTRY_it,
};
const ASN1_ITEM X509_NAME_ENTRIES_it = {
static const ASN1_ITEM X509_NAME_ENTRIES_it = {
.itype = ASN1_ITYPE_PRIMITIVE,
.utype = -1,
.templates = &X509_NAME_ENTRIES_item_tt,
@ -177,7 +177,7 @@ static const ASN1_TEMPLATE X509_NAME_INTERNAL_item_tt = {
.item = &X509_NAME_ENTRIES_it,
};
const ASN1_ITEM X509_NAME_INTERNAL_it = {
static const ASN1_ITEM X509_NAME_INTERNAL_it = {
.itype = ASN1_ITYPE_PRIMITIVE,
.utype = -1,
.templates = &X509_NAME_INTERNAL_item_tt,

View File

@ -1,4 +1,4 @@
/* $OpenBSD: bss_conn.c,v 1.39 2023/07/07 19:37:53 beck Exp $ */
/* $OpenBSD: bss_conn.c,v 1.40 2024/04/15 15:40:08 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -105,8 +105,8 @@ static long conn_callback_ctrl(BIO *h, int cmd, BIO_info_cb *);
static int conn_state(BIO *b, BIO_CONNECT *c);
static void conn_close_socket(BIO *data);
BIO_CONNECT *BIO_CONNECT_new(void);
void BIO_CONNECT_free(BIO_CONNECT *a);
static BIO_CONNECT *BIO_CONNECT_new(void);
static void BIO_CONNECT_free(BIO_CONNECT *a);
static const BIO_METHOD methods_connectp = {
.type = BIO_TYPE_CONNECT,
@ -289,7 +289,7 @@ end:
return (ret);
}
BIO_CONNECT *
static BIO_CONNECT *
BIO_CONNECT_new(void)
{
BIO_CONNECT *ret;
@ -310,7 +310,7 @@ BIO_CONNECT_new(void)
return (ret);
}
void
static void
BIO_CONNECT_free(BIO_CONNECT *a)
{
if (a == NULL)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: bn_lib.c,v 1.90 2023/07/28 10:35:14 tb Exp $ */
/* $OpenBSD: bn_lib.c,v 1.91 2024/04/15 14:35:25 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -438,6 +438,9 @@ BN_clear_bit(BIGNUM *a, int n)
a->d[i] &= (~(((BN_ULONG)1) << j));
bn_correct_top(a);
BN_set_negative(a, a->neg);
return (1);
}
LCRYPTO_ALIAS(BN_clear_bit);
@ -476,6 +479,9 @@ BN_mask_bits(BIGNUM *a, int n)
a->d[w] &= ~(BN_MASK2 << b);
}
bn_correct_top(a);
BN_set_negative(a, a->neg);
return (1);
}
LCRYPTO_ALIAS(BN_mask_bits);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dh_asn1.c,v 1.12 2023/07/08 15:29:03 beck Exp $ */
/* $OpenBSD: dh_asn1.c,v 1.13 2024/04/15 15:47:37 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@ -114,7 +114,7 @@ static const ASN1_TEMPLATE DHparams_seq_tt[] = {
},
};
const ASN1_ITEM DHparams_it = {
static const ASN1_ITEM DHparams_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = DHparams_seq_tt,

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dsa_asn1.c,v 1.31 2023/07/08 14:28:15 beck Exp $ */
/* $OpenBSD: dsa_asn1.c,v 1.32 2024/04/15 15:49:37 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@ -109,7 +109,7 @@ static const ASN1_TEMPLATE DSA_SIG_seq_tt[] = {
},
};
const ASN1_ITEM DSA_SIG_it = {
static const ASN1_ITEM DSA_SIG_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = DSA_SIG_seq_tt,

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ec.h,v 1.47 2024/04/10 15:01:31 beck Exp $ */
/* $OpenBSD: ec.h,v 1.48 2024/04/15 15:42:23 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@ -237,8 +237,6 @@ int EC_GROUP_get_basis_type(const EC_GROUP *);
#define OPENSSL_EC_EXPLICIT_CURVE 0x000
#define OPENSSL_EC_NAMED_CURVE 0x001
typedef struct ecpk_parameters_st ECPKPARAMETERS;
EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ec_asn1.c,v 1.48 2023/07/07 19:37:53 beck Exp $ */
/* $OpenBSD: ec_asn1.c,v 1.52 2024/04/15 15:46:29 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@ -125,14 +125,14 @@ typedef struct ec_parameters_st {
ASN1_INTEGER *cofactor;
} ECPARAMETERS;
struct ecpk_parameters_st {
typedef struct ecpk_parameters_st {
int type;
union {
ASN1_OBJECT *named_curve;
ECPARAMETERS *parameters;
ASN1_NULL *implicitlyCA;
} value;
} /* ECPKPARAMETERS */ ;
} ECPKPARAMETERS;
/* SEC1 ECPrivateKey */
typedef struct ec_privatekey_st {
@ -167,7 +167,7 @@ static const ASN1_TEMPLATE X9_62_PENTANOMIAL_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_PENTANOMIAL_it = {
static const ASN1_ITEM X9_62_PENTANOMIAL_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_PENTANOMIAL_seq_tt,
@ -177,21 +177,6 @@ const ASN1_ITEM X9_62_PENTANOMIAL_it = {
.sname = "X9_62_PENTANOMIAL",
};
X9_62_PENTANOMIAL *X9_62_PENTANOMIAL_new(void);
void X9_62_PENTANOMIAL_free(X9_62_PENTANOMIAL *a);
X9_62_PENTANOMIAL *
X9_62_PENTANOMIAL_new(void)
{
return (X9_62_PENTANOMIAL*)ASN1_item_new(&X9_62_PENTANOMIAL_it);
}
void
X9_62_PENTANOMIAL_free(X9_62_PENTANOMIAL *a)
{
ASN1_item_free((ASN1_VALUE *)a, &X9_62_PENTANOMIAL_it);
}
static const ASN1_TEMPLATE char_two_def_tt = {
.flags = 0,
.tag = 0,
@ -267,7 +252,7 @@ static const ASN1_TEMPLATE X9_62_CHARACTERISTIC_TWO_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
static const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_CHARACTERISTIC_TWO_seq_tt,
@ -277,21 +262,6 @@ const ASN1_ITEM X9_62_CHARACTERISTIC_TWO_it = {
.sname = "X9_62_CHARACTERISTIC_TWO",
};
X9_62_CHARACTERISTIC_TWO *X9_62_CHARACTERISTIC_TWO_new(void);
void X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a);
X9_62_CHARACTERISTIC_TWO *
X9_62_CHARACTERISTIC_TWO_new(void)
{
return (X9_62_CHARACTERISTIC_TWO*)ASN1_item_new(&X9_62_CHARACTERISTIC_TWO_it);
}
void
X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a)
{
ASN1_item_free((ASN1_VALUE *)a, &X9_62_CHARACTERISTIC_TWO_it);
}
static const ASN1_TEMPLATE fieldID_def_tt = {
.flags = 0,
.tag = 0,
@ -349,7 +319,7 @@ static const ASN1_TEMPLATE X9_62_FIELDID_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_FIELDID_it = {
static const ASN1_ITEM X9_62_FIELDID_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_FIELDID_seq_tt,
@ -383,7 +353,7 @@ static const ASN1_TEMPLATE X9_62_CURVE_seq_tt[] = {
},
};
const ASN1_ITEM X9_62_CURVE_it = {
static const ASN1_ITEM X9_62_CURVE_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = X9_62_CURVE_seq_tt,
@ -448,16 +418,16 @@ const ASN1_ITEM ECPARAMETERS_it = {
.sname = "ECPARAMETERS",
};
ECPARAMETERS *ECPARAMETERS_new(void);
void ECPARAMETERS_free(ECPARAMETERS *a);
static ECPARAMETERS *ECPARAMETERS_new(void);
static void ECPARAMETERS_free(ECPARAMETERS *a);
ECPARAMETERS *
static ECPARAMETERS *
ECPARAMETERS_new(void)
{
return (ECPARAMETERS*)ASN1_item_new(&ECPARAMETERS_it);
}
void
static void
ECPARAMETERS_free(ECPARAMETERS *a)
{
ASN1_item_free((ASN1_VALUE *)a, &ECPARAMETERS_it);
@ -497,31 +467,31 @@ const ASN1_ITEM ECPKPARAMETERS_it = {
.sname = "ECPKPARAMETERS",
};
ECPKPARAMETERS *ECPKPARAMETERS_new(void);
void ECPKPARAMETERS_free(ECPKPARAMETERS *a);
ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len);
int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out);
static ECPKPARAMETERS *ECPKPARAMETERS_new(void);
static void ECPKPARAMETERS_free(ECPKPARAMETERS *a);
static ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len);
static int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out);
ECPKPARAMETERS *
static ECPKPARAMETERS *
d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len)
{
return (ECPKPARAMETERS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&ECPKPARAMETERS_it);
}
int
static int
i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out)
{
return ASN1_item_i2d((ASN1_VALUE *)a, out, &ECPKPARAMETERS_it);
}
ECPKPARAMETERS *
static ECPKPARAMETERS *
ECPKPARAMETERS_new(void)
{
return (ECPKPARAMETERS *)ASN1_item_new(&ECPKPARAMETERS_it);
}
void
static void
ECPKPARAMETERS_free(ECPKPARAMETERS *a)
{
ASN1_item_free((ASN1_VALUE *)a, &ECPKPARAMETERS_it);
@ -558,7 +528,7 @@ static const ASN1_TEMPLATE EC_PRIVATEKEY_seq_tt[] = {
},
};
const ASN1_ITEM EC_PRIVATEKEY_it = {
static const ASN1_ITEM EC_PRIVATEKEY_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = EC_PRIVATEKEY_seq_tt,
@ -568,31 +538,31 @@ const ASN1_ITEM EC_PRIVATEKEY_it = {
.sname = "EC_PRIVATEKEY",
};
EC_PRIVATEKEY *EC_PRIVATEKEY_new(void);
void EC_PRIVATEKEY_free(EC_PRIVATEKEY *a);
EC_PRIVATEKEY *d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len);
int i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out);
static EC_PRIVATEKEY *EC_PRIVATEKEY_new(void);
static void EC_PRIVATEKEY_free(EC_PRIVATEKEY *a);
static EC_PRIVATEKEY *d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len);
static int i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out);
EC_PRIVATEKEY *
static EC_PRIVATEKEY *
d2i_EC_PRIVATEKEY(EC_PRIVATEKEY **a, const unsigned char **in, long len)
{
return (EC_PRIVATEKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
&EC_PRIVATEKEY_it);
}
int
static int
i2d_EC_PRIVATEKEY(const EC_PRIVATEKEY *a, unsigned char **out)
{
return ASN1_item_i2d((ASN1_VALUE *)a, out, &EC_PRIVATEKEY_it);
}
EC_PRIVATEKEY *
static EC_PRIVATEKEY *
EC_PRIVATEKEY_new(void)
{
return (EC_PRIVATEKEY *)ASN1_item_new(&EC_PRIVATEKEY_it);
}
void
static void
EC_PRIVATEKEY_free(EC_PRIVATEKEY *a)
{
ASN1_item_free((ASN1_VALUE *)a, &EC_PRIVATEKEY_it);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ecdsa.c,v 1.18 2023/08/08 13:09:28 tb Exp $ */
/* $OpenBSD: ecdsa.c,v 1.19 2024/04/15 15:49:37 tb Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
@ -84,7 +84,7 @@ static const ASN1_TEMPLATE ECDSA_SIG_seq_tt[] = {
},
};
const ASN1_ITEM ECDSA_SIG_it = {
static const ASN1_ITEM ECDSA_SIG_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ECDSA_SIG_seq_tt,

View File

@ -1,4 +1,4 @@
/* $OpenBSD: o_fips.c,v 1.7 2024/04/10 14:51:02 beck Exp $ */
/* $OpenBSD: o_fips.c,v 1.8 2024/04/15 16:05:49 tb Exp $ */
/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
* project 2011.
*/
@ -58,7 +58,7 @@
#include <openssl/err.h>
#include "cryptlib.h"
#include <openssl/crypto.h>
int
FIPS_mode(void)

View File

@ -1,21 +0,0 @@
/* $OpenBSD: o_str.c,v 1.9 2014/07/09 20:22:14 tedu Exp $ */
/*
* Written by Theo de Raadt. Public domain.
*/
#include <string.h>
int OPENSSL_strcasecmp(const char *str1, const char *str2);
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n);
int
OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
{
return strncasecmp(str1, str2, n);
}
int
OPENSSL_strcasecmp(const char *str1, const char *str2)
{
return strcasecmp(str1, str2);
}

View File

@ -1,3 +1,3 @@
# Don't forget to give libssl and libtls the same type of bump!
major=53
major=54
minor=0

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ts_asn1.c,v 1.14 2023/07/07 07:25:21 beck Exp $ */
/* $OpenBSD: ts_asn1.c,v 1.15 2024/04/15 15:52:46 tb Exp $ */
/* Written by Nils Larsch for the OpenSSL project 2004.
*/
/* ====================================================================
@ -80,7 +80,7 @@ static const ASN1_TEMPLATE TS_MSG_IMPRINT_seq_tt[] = {
},
};
const ASN1_ITEM TS_MSG_IMPRINT_it = {
static const ASN1_ITEM TS_MSG_IMPRINT_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_MSG_IMPRINT_seq_tt,
@ -202,7 +202,7 @@ static const ASN1_TEMPLATE TS_REQ_seq_tt[] = {
},
};
const ASN1_ITEM TS_REQ_it = {
static const ASN1_ITEM TS_REQ_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_REQ_seq_tt,
@ -303,7 +303,7 @@ static const ASN1_TEMPLATE TS_ACCURACY_seq_tt[] = {
},
};
const ASN1_ITEM TS_ACCURACY_it = {
static const ASN1_ITEM TS_ACCURACY_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_ACCURACY_seq_tt,
@ -423,7 +423,7 @@ static const ASN1_TEMPLATE TS_TST_INFO_seq_tt[] = {
},
};
const ASN1_ITEM TS_TST_INFO_it = {
static const ASN1_ITEM TS_TST_INFO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_TST_INFO_seq_tt,
@ -524,7 +524,7 @@ static const ASN1_TEMPLATE TS_STATUS_INFO_seq_tt[] = {
},
};
const ASN1_ITEM TS_STATUS_INFO_it = {
static const ASN1_ITEM TS_STATUS_INFO_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_STATUS_INFO_seq_tt,
@ -640,7 +640,7 @@ static const ASN1_TEMPLATE TS_RESP_seq_tt[] = {
},
};
const ASN1_ITEM TS_RESP_it = {
static const ASN1_ITEM TS_RESP_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = TS_RESP_seq_tt,
@ -734,7 +734,7 @@ static const ASN1_TEMPLATE ESS_ISSUER_SERIAL_seq_tt[] = {
},
};
const ASN1_ITEM ESS_ISSUER_SERIAL_it = {
static const ASN1_ITEM ESS_ISSUER_SERIAL_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_ISSUER_SERIAL_seq_tt,
@ -798,7 +798,7 @@ static const ASN1_TEMPLATE ESS_CERT_ID_seq_tt[] = {
},
};
const ASN1_ITEM ESS_CERT_ID_it = {
static const ASN1_ITEM ESS_CERT_ID_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_CERT_ID_seq_tt,
@ -862,7 +862,7 @@ static const ASN1_TEMPLATE ESS_SIGNING_CERT_seq_tt[] = {
},
};
const ASN1_ITEM ESS_SIGNING_CERT_it = {
static const ASN1_ITEM ESS_SIGNING_CERT_it = {
.itype = ASN1_ITYPE_SEQUENCE,
.utype = V_ASN1_SEQUENCE,
.templates = ESS_SIGNING_CERT_seq_tt,

View File

@ -338,7 +338,6 @@ SSL_use_certificate_chain_file
SSL_use_certificate_file
SSL_verify_client_post_handshake
SSL_version
SSL_version_str
SSL_want
SSL_write
SSL_write_early_data

View File

@ -1,3 +1,3 @@
# Don't forget to give libtls the same type of bump!
major=56
major=57
minor=0

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssl_lib.c,v 1.322 2024/03/27 06:47:52 tb Exp $ */
/* $OpenBSD: ssl_lib.c,v 1.323 2024/04/15 16:00:05 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -161,8 +161,6 @@
#include "ssl_tlsext.h"
#include "tls12_internal.h"
const char *SSL_version_str = OPENSSL_VERSION_TEXT;
int
SSL_clear(SSL *s)
{

View File

@ -1,2 +1,2 @@
major=29
major=30
minor=0

View File

@ -1,4 +1,4 @@
/* $OpenBSD: bn_bits.c,v 1.1 2024/04/09 14:59:57 jsing Exp $ */
/* $OpenBSD: bn_bits.c,v 1.2 2024/04/15 14:36:16 jsing Exp $ */
/*
* Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
*
@ -111,12 +111,10 @@ test_bn_clear_bit(void)
fprintf(stderr, "FAIL: clear bit did not result in zero\n");
goto failure;
}
#if 0
if (BN_is_negative(bn)) {
fprintf(stderr, "FAIL: clear bit resulted in -0\n");
goto failure;
}
#endif
failed = 0;
@ -198,12 +196,10 @@ test_bn_mask_bits(void)
fprintf(stderr, "FAIL: mask bits did not result in zero\n");
goto failure;
}
#if 0
if (BN_is_negative(bn)) {
fprintf(stderr, "FAIL: mask bits resulted in -0\n");
goto failure;
}
#endif
failed = 0;

View File

@ -1,4 +1,4 @@
# $OpenBSD: symbols.awk,v 1.10 2024/04/10 16:12:10 tb Exp $
# $OpenBSD: symbols.awk,v 1.11 2024/04/15 16:49:13 tb Exp $
# Copyright (c) 2018,2020 Theo Buehler <tb@openbsd.org>
#
@ -20,38 +20,6 @@ BEGIN {
printf("#include \"include_headers.c\"\n\n")
}
/^DHparams_it$/ ||
/^DSA_SIG_it$/ ||
/^ECDSA_SIG_it$/ ||
/^ECPARAMETERS_it$/ ||
/^ECPKPARAMETERS_it$/ ||
/^EC_PRIVATEKEY_it$/ ||
/^ESS_CERT_ID_it$/ ||
/^ESS_ISSUER_SERIAL_it$/ ||
/^ESS_SIGNING_CERT_it$/ ||
/^NETSCAPE_ENCRYPTED_PKEY_it$/ ||
/^NETSCAPE_PKEY_it$/ ||
/^TS_ACCURACY_it$/ ||
/^TS_MSG_IMPRINT_it$/ ||
/^TS_REQ_it$/ ||
/^TS_RESP_it$/ ||
/^TS_STATUS_INFO_it$/ ||
/^TS_TST_INFO_it$/ ||
/^X509_ATTRIBUTE_SET_it$/ ||
/^X509_NAME_ENTRIES_it$/ ||
/^X509_NAME_INTERNAL_it$/ ||
/^X9_62_CHARACTERISTIC_TWO_it$/ ||
/^X9_62_CURVE_it$/ ||
/^X9_62_FIELDID_it$/ ||
/^X9_62_PENTANOMIAL_it$/ {
printf("extern ASN1_ITEM %s;\n", $0)
}
# internal function used in libtls
/^ASN1_time_tm_clamp_notafter$/ {
printf("extern int ASN1_time_tm_clamp_notafter(struct tm *);\n")
}
# These are machdep.
/^OPENSSL_cpuid_setup$/ ||
/^OPENSSL_cpu_caps$/ {
@ -59,44 +27,6 @@ BEGIN {
next
}
/^OPENSSL_strcasecmp$/ {
printf("extern int %s(const char *, const char *);\n", $0)
}
/^OPENSSL_strncasecmp$/ {
printf("extern int %s(const char *, const char *, size_t);\n", $0)
}
/^BIO_CONNECT_free$/ ||
/^ECPARAMETERS_free$/ ||
/^ECPKPARAMETERS_free$/ ||
/^EC_PRIVATEKEY_free$/ ||
/^X9_62_CHARACTERISTIC_TWO_free$/ ||
/^X9_62_PENTANOMIAL_free$/ {
printf("extern void %s(void *);\n", $0)
}
/^BIO_CONNECT_new$/ ||
/^ECPARAMETERS_new$/ ||
/^ECPKPARAMETERS_new$/ ||
/^EC_PRIVATEKEY_new$/ ||
/^X9_62_CHARACTERISTIC_TWO_new$/ ||
/^X9_62_PENTANOMIAL_new$/ {
printf("extern void *%s(void);\n", $0)
}
/^d2i_ECPKPARAMETERS$/ ||
/^d2i_EC_PRIVATEKEY$/ {
printf("extern void *%s", $0)
printf("(void *, const unsigned char *, const unsigned char *);\n")
}
/^i2d_ECPKPARAMETERS$/ ||
/^i2d_EC_PRIVATEKEY$/ {
printf("extern int %s", $0)
printf("(const void *, unsigned char **);\n")
}
{
symbols[$0] = $0

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: umb.4,v 1.17 2024/01/01 13:04:35 kevlo Exp $
.\" $OpenBSD: umb.4,v 1.18 2024/04/15 06:12:46 jmc Exp $
.\"
.\" Copyright (c) 2016 genua mbH
.\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: January 1 2024 $
.Dd $Mdocdate: April 15 2024 $
.Dt UMB 4
.Os
.Sh NAME
@ -64,6 +64,19 @@ The following devices should work:
.It Sierra Wireless EM8805
.It Sierra Wireless MC8305
.El
.Sh EXAMPLES
The following
.Xr hostname.if 5
example configures umb0 to set the APN to
.Dq internet ,
enabling data roaming,
and obtaining an IP address using IPv6 stateless address autoconfiguration:
.Bd -literal -offset indent
pin 1234
apn internet
inet6 autoconf
roaming
.Ed
.Sh SEE ALSO
.Xr intro 4 ,
.Xr netintro 4 ,

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: pf.conf.5,v 1.600 2022/11/18 18:11:10 kn Exp $
.\" $OpenBSD: pf.conf.5,v 1.602 2024/04/15 14:06:52 jmc Exp $
.\"
.\" Copyright (c) 2002, Daniel Hartmeier
.\" Copyright (c) 2003 - 2013 Henning Brauer <henning@openbsd.org>
@ -28,7 +28,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: November 18 2022 $
.Dd $Mdocdate: April 15 2024 $
.Dt PF.CONF 5
.Os
.Sh NAME
@ -1464,6 +1464,10 @@ which corresponds to the connection state.
Each packet which matches this state will reset the TTL.
Tuning these values may improve the performance of the
firewall at the risk of dropping valid idle connections.
Alternatively, these values may be adjusted collectively
in a manner suitable for a specific environment using
.Cm set optimization
(see above).
.Pp
.Bl -tag -width Ds -compact
.It Cm tcp.closed Pq 90 seconds by default
@ -1486,6 +1490,8 @@ The state after the first packet.
.It Cm tcp.opening Pq 30 seconds by default
The state after the second packet but before both endpoints have
acknowledged the connection.
.It Cm tcp.tsdiff Pq 30 seconds by default
Maximum allowed time difference between RFC 1323 compliant packet timestamps.
.El
.Pp
ICMP and UDP are handled in a fashion similar to TCP, but with a much more
@ -2941,7 +2947,7 @@ state-opt = ( "max" number | "no-sync" | timeout | "sloppy" |
timeout-list = timeout [ [ "," ] timeout-list ]
timeout = ( "tcp.first" | "tcp.opening" | "tcp.established" |
"tcp.closing" | "tcp.finwait" | "tcp.closed" |
"tcp.closing" | "tcp.finwait" | "tcp.closed" | "tcp.tsdiff" |
"udp.first" | "udp.single" | "udp.multiple" |
"icmp.first" | "icmp.error" |
"other.first" | "other.single" | "other.multiple" |

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: port-modules.5,v 1.267 2024/01/01 14:16:59 semarie Exp $
.\" $OpenBSD: port-modules.5,v 1.268 2024/04/15 16:11:01 bentley Exp $
.\"
.\" Copyright (c) 2008 Marc Espie
.\"
@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: January 1 2024 $
.Dd $Mdocdate: April 15 2024 $
.Dt PORT-MODULES 5
.Os
.Sh NAME
@ -689,18 +689,16 @@ and
Appends to
.Ev CATEGORIES .
When
.Ev TYPEFACE
.Ev MODFONT_FAMILY
is set in combination with
.Ev V
or
.Ev VERSION ,
.Ev MODFONT_VERSION ,
it sets
.Ev PKGNAME .
.Ev TYPEFACE
should be set to the name of the typeface.
.Ev MODFONT_FAMILY
should be set to the name of the font family.
This sets
.Ev FONTDIR
using said typeface name.
.Ev MODFONT_DIR
using said family name.
A
.Cm do-install
target is provided if the port itself does not provide it.
@ -708,7 +706,7 @@ This installs fonts from
.Ev WRKSRC
in the distribution.
If one or more file extensions are listed in
.Ev FONTTYPES ,
.Ev MODFONT_TYPES ,
files of those types will be used.
Otherwise, otf files are preferred, with a fallback to ttf.
.It fortran

View File

@ -1,4 +1,4 @@
/* $OpenBSD: nvme.c,v 1.107 2023/12/20 13:37:25 krw Exp $ */
/* $OpenBSD: nvme.c,v 1.109 2024/04/15 14:25:10 krw Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@ -60,7 +60,7 @@ void * nvme_ccb_get(void *);
void nvme_ccb_put(void *, void *);
int nvme_poll(struct nvme_softc *, struct nvme_queue *, struct nvme_ccb *,
void (*)(struct nvme_softc *, struct nvme_ccb *, void *));
void (*)(struct nvme_softc *, struct nvme_ccb *, void *), u_int32_t);
void nvme_poll_fill(struct nvme_softc *, struct nvme_ccb *, void *);
void nvme_poll_done(struct nvme_softc *, struct nvme_ccb *,
struct nvme_cqe *);
@ -134,6 +134,10 @@ static const struct nvme_ops nvme_ops = {
.op_cq_done = nvme_op_cq_done,
};
#define NVME_TIMO_QOP 5000 /* ms to create/delete queue */
#define NVME_TIMO_IDENT 10000 /* ms to probe/identify */
#define NVME_TIMO_DELAYNS 10 /* ns to delay() in poll loop */
/*
* Some controllers, at least Apple NVMe, always require split
* transfers, so don't use bus_space_{read,write}_8() on LP64.
@ -197,28 +201,46 @@ nvme_dumpregs(struct nvme_softc *sc)
int
nvme_ready(struct nvme_softc *sc, u_int32_t rdy)
{
u_int i = 0;
u_int32_t csts;
u_int i;
while ((nvme_read4(sc, NVME_CSTS) & NVME_CSTS_RDY) != rdy) {
if (i++ > sc->sc_rdy_to)
return (1);
for (i = 0; i <= sc->sc_rdy_to; i++) {
csts = nvme_read4(sc, NVME_CSTS);
/* enable fails if fatal error, disable succeeds. */
if (csts == 0xffffffff || ISSET(csts, NVME_CSTS_CFS))
return (rdy == NVME_CSTS_RDY);
if ((csts & NVME_CSTS_RDY) == rdy)
return (0);
delay(1000);
nvme_barrier(sc, NVME_CSTS, 4, BUS_SPACE_BARRIER_READ);
}
return (0);
return (1);
}
int
nvme_enable(struct nvme_softc *sc)
{
u_int32_t cc;
u_int32_t cc, csts;
cc = nvme_read4(sc, NVME_CC);
if (ISSET(cc, NVME_CC_EN))
if (cc != 0xffffffff && ISSET(cc, NVME_CC_EN))
return (nvme_ready(sc, NVME_CSTS_RDY));
csts = nvme_read4(sc, NVME_CSTS);
if (csts != 0xffffffff && ISSET(csts, NVME_CSTS_RDY)) {
/*
* Ensure CSTS.RDY is 0.
*
* Transitioning CC.EN from 0 to 1 when CSTS.RDY is 1
* "has undefined results" says NVMe.
*/
if (nvme_ready(sc, 0))
return (1);
}
if (sc->sc_ops->op_enable != NULL)
sc->sc_ops->op_enable(sc);
@ -254,10 +276,18 @@ nvme_disable(struct nvme_softc *sc)
u_int32_t cc, csts;
cc = nvme_read4(sc, NVME_CC);
if (ISSET(cc, NVME_CC_EN)) {
csts = nvme_read4(sc, NVME_CSTS);
if (!ISSET(csts, NVME_CSTS_CFS) &&
nvme_ready(sc, NVME_CSTS_RDY) != 0)
if (!ISSET(cc, NVME_CC_EN))
return (nvme_ready(sc, 0));
csts = nvme_read4(sc, NVME_CSTS);
if (!ISSET(csts, NVME_CSTS_RDY)) {
/*
* Ensure CSTS.RDY is 1.
*
* Transitioning CC.EN from 1 to 0 when CSTS.RDY is 0
* "has undefined results" says NVMe.
*/
if (nvme_ready(sc, NVME_CSTS_RDY))
return (1);
}
@ -464,7 +494,7 @@ nvme_scsi_probe(struct scsi_link *link)
ccb->ccb_cookie = &sqe;
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_PREREAD);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_IDENT);
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_POSTREAD);
scsi_io_put(&sc->sc_iopool, ccb);
@ -509,6 +539,8 @@ nvme_shutdown(struct nvme_softc *sc)
nvme_barrier(sc, 0, sc->sc_ios,
BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
csts = nvme_read4(sc, NVME_CSTS);
if (csts == 0xffffffff)
break;
if ((csts & NVME_CSTS_SHST_MASK) == NVME_CSTS_SHST_DONE)
return (0);
@ -637,7 +669,7 @@ nvme_scsi_io(struct scsi_xfer *xs, int dir)
}
if (ISSET(xs->flags, SCSI_POLL)) {
nvme_poll(sc, sc->sc_q, ccb, nvme_scsi_io_fill);
nvme_poll(sc, sc->sc_q, ccb, nvme_scsi_io_fill, xs->timeout);
return;
}
@ -724,7 +756,7 @@ nvme_scsi_sync(struct scsi_xfer *xs)
ccb->ccb_cookie = xs;
if (ISSET(xs->flags, SCSI_POLL)) {
nvme_poll(sc, sc->sc_q, ccb, nvme_scsi_sync_fill);
nvme_poll(sc, sc->sc_q, ccb, nvme_scsi_sync_fill, xs->timeout);
return;
}
@ -963,11 +995,13 @@ struct nvme_poll_state {
int
nvme_poll(struct nvme_softc *sc, struct nvme_queue *q, struct nvme_ccb *ccb,
void (*fill)(struct nvme_softc *, struct nvme_ccb *, void *))
void (*fill)(struct nvme_softc *, struct nvme_ccb *, void *), u_int32_t ms)
{
struct nvme_poll_state state;
void (*done)(struct nvme_softc *, struct nvme_ccb *, struct nvme_cqe *);
void *cookie;
int64_t us;
u_int32_t csts;
u_int16_t flags;
memset(&state, 0, sizeof(state));
@ -980,11 +1014,17 @@ nvme_poll(struct nvme_softc *sc, struct nvme_queue *q, struct nvme_ccb *ccb,
ccb->ccb_cookie = &state;
nvme_q_submit(sc, q, ccb, nvme_poll_fill);
while (!ISSET(state.c.flags, htole16(NVME_CQE_PHASE))) {
for (us = ms * 1000; ms == 0 || us > 0; us -= NVME_TIMO_DELAYNS) {
if (ISSET(state.c.flags, htole16(NVME_CQE_PHASE)))
break;
csts = nvme_read4(sc, NVME_CSTS);
if (csts == 0xffffffff || ISSET(csts, NVME_CSTS_CFS)) {
SET(state.c.flags, htole16(NVME_CQE_SC_INTERNAL_DEV_ERR));
break;
}
if (nvme_q_complete(sc, q) == 0)
delay(10);
/* XXX no timeout? */
delay(NVME_TIMO_DELAYNS);
nvme_barrier(sc, NVME_CSTS, 4, BUS_SPACE_BARRIER_READ);
}
ccb->ccb_cookie = cookie;
@ -1100,7 +1140,8 @@ nvme_identify(struct nvme_softc *sc, u_int mpsmin)
ccb->ccb_cookie = mem;
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_PREREAD);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_fill_identify);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_fill_identify,
NVME_TIMO_IDENT);
nvme_dmamem_sync(sc, mem, BUS_DMASYNC_POSTREAD);
nvme_ccb_put(sc, ccb);
@ -1165,7 +1206,7 @@ nvme_q_create(struct nvme_softc *sc, struct nvme_queue *q)
htolem16(&sqe.qid, q->q_id);
sqe.qflags = NVM_SQE_CQ_IEN | NVM_SQE_Q_PC;
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_QOP);
if (rv != 0)
goto fail;
@ -1180,7 +1221,7 @@ nvme_q_create(struct nvme_softc *sc, struct nvme_queue *q)
htolem16(&sqe.cqid, q->q_id);
sqe.qflags = NVM_SQE_Q_PC;
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_QOP);
if (rv != 0)
goto fail;
@ -1206,7 +1247,7 @@ nvme_q_delete(struct nvme_softc *sc, struct nvme_queue *q)
sqe.opcode = NVM_ADMIN_DEL_IOSQ;
htolem16(&sqe.qid, q->q_id);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_QOP);
if (rv != 0)
goto fail;
@ -1217,7 +1258,7 @@ nvme_q_delete(struct nvme_softc *sc, struct nvme_queue *q)
sqe.opcode = NVM_ADMIN_DEL_IOCQ;
htolem16(&sqe.qid, q->q_id);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill);
rv = nvme_poll(sc, sc->sc_admin_q, ccb, nvme_sqe_fill, NVME_TIMO_QOP);
if (rv != 0)
goto fail;

View File

@ -1,10 +1,10 @@
/* $OpenBSD: init_sysent.c,v 1.277 2024/04/05 14:15:37 deraadt Exp $ */
/* $OpenBSD: init_sysent.c,v 1.278 2024/04/15 15:09:26 claudio Exp $ */
/*
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
* created from; OpenBSD: syscalls.master,v 1.260 2024/04/05 14:15:13 deraadt Exp
* created from; OpenBSD: syscalls.master,v 1.261 2024/04/15 15:08:20 claudio Exp
*/
#include <sys/param.h>
@ -254,7 +254,7 @@ const struct sysent sysent[] = {
sys_ppoll }, /* 109 = ppoll */
{ 6, s(struct sys_pselect_args), SY_NOLOCK | 0,
sys_pselect }, /* 110 = pselect */
{ 1, s(struct sys_sigsuspend_args), 0,
{ 1, s(struct sys_sigsuspend_args), SY_NOLOCK | 0,
sys_sigsuspend }, /* 111 = sigsuspend */
{ 3, s(struct sys_sendsyslog_args), SY_NOLOCK | 0,
sys_sendsyslog }, /* 112 = sendsyslog */
@ -695,7 +695,7 @@ const struct sysent sysent[] = {
sys___thrwakeup }, /* 301 = __thrwakeup */
{ 1, s(struct sys___threxit_args), 0,
sys___threxit }, /* 302 = __threxit */
{ 3, s(struct sys___thrsigdivert_args), 0,
{ 3, s(struct sys___thrsigdivert_args), SY_NOLOCK | 0,
sys___thrsigdivert }, /* 303 = __thrsigdivert */
{ 2, s(struct sys___getcwd_args), 0,
sys___getcwd }, /* 304 = __getcwd */

View File

@ -1,10 +1,10 @@
/* $OpenBSD: syscalls.c,v 1.275 2024/04/05 14:15:37 deraadt Exp $ */
/* $OpenBSD: syscalls.c,v 1.276 2024/04/15 15:09:26 claudio Exp $ */
/*
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
* created from; OpenBSD: syscalls.master,v 1.260 2024/04/05 14:15:13 deraadt Exp
* created from; OpenBSD: syscalls.master,v 1.261 2024/04/15 15:08:20 claudio Exp
*/
const char *const syscallnames[] = {

View File

@ -1,4 +1,4 @@
; $OpenBSD: syscalls.master,v 1.260 2024/04/05 14:15:13 deraadt Exp $
; $OpenBSD: syscalls.master,v 1.261 2024/04/15 15:08:20 claudio Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -234,7 +234,7 @@
110 STD NOLOCK { int sys_pselect(int nd, fd_set *in, fd_set *ou, \
fd_set *ex, const struct timespec *ts, \
const sigset_t *mask); }
111 STD { int sys_sigsuspend(int mask); }
111 STD NOLOCK { int sys_sigsuspend(int mask); }
112 STD NOLOCK { int sys_sendsyslog(const char *buf, size_t nbyte, \
int flags); }
113 UNIMPL fktrace
@ -525,7 +525,7 @@
301 STD NOLOCK { int sys___thrwakeup(const volatile void *ident, \
int n); }
302 STD { void sys___threxit(pid_t *notdead); }
303 STD { int sys___thrsigdivert(sigset_t sigmask, \
303 STD NOLOCK { int sys___thrsigdivert(sigset_t sigmask, \
siginfo_t *info, const struct timespec *timeout); }
304 STD { int sys___getcwd(char *buf, size_t len); }
305 STD NOLOCK { int sys_adjfreq(const int64_t *freq, \

View File

@ -1,4 +1,4 @@
/* $OpenBSD: uipc_socket.c,v 1.329 2024/04/11 13:32:51 mvs Exp $ */
/* $OpenBSD: uipc_socket.c,v 1.330 2024/04/15 21:31:29 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@ -159,8 +159,6 @@ soalloc(const struct protosw *prp, int wait)
case AF_INET6:
switch (prp->pr_type) {
case SOCK_DGRAM:
so->so_rcv.sb_flags |= SB_MTXLOCK;
break;
case SOCK_RAW:
so->so_rcv.sb_flags |= SB_MTXLOCK | SB_OWNLOCK;
break;
@ -819,7 +817,7 @@ soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
struct mbuf *m, **mp;
struct mbuf *cm;
u_long len, offset, moff;
int flags, error, type, uio_error = 0;
int flags, error, error2, type, uio_error = 0;
const struct protosw *pr = so->so_proto;
struct mbuf *nextrecord;
size_t resid, orig_resid = uio->uio_resid;
@ -889,10 +887,10 @@ restart:
panic("receive 1: so %p, so_type %d, sb_cc %lu",
so, so->so_type, so->so_rcv.sb_cc);
#endif
if (so->so_error) {
if ((error2 = READ_ONCE(so->so_error))) {
if (m)
goto dontblock;
error = so->so_error;
error = error2;
if ((flags & MSG_PEEK) == 0)
so->so_error = 0;
goto release;
@ -1289,7 +1287,13 @@ sorflush_locked(struct socket *so)
error = sblock(so, sb, SBL_WAIT | SBL_NOINTR);
/* with SBL_WAIT and SLB_NOINTR sblock() must not fail */
KASSERT(error == 0);
if (sb->sb_flags & SB_OWNLOCK)
solock(so);
socantrcvmore(so);
if (sb->sb_flags & SB_OWNLOCK)
sounlock(so);
mtx_enter(&sb->sb_mtx);
m = sb->sb_mb;
memset(&sb->sb_startzero, 0,
@ -1323,13 +1327,17 @@ sorflush(struct socket *so)
int
sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
{
struct file *fp;
struct file *fp = NULL;
struct socket *sosp;
struct sosplice *sp;
struct taskq *tq;
int error = 0;
soassertlocked(so);
if ((so->so_proto->pr_flags & PR_SPLICE) == 0)
return (EPROTONOSUPPORT);
if (max && max < 0)
return (EINVAL);
if (tv && (tv->tv_sec < 0 || !timerisvalid(tv)))
return (EINVAL);
if (sosplice_taskq == NULL) {
rw_enter_write(&sosplice_lock);
@ -1350,63 +1358,51 @@ sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
membar_consumer();
}
if ((so->so_proto->pr_flags & PR_SPLICE) == 0)
return (EPROTONOSUPPORT);
if (so->so_options & SO_ACCEPTCONN)
return (EOPNOTSUPP);
if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
(so->so_proto->pr_flags & PR_CONNREQUIRED))
return (ENOTCONN);
if (so->so_sp == NULL) {
sp = pool_get(&sosplice_pool, PR_WAITOK | PR_ZERO);
if (so->so_sp == NULL)
so->so_sp = sp;
else
pool_put(&sosplice_pool, sp);
if (so->so_rcv.sb_flags & SB_OWNLOCK) {
if ((error = sblock(so, &so->so_rcv, SBL_WAIT)) != 0)
return (error);
solock(so);
} else {
solock(so);
if ((error = sblock(so, &so->so_rcv, SBL_WAIT)) != 0) {
sounlock(so);
return (error);
}
}
if (so->so_options & SO_ACCEPTCONN) {
error = EOPNOTSUPP;
goto out;
}
if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 &&
(so->so_proto->pr_flags & PR_CONNREQUIRED)) {
error = ENOTCONN;
goto out;
}
if (so->so_sp == NULL)
so->so_sp = pool_get(&sosplice_pool, PR_WAITOK | PR_ZERO);
/* If no fd is given, unsplice by removing existing link. */
if (fd < 0) {
/* Lock receive buffer. */
if ((error = sblock(so, &so->so_rcv, SBL_WAIT)) != 0) {
return (error);
}
if (so->so_sp->ssp_socket)
sounsplice(so, so->so_sp->ssp_socket, 0);
sbunlock(so, &so->so_rcv);
return (0);
goto out;
}
if (max && max < 0)
return (EINVAL);
if (tv && (tv->tv_sec < 0 || !timerisvalid(tv)))
return (EINVAL);
/* Find sosp, the drain socket where data will be spliced into. */
if ((error = getsock(curproc, fd, &fp)) != 0)
return (error);
goto out;
sosp = fp->f_data;
if (sosp->so_proto->pr_usrreqs->pru_send !=
so->so_proto->pr_usrreqs->pru_send) {
error = EPROTONOSUPPORT;
goto frele;
}
if (sosp->so_sp == NULL) {
sp = pool_get(&sosplice_pool, PR_WAITOK | PR_ZERO);
if (sosp->so_sp == NULL)
sosp->so_sp = sp;
else
pool_put(&sosplice_pool, sp);
goto out;
}
if (sosp->so_sp == NULL)
sosp->so_sp = pool_get(&sosplice_pool, PR_WAITOK | PR_ZERO);
/* Lock both receive and send buffer. */
if ((error = sblock(so, &so->so_rcv, SBL_WAIT)) != 0) {
goto frele;
}
if ((error = sblock(so, &sosp->so_snd, SBL_WAIT)) != 0) {
sbunlock(so, &so->so_rcv);
goto frele;
goto out;
}
if (so->so_sp->ssp_socket || sosp->so_sp->ssp_soback) {
@ -1423,8 +1419,10 @@ sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
}
/* Splice so and sosp together. */
mtx_enter(&so->so_rcv.sb_mtx);
so->so_sp->ssp_socket = sosp;
sosp->so_sp->ssp_soback = so;
mtx_leave(&so->so_rcv.sb_mtx);
so->so_splicelen = 0;
so->so_splicemax = max;
if (tv)
@ -1447,17 +1445,18 @@ sosplice(struct socket *so, int fd, off_t max, struct timeval *tv)
release:
sbunlock(sosp, &sosp->so_snd);
sbunlock(so, &so->so_rcv);
frele:
/*
* FRELE() must not be called with the socket lock held. It is safe to
* release the lock here as long as no other operation happen on the
* socket when sosplice() returns. The dance could be avoided by
* grabbing the socket lock inside this function.
*/
sounlock(so);
FRELE(fp, curproc);
solock(so);
out:
if (so->so_rcv.sb_flags & SB_OWNLOCK) {
sounlock(so);
sbunlock(so, &so->so_rcv);
} else {
sbunlock(so, &so->so_rcv);
sounlock(so);
}
if (fp)
FRELE(fp, curproc);
return (error);
}
@ -1469,10 +1468,12 @@ sounsplice(struct socket *so, struct socket *sosp, int freeing)
task_del(sosplice_taskq, &so->so_splicetask);
timeout_del(&so->so_idleto);
sosp->so_snd.sb_flags &= ~SB_SPLICE;
mtx_enter(&so->so_rcv.sb_mtx);
so->so_rcv.sb_flags &= ~SB_SPLICE;
mtx_leave(&so->so_rcv.sb_mtx);
so->so_sp->ssp_socket = sosp->so_sp->ssp_soback = NULL;
mtx_leave(&so->so_rcv.sb_mtx);
/* Do not wakeup a socket that is about to be freed. */
if ((freeing & SOSP_FREEING_READ) == 0 && soreadable(so))
sorwakeup(so);
@ -2025,7 +2026,6 @@ sosetopt(struct socket *so, int level, int optname, struct mbuf *m)
break;
#ifdef SOCKET_SPLICE
case SO_SPLICE:
solock(so);
if (m == NULL) {
error = sosplice(so, -1, 0, NULL);
} else if (m->m_len < sizeof(int)) {
@ -2038,7 +2038,6 @@ sosetopt(struct socket *so, int level, int optname, struct mbuf *m)
mtod(m, struct splice *)->sp_max,
&mtod(m, struct splice *)->sp_idle);
}
sounlock(so);
break;
#endif /* SOCKET_SPLICE */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: in_pcb.h,v 1.154 2024/03/22 21:48:38 bluhm Exp $ */
/* $OpenBSD: in_pcb.h,v 1.155 2024/04/15 18:31:04 bluhm Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@ -176,9 +176,6 @@ struct inpcb {
#define inp_flowinfo inp_hu.hu_ipv6.ip6_flow
int inp_cksum6;
#ifndef _KERNEL
#define inp_csumoffset inp_cksum6
#endif
struct icmp6_filter *inp_icmp6filt;
struct pf_state_key *inp_pf_sk; /* [L] */
struct mbuf *(*inp_upcall)(void *, struct mbuf *,

View File

@ -1,10 +1,10 @@
/* $OpenBSD: syscall.h,v 1.274 2024/04/05 14:15:37 deraadt Exp $ */
/* $OpenBSD: syscall.h,v 1.275 2024/04/15 15:09:26 claudio Exp $ */
/*
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
* created from; OpenBSD: syscalls.master,v 1.260 2024/04/05 14:15:13 deraadt Exp
* created from; OpenBSD: syscalls.master,v 1.261 2024/04/15 15:08:20 claudio Exp
*/
/* syscall: "exit" ret: "void" args: "int" */

View File

@ -1,10 +1,10 @@
/* $OpenBSD: syscallargs.h,v 1.277 2024/04/05 14:15:37 deraadt Exp $ */
/* $OpenBSD: syscallargs.h,v 1.278 2024/04/15 15:09:26 claudio Exp $ */
/*
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
* created from; OpenBSD: syscalls.master,v 1.260 2024/04/05 14:15:13 deraadt Exp
* created from; OpenBSD: syscalls.master,v 1.261 2024/04/15 15:08:20 claudio Exp
*/
#ifdef syscallarg

View File

@ -1,4 +1,4 @@
/* $OpenBSD: arguments.c,v 1.62 2023/11/14 20:01:11 nicm Exp $ */
/* $OpenBSD: arguments.c,v 1.63 2024/04/15 08:19:55 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -171,6 +171,8 @@ args_parse_flag_argument(struct args_value *values, u_int count, char **cause,
if (optional_argument) {
log_debug("%s: -%c (optional)", __func__, flag);
args_set(args, flag, NULL, ARGS_ENTRY_OPTIONAL_VALUE);
args_free_value(new);
free(new);
return (0); /* either - or end */
}
xasprintf(cause, "-%c expects an argument", flag);
@ -662,6 +664,8 @@ args_set(struct args *args, u_char flag, struct args_value *value, int flags)
entry->count++;
if (value != NULL && value->type != ARGS_NONE)
TAILQ_INSERT_TAIL(&entry->values, value, entry);
else
free(value);
}
/* Get argument value. Will be NULL if it isn't present. */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cmd-command-prompt.c,v 1.66 2023/03/15 08:15:39 nicm Exp $ */
/* $OpenBSD: cmd-command-prompt.c,v 1.67 2024/04/15 08:19:55 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -143,6 +143,7 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
cdata->prompt_type = status_prompt_type(type);
if (cdata->prompt_type == PROMPT_TYPE_INVALID) {
cmdq_error(item, "unknown type: %s", type);
cmd_command_prompt_free(cdata);
return (CMD_RETURN_ERROR);
}
} else

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cmd-confirm-before.c,v 1.53 2023/04/28 06:12:27 nicm Exp $ */
/* $OpenBSD: cmd-confirm-before.c,v 1.54 2024/04/15 08:19:55 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@ -76,8 +76,10 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item)
cdata = xcalloc(1, sizeof *cdata);
cdata->cmdlist = args_make_commands_now(self, item, 0, 1);
if (cdata->cmdlist == NULL)
if (cdata->cmdlist == NULL) {
free(cdata);
return (CMD_RETURN_ERROR);
}
if (wait)
cdata->item = item;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: layout-custom.c,v 1.22 2023/02/02 09:24:59 nicm Exp $ */
/* $OpenBSD: layout-custom.c,v 1.23 2024/04/15 08:19:55 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -230,7 +230,7 @@ layout_parse(struct window *w, const char *layout, char **cause)
/* Check the new layout. */
if (!layout_check(lc)) {
*cause = xstrdup("size mismatch after applying layout");
return (-1);
goto fail;
}
/* Resize to the layout size. */

View File

@ -165,7 +165,7 @@ log_notification(const struct peer *peer, uint8_t errcode, uint8_t subcode,
if (ibuf_get_n8(&ibuf, &capa_code) == -1)
break;
logit(LOG_ERR, "%s: %s notification: %s, %s: %s",
p, dir, errnames[errcode], suberrname,
log_capability(capa_code));

View File

@ -2514,7 +2514,7 @@ parse_notification(struct peer *peer)
/* XXX */
ibuf_from_buffer(&ibuf, p, datalen);
if (ibuf_get_n8(&ibuf, &errcode) == -1 ||
ibuf_get_n8(&ibuf, &subcode) == -1) {
log_peer_warnx(&peer->conf, "received bad notification");

View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -12,11 +12,11 @@
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 11 (pkg-config-0.29.1)
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright (c) 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright (c) 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@ -55,7 +55,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@ -100,7 +100,7 @@ dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@ -166,17 +166,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
@ -187,8 +187,8 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
@ -198,10 +198,10 @@ _PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
$3
fi[]dnl
])dnl PKG_CHECK_MODULES

Some files were not shown because too many files have changed in this diff Show More