Skip to content

Commit 22d701b

Browse files
Pull up following revision(s) (requested by mrg in ticket #1174):
tools/compat/configure.ac: revision 1.111 (patch) tools/compat/compat_defs.h: revision 1.126 (patch) tools/compat/compat_defs.h: revision 1.127 (patch) bin/pax/options.c: revision 1.120 tools/compat/nbtool_config.h.in: revision 1.59 (patch) tools/compat/Makefile: revision 1.95 (patch) tools/compat/configure.ac: revision 1.110 (patch) pax: need <strings.h> for ffs() Fixes warning as host tool on NetBSD 9.99 Add more functions needed by mandoc add vsyslog decl check
1 parent 69a4677 commit 22d701b

File tree

5 files changed

+60
-17
lines changed

5 files changed

+60
-17
lines changed

bin/pax/options.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $ */
1+
/* $NetBSD: options.c,v 1.119.6.1 2025/10/19 09:48:29 martin Exp $ */
22

33
/*-
44
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
4242
#if 0
4343
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
4444
#else
45-
__RCSID("$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $");
45+
__RCSID("$NetBSD: options.c,v 1.119.6.1 2025/10/19 09:48:29 martin Exp $");
4646
#endif
4747
#endif /* not lint */
4848

@@ -61,6 +61,7 @@ __RCSID("$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $");
6161
#include <stdio.h>
6262
#include <stdlib.h>
6363
#include <string.h>
64+
#include <strings.h>
6465
#include <unistd.h>
6566
#include <inttypes.h>
6667
#include <paths.h>

tools/compat/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.90.2.1 2024/11/17 13:32:52 martin Exp $
1+
# $NetBSD: Makefile,v 1.90.2.2 2025/10/19 09:48:29 martin Exp $
22

33
HOSTLIB= nbcompat
44

@@ -10,7 +10,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
1010
heapsort.c getsubopt.c \
1111
issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
1212
md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
13-
mi_vector_hash.c mkdtemp.c \
13+
mi_vector_hash.c mkdtemp.c mkstemps.c \
1414
mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
1515
pw_scan.c \
1616
raise_default_signal.c rb.c reallocarr.c reallocarray.c \
@@ -22,8 +22,8 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
2222
shquote.c \
2323
snprintb.c snprintf.c \
2424
stat_flags.c strlcat.c strlcpy.c strmode.c \
25-
strcasecmp.c strncasecmp.c strndup.c strnlen.c \
26-
strsep.c strsuftoll.c strtoll.c \
25+
strcasecmp.c strncasecmp.c strcasestr.c strndup.c strnlen.c \
26+
strsep.c strsuftoll.c strtonum.c strtoll.c \
2727
strtoi.c strtou.c \
2828
unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
2929
vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \

tools/compat/compat_defs.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: compat_defs.h,v 1.120.4.1 2024/11/17 13:32:52 martin Exp $ */
1+
/* $NetBSD: compat_defs.h,v 1.120.4.2 2025/10/19 09:48:29 martin Exp $ */
22

33
#ifndef __NETBSD_COMPAT_DEFS_H__
44
#define __NETBSD_COMPAT_DEFS_H__
@@ -448,6 +448,10 @@ int issetugid(void);
448448
int mkstemp(char *);
449449
#endif
450450

451+
#if !HAVE_DECL_MKSTEMPS
452+
int mkstemps(char *, int);
453+
#endif
454+
451455
#if !HAVE_DECL_MKDTEMP
452456
char *mkdtemp(char *);
453457
#endif
@@ -539,6 +543,9 @@ int strcasecmp(const char *, const char *);
539543
#if !HAVE_DECL_STRNCASECMP
540544
int strncasecmp(const char *, const char *, size_t);
541545
#endif
546+
#if !HAVE_DECL_STRCASESTR
547+
char *strcasestr(const char *, const char *);
548+
#endif
542549
#if !HAVE_DECL_LCHFLAGS
543550
int lchflags(const char *, unsigned long);
544551
#endif
@@ -615,6 +622,10 @@ long long strsuftollx(const char *, const char *,
615622
long long strtoll(const char *, char **, int);
616623
#endif
617624

625+
#if !HAVE_DECL_STRTONUM
626+
long long strtonum(const char *, long long, long long, const char **);
627+
#endif
628+
618629
#if !HAVE_DECL_STRTOI
619630
intmax_t strtoi(const char * __restrict, char ** __restrict, int,
620631
intmax_t, intmax_t, int *);
@@ -645,6 +656,10 @@ int vasnprintf(char **, size_t, const char *, va_list);
645656
int vsnprintf(char *, size_t, const char *, va_list);
646657
#endif
647658

659+
#if !HAVE_DECL_VSYSLOG
660+
void vsyslog(int, const char *, va_list);
661+
#endif
662+
648663
/*
649664
* getmode() and setmode() are always defined, as these function names
650665
* exist but with very different meanings on other OS's. The compat

tools/compat/configure.ac

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: configure.ac,v 1.99.6.2 2024/11/17 13:32:52 martin Exp $
1+
# $NetBSD: configure.ac,v 1.99.6.3 2025/10/19 09:48:29 martin Exp $
22
#
33
# Autoconf definition file for libnbcompat.
44
#
@@ -175,13 +175,14 @@ AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
175175
176176
# Global variable decls.
177177
AC_CHECK_DECLS([asprintf, asnprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln,
178-
fpurge, getdelim, getline, snprintf],,, [
178+
fpurge, getdelim, getline, snprintf, vsyslog],,, [
179179
#include <stdio.h>
180180
])
181181
182-
AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, reallocarray,
183-
getsubopt, setenv, strtoi, strtoll, strtou, setprogname, shquote,
184-
getprogname],,, [
182+
AC_CHECK_DECLS([atoll, getsubopt, getprogname, heapsort,
183+
mkdtemp, mkstemp, mkstemps,
184+
reallocarr, reallocarray,
185+
setenv, strtonum, strtoi, strtoll, strtou, setprogname, shquote],,, [
185186
#include <stdlib.h>
186187
])
187188
@@ -224,12 +225,13 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \
224225
dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
225226
getopt getopt_long group_from_gid gid_from_group \
226227
heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
227-
mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
228+
mkstemps mkdtemp poll pread putc_unlocked pwcache_userdb \
229+
pwcache_groupdb \
228230
pwrite raise_default_signal random reallocarr reallocarray setenv \
229231
setgroupent setprogname setpassent \
230232
snprintb_m snprintf strlcat strlcpy strmode \
231-
strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \
232-
strtoll strtou \
233+
strcasecmp strncasecmp strcasestr strndup strnlen strsep strsuftoll \
234+
strtoi strtoll strtou strtonum \
233235
user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
234236
235237
AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
@@ -238,7 +240,7 @@ AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
238240
AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
239241
#include <grp.h>
240242
])
241-
AC_CHECK_DECLS([strcasecmp, strncasecmp, strlcpy, strlcat, strndup,
243+
AC_CHECK_DECLS([strcasecmp, strncasecmp, strcasestr, strlcpy, strlcat, strndup,
242244
strnlen, strsep],,,[
243245
#include <string.h>
244246
])

tools/compat/nbtool_config.h.in

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* nbtool_config.h.in. Generated from configure.ac by autoheader. */
22

3-
/* $NetBSD: nbtool_config.h.in,v 1.53.6.2 2024/11/17 13:32:52 martin Exp $ */
3+
/* $NetBSD: nbtool_config.h.in,v 1.53.6.3 2025/10/19 09:48:29 martin Exp $ */
44

55
#ifndef __NETBSD_NBTOOL_CONFIG_H__
66
#define __NETBSD_NBTOOL_CONFIG_H__
@@ -262,6 +262,10 @@
262262
don't. */
263263
#undef HAVE_DECL_MKSTEMP
264264

265+
/* Define to 1 if you have the declaration of `mkstemps', and to 0 if you
266+
don't. */
267+
#undef HAVE_DECL_MKSTEMPS
268+
265269
/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
266270
*/
267271
#undef HAVE_DECL_OPTIND
@@ -326,6 +330,10 @@
326330
don't. */
327331
#undef HAVE_DECL_STRCASECMP
328332

333+
/* Define to 1 if you have the declaration of `strcasestr', and to 0 if you
334+
don't. */
335+
#undef HAVE_DECL_STRCASESTR
336+
329337
/* Define to 1 if you have the declaration of `strlcat', and to 0 if you
330338
don't. */
331339
#undef HAVE_DECL_STRLCAT
@@ -366,6 +374,10 @@
366374
don't. */
367375
#undef HAVE_DECL_STRTOLL
368376

377+
/* Define to 1 if you have the declaration of `strtonum', and to 0 if you
378+
don't. */
379+
#undef HAVE_DECL_STRTONUM
380+
369381
/* Define to 1 if you have the declaration of `strtou', and to 0 if you don't.
370382
*/
371383
#undef HAVE_DECL_STRTOU
@@ -402,6 +414,10 @@
402414
don't. */
403415
#undef HAVE_DECL_VSNPRINTF
404416

417+
/* Define to 1 if you have the declaration of `vsyslog', and to 0 if you
418+
don't. */
419+
#undef HAVE_DECL_VSYSLOG
420+
405421
/* Define to 1 if you have the declaration of `vwarnc', and to 0 if you don't.
406422
*/
407423
#undef HAVE_DECL_VWARNC
@@ -570,6 +586,9 @@
570586
/* Define to 1 if you have the `mkstemp' function. */
571587
#undef HAVE_MKSTEMP
572588

589+
/* Define to 1 if you have the `mkstemps' function. */
590+
#undef HAVE_MKSTEMPS
591+
573592
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
574593
#undef HAVE_NDIR_H
575594

@@ -669,6 +688,9 @@
669688
/* Define to 1 if you have the `strcasecmp' function. */
670689
#undef HAVE_STRCASECMP
671690

691+
/* Define to 1 if you have the `strcasestr' function. */
692+
#undef HAVE_STRCASESTR
693+
672694
/* Define to 1 if you have the <strings.h> header file. */
673695
#undef HAVE_STRINGS_H
674696

@@ -705,6 +727,9 @@
705727
/* Define to 1 if you have the `strtoll' function. */
706728
#undef HAVE_STRTOLL
707729

730+
/* Define to 1 if you have the `strtonum' function. */
731+
#undef HAVE_STRTONUM
732+
708733
/* Define to 1 if you have the `strtou' function. */
709734
#undef HAVE_STRTOU
710735

0 commit comments

Comments
 (0)