svn commit: r311151 - in head: . lib/libsysdecode usr.bin/kdump
Author: jhb Date: Tue Jan 3 01:39:05 2017 New Revision: 311151 URL: https://svnweb.freebsd.org/changeset/base/311151 Log: Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'. As a followup to r310638, update libsysdecode (and kdump) to decode the 'mode' argument to getfsstat(). sysdecode_getfsstat_flags() has been renamed to sysdecode_getfsstat_mode() and now treats the argument as an enumerated value rather than a mask of flags. Modified: head/ObsoleteFiles.inc head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.h head/lib/libsysdecode/sysdecode_enum.3 head/lib/libsysdecode/sysdecode_mask.3 head/usr.bin/kdump/kdump.c Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Tue Jan 3 00:26:10 2017(r311150) +++ head/ObsoleteFiles.inc Tue Jan 3 01:39:05 2017(r311151) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170102: sysdecode_getfsstat_flags() renamed to sysdecode_getfsstat_mode() +OLD_FILES+=usr/share/man/man3/sysdecode_getfsstat_flags.3.gz # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu # 20161229: Three files from gnop tests consolidated into one Modified: head/lib/libsysdecode/Makefile == --- head/lib/libsysdecode/Makefile Tue Jan 3 00:26:10 2017 (r311150) +++ head/lib/libsysdecode/Makefile Tue Jan 3 01:39:05 2017 (r311151) @@ -30,6 +30,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_aclty sysdecode_enum.3 sysdecode_extattrnamespace.3 \ sysdecode_enum.3 sysdecode_fadvice.3 \ sysdecode_enum.3 sysdecode_fcntl_cmd.3 \ + sysdecode_enum.3 sysdecode_getfsstat_mode.3 \ sysdecode_enum.3 sysdecode_idtype.3 \ sysdecode_enum.3 sysdecode_ipproto.3 \ sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ @@ -70,7 +71,6 @@ MLINKS+=sysdecode_mask.3 sysdecode_acces sysdecode_mask.3 sysdecode_fileflags.3 \ sysdecode_mask.3 sysdecode_filemode.3 \ sysdecode_mask.3 sysdecode_flock_operation.3 \ - sysdecode_mask.3 sysdecode_getfsstat_flags.3 \ sysdecode_mask.3 sysdecode_mlockall_flags.3 \ sysdecode_mask.3 sysdecode_mmap_flags.3 \ sysdecode_mask.3 sysdecode_mmap_prot.3 \ Modified: head/lib/libsysdecode/flags.c == --- head/lib/libsysdecode/flags.c Tue Jan 3 00:26:10 2017 (r311150) +++ head/lib/libsysdecode/flags.c Tue Jan 3 01:39:05 2017 (r311151) @@ -472,11 +472,15 @@ sysdecode_flock_operation(FILE *fp, int return (print_mask_int(fp, flockops, operation, rem)); } -bool -sysdecode_getfsstat_flags(FILE *fp, int flags, int *rem) +static struct name_table getfsstatmode[] = { + X(MNT_WAIT) X(MNT_NOWAIT) XEND +}; + +const char * +sysdecode_getfsstat_mode(int mode) { - return (print_mask_int(fp, getfsstatflags, flags, rem)); + return (lookup_value(getfsstatmode, mode)); } const char * Modified: head/lib/libsysdecode/mktables == --- head/lib/libsysdecode/mktables Tue Jan 3 00:26:10 2017 (r311150) +++ head/lib/libsysdecode/mktables Tue Jan 3 01:39:05 2017 (r311151) @@ -94,7 +94,6 @@ gen_table "extattrns" "EXTATTR_NAM gen_table "fadvisebehav""POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" gen_table "openflags" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" "O_RDONLY|O_RDWR|O_WRONLY" gen_table "flockops""LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" -gen_table "getfsstatflags" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h" gen_table "kldsymcmd" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" Modified: head/lib/libsysdecode/sysdecode.h == --- head/lib/libsysdecode/sysdecode.h Tue Jan 3 00:26:10 2017 (r311150) +++ head/lib/libsysdecode/sysdecode.h Tue Jan 3 01:39:05 2017 (r311151) @@ -54,7 +54,7 @@ bool sysdecode_fileflags(FILE *_fp, ffla bool sysdecode_filemode(FILE *_fp, int _mode, int *_rem); bool sysdecode_flock_operation(FILE *_fp,
Re: svn commit: r311109 - head/usr.bin/patch
On 01/02/17 17:54, Conrad Meyer wrote: I was suggesting using UINT32_MAX/2 on all platforms (which is safe everywhere). Ah OK. INT_MAX is ~ (UINT_MAX / 2) so it's the same to use either. I just think it's clearer to use INT_MAX and the corresponding int type. The other issue is if diff(1) can handle such lines(?). Pedro. Best, Conrad On Mon, Jan 2, 2017 at 11:48 AM Pedro Giffuni> wrote: Hi; On 01/02/17 13:28, Conrad Meyer wrote: > IMO this patch was mostly fine, you just need to restrict line length > to UINT32_MAX/2 instead of UINT_MAX (== UINT32_MAX) for 32-bit > platforms. > > Best, > Conrad > I dislike the idea of special cases for some platforms. I guess moving to int/INT_MAX would be the way to go. TBH, no one has asked for patches wider than USHRT_MAX though. Pedro. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311148 - head/sys/cddl/contrib/opensolaris/uts/common/sys
Author: markj Date: Tue Jan 3 00:24:12 2017 New Revision: 311148 URL: https://svnweb.freebsd.org/changeset/base/311148 Log: Remove the "unused" DIF subroutine index left after r308582. These indices are input to a build-time script that generates code to validate subroutine names. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h == --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Jan 3 00:05:44 2017(r311147) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Jan 3 00:24:12 2017(r311148) @@ -306,15 +306,14 @@ typedef enum dtrace_probespec { #defineDIF_SUBR_TOUPPER44 #defineDIF_SUBR_TOLOWER45 #defineDIF_SUBR_MEMREF 46 -#defineDIF_SUBR_UNUSED 47 -#defineDIF_SUBR_SX_SHARED_HELD 48 -#defineDIF_SUBR_SX_EXCLUSIVE_HELD 49 -#defineDIF_SUBR_SX_ISEXCLUSIVE 50 -#defineDIF_SUBR_MEMSTR 51 -#defineDIF_SUBR_GETF 52 -#defineDIF_SUBR_JSON 53 -#defineDIF_SUBR_STRTOLL54 -#defineDIF_SUBR_MAX54 /* max subroutine value */ +#defineDIF_SUBR_SX_SHARED_HELD 47 +#defineDIF_SUBR_SX_EXCLUSIVE_HELD 48 +#defineDIF_SUBR_SX_ISEXCLUSIVE 49 +#defineDIF_SUBR_MEMSTR 50 +#defineDIF_SUBR_GETF 51 +#defineDIF_SUBR_JSON 52 +#defineDIF_SUBR_STRTOLL53 +#defineDIF_SUBR_MAX53 /* max subroutine value */ typedef uint32_t dif_instr_t; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311147 - in head/sys: sys vm
Author: markj Date: Tue Jan 3 00:05:44 2017 New Revision: 311147 URL: https://svnweb.freebsd.org/changeset/base/311147 Log: Add a page queue for holding dirty anonymous unswappable pages. On systems without a configured swap device, an attempt to launder pages from a swap object will always fail and result in the page being reactivated. This means that the page daemon will continuously scan pages that can never be evicted. With this change, anonymous pages are instead moved to PQ_UNSWAPPABLE after a failed laundering attempt when no swap devices are configured. PQ_UNSWAPPABLE is not scanned unless a swap device is configured, so unreferenced unswappable pages are excluded from the page daemon's workload. Reviewed by: alc Modified: head/sys/sys/eventhandler.h head/sys/vm/swap_pager.c head/sys/vm/swap_pager.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/sys/eventhandler.h == --- head/sys/sys/eventhandler.h Mon Jan 2 22:05:05 2017(r311146) +++ head/sys/sys/eventhandler.h Tue Jan 3 00:05:44 2017(r311147) @@ -277,4 +277,11 @@ typedef void (*ada_probe_veto_fn)(void * struct ata_params *, int *); EVENTHANDLER_DECLARE(ada_probe_veto, ada_probe_veto_fn); +/* Swap device events */ +struct swdevt; +typedef void (*swapon_fn)(void *, struct swdevt *); +typedef void (*swapoff_fn)(void *, struct swdevt *); +EVENTHANDLER_DECLARE(swapon, swapon_fn); +EVENTHANDLER_DECLARE(swapoff, swapoff_fn); + #endif /* _SYS_EVENTHANDLER_H_ */ Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cMon Jan 2 22:05:05 2017(r311146) +++ head/sys/vm/swap_pager.cTue Jan 3 00:05:44 2017(r311147) @@ -1632,6 +1632,13 @@ swap_pager_isswapped(vm_object_t object, return (0); } +int +swap_pager_nswapdev(void) +{ + + return (nswapdev); +} + /* * SWP_PAGER_FORCE_PAGEIN() - force a swap block to be paged in * @@ -1750,6 +1757,7 @@ restart: pause("swpoff", hz / 20); goto full_rescan; } + EVENTHANDLER_INVOKE(swapoff, sp); } / @@ -2209,6 +2217,7 @@ swaponsomething(struct vnode *vp, void * swapon_check_swzone(swap_total / PAGE_SIZE); swp_sizecheck(); mtx_unlock(_dev_mtx); + EVENTHANDLER_INVOKE(swapon, sp); } /* Modified: head/sys/vm/swap_pager.h == --- head/sys/vm/swap_pager.hMon Jan 2 22:05:05 2017(r311146) +++ head/sys/vm/swap_pager.hTue Jan 3 00:05:44 2017(r311147) @@ -83,6 +83,7 @@ vm_pindex_t swap_pager_find_least(vm_obj void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_swap_init(void); int swap_pager_isswapped(vm_object_t, struct swdevt *); +int swap_pager_nswapdev(void); int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_status(int *total, int *used); void swapoff_all(void); Modified: head/sys/vm/vm_page.c == --- head/sys/vm/vm_page.c Mon Jan 2 22:05:05 2017(r311146) +++ head/sys/vm/vm_page.c Tue Jan 3 00:05:44 2017(r311147) @@ -393,6 +393,11 @@ vm_page_domain_init(struct vm_domain *vm "vm laundry pagequeue"; *__DECONST(int **, >vmd_pagequeues[PQ_LAUNDRY].pq_vcnt) = _cnt.v_laundry_count; + *__DECONST(char **, >vmd_pagequeues[PQ_UNSWAPPABLE].pq_name) = + "vm unswappable pagequeue"; + /* Unswappable dirty pages are counted as being in the laundry. */ + *__DECONST(int **, >vmd_pagequeues[PQ_UNSWAPPABLE].pq_vcnt) = + _cnt.v_laundry_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; @@ -2578,7 +2583,7 @@ vm_page_enqueue(uint8_t queue, vm_page_t KASSERT(queue < PQ_COUNT, ("vm_page_enqueue: invalid queue %u request for page %p", queue, m)); - if (queue == PQ_LAUNDRY) + if (queue == PQ_LAUNDRY || queue == PQ_UNSWAPPABLE) pq = _dom[0].vmd_pagequeues[queue]; else pq = _phys_domain(m)->vmd_pagequeues[queue]; @@ -2947,6 +2952,23 @@ vm_page_launder(vm_page_t m) } /* + * vm_page_unswappable + * + * Put a page in the PQ_UNSWAPPABLE holding queue. + */ +void +vm_page_unswappable(vm_page_t m) +{ + + vm_page_assert_locked(m); + KASSERT(m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0, + ("page %p already unswappable", m)); + if (m->queue != PQ_NONE) + vm_page_dequeue(m); + vm_page_enqueue(PQ_UNSWAPPABLE, m); +} + +/* * vm_page_try_to_free() * * Attempt to
Re: svn commit: r311109 - head/usr.bin/patch
I was suggesting using UINT32_MAX/2 on all platforms (which is safe everywhere). Best, Conrad On Mon, Jan 2, 2017 at 11:48 AM Pedro Giffuniwrote: > Hi; > > > > On 01/02/17 13:28, Conrad Meyer wrote: > > > IMO this patch was mostly fine, you just need to restrict line length > > > to UINT32_MAX/2 instead of UINT_MAX (== UINT32_MAX) for 32-bit > > > platforms. > > > > > > Best, > > > Conrad > > > > > > > I dislike the idea of special cases for some platforms. I guess moving > > to int/INT_MAX would be the way to go. > > > > TBH, no one has asked for patches wider than USHRT_MAX though. > > > > Pedro. > > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311141 - head/usr.bin/indent
Author: pstef Date: Mon Jan 2 20:49:24 2017 New Revision: 311141 URL: https://svnweb.freebsd.org/changeset/base/311141 Log: indent(1): add a piece missed in r311138. Modified: head/usr.bin/indent/args.c Modified: head/usr.bin/indent/args.c == --- head/usr.bin/indent/args.c Mon Jan 2 20:29:50 2017(r311140) +++ head/usr.bin/indent/args.c Mon Jan 2 20:49:24 2017(r311141) @@ -96,6 +96,7 @@ struct pro { {"T", PRO_SPECIAL, 0, KEY, 0}, {"U", PRO_SPECIAL, 0, KEY_FILE, 0}, +{"P", PRO_SPECIAL, 0, IGN, 0}, {"bacc", PRO_BOOL, false, ON, _around_conditional_compilation}, {"badp", PRO_BOOL, false, ON, _after_declarations_at_proctop}, {"bad", PRO_BOOL, false, ON, _after_declarations}, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311140 - in head: . secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd
Author: ngie Date: Mon Jan 2 20:29:50 2017 New Revision: 311140 URL: https://svnweb.freebsd.org/changeset/base/311140 Log: Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and MK_KERBEROS_SUPPORT != no This fixes the odd case where someone specified MK_GSSAPI=no and MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense, but the build system doesn't prevent this case today, and it didn't when I filed the bug back in 2011 either). MFC after:2 weeks PR: 159745 Modified: head/Makefile.inc1 head/secure/lib/libssh/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Mon Jan 2 20:24:10 2017(r311139) +++ head/Makefile.inc1 Mon Jan 2 20:29:50 2017(r311140) @@ -2156,7 +2156,7 @@ secure/lib/libssh__L: lib/libz__L secure .if ${MK_LDNS} != "no" secure/lib/libssh__L: lib/libldns__L .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ lib/libmd__L kerberos5/lib/libroken__L Modified: head/secure/lib/libssh/Makefile == --- head/secure/lib/libssh/Makefile Mon Jan 2 20:24:10 2017 (r311139) +++ head/secure/lib/libssh/Makefile Mon Jan 2 20:29:50 2017 (r311140) @@ -46,7 +46,7 @@ LIBADD+= ldns CFLAGS+= -I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h .endif Modified: head/secure/usr.bin/ssh/Makefile == --- head/secure/usr.bin/ssh/MakefileMon Jan 2 20:24:10 2017 (r311139) +++ head/secure/usr.bin/ssh/MakefileMon Jan 2 20:29:50 2017 (r311140) @@ -23,7 +23,7 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi Modified: head/secure/usr.sbin/sshd/Makefile == --- head/secure/usr.sbin/sshd/Makefile Mon Jan 2 20:24:10 2017 (r311139) +++ head/secure/usr.sbin/sshd/Makefile Mon Jan 2 20:29:50 2017 (r311140) @@ -47,7 +47,7 @@ LIBADD+= blacklist LDFLAGS+=-L${LIBBLACKLISTDIR} .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311138 - head/usr.bin/indent
Author: pstef Date: Mon Jan 2 20:23:46 2017 New Revision: 311138 URL: https://svnweb.freebsd.org/changeset/base/311138 Log: indent(1): add option -P for loading user-provided files as profiles Without this change, indent(1) would only look to load options from ~/.indent.pro if it's there and -npro wasn't used on the command line. This option lets the user set their own path to the file. Approved by: pfg (mentor) Differential Revision:https://reviews.freebsd.org/D9010 Modified: head/usr.bin/indent/args.c head/usr.bin/indent/indent.1 head/usr.bin/indent/indent.c head/usr.bin/indent/indent.h Modified: head/usr.bin/indent/args.c == --- head/usr.bin/indent/args.c Mon Jan 2 20:14:06 2017(r311137) +++ head/usr.bin/indent/args.c Mon Jan 2 20:23:46 2017(r311138) @@ -177,13 +177,16 @@ struct pro { * given in these files. */ void -set_profile(void) +set_profile(const char *profile_name) { FILE *f; char fname[PATH_MAX]; static char prof[] = ".indent.pro"; -snprintf(fname, sizeof(fname), "%s/%s", getenv("HOME"), prof); +if (profile_name == NULL) + snprintf(fname, sizeof(fname), "%s/%s", getenv("HOME"), prof); +else + snprintf(fname, sizeof(fname), "%s", profile_name + 2); if ((f = fopen(option_source = fname, "r")) != NULL) { scan_profile(f); (void) fclose(f); Modified: head/usr.bin/indent/indent.1 == --- head/usr.bin/indent/indent.1Mon Jan 2 20:14:06 2017 (r311137) +++ head/usr.bin/indent/indent.1Mon Jan 2 20:23:46 2017 (r311138) @@ -30,7 +30,7 @@ .\"@(#)indent.18.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd December 2, 2016 +.Dd January 2, 2017 .Dt INDENT 1 .Os .Sh NAME @@ -74,6 +74,7 @@ .Op Fl \ Ns Ar n .Op Fl \ | Fl nlp .Op Fl npro +.Op Fl P Ns Ar file .Op Fl pcs | Fl npcs .Op Fl psl | Fl npsl .Op Fl sac | Fl nsac @@ -383,6 +384,9 @@ Causes the profile files, and .Sq Pa ~/.indent.pro , to be ignored. +.It Fl P Ns Ar file +Read profile from +.Ar file . .It Fl pcs , npcs If true .Pq Fl pcs Modified: head/usr.bin/indent/indent.c == --- head/usr.bin/indent/indent.cMon Jan 2 20:14:06 2017 (r311137) +++ head/usr.bin/indent/indent.cMon Jan 2 20:23:46 2017 (r311138) @@ -98,6 +98,7 @@ main(int argc, char **argv) int type_code; /* the type of token, returned by lexi */ int last_else = 0; /* true iff last keyword was an else */ +const char *profile_name = NULL; /*---*\ @@ -194,9 +195,11 @@ main(int argc, char **argv) for (i = 1; i < argc; ++i) if (strcmp(argv[i], "-npro") == 0) break; + else if (argv[i][0] == '-' && argv[i][1] == 'P' && argv[i][2] != '\0') + profile_name = argv[i]; /* non-empty -P (set profile) */ set_defaults(); if (i >= argc) - set_profile(); + set_profile(profile_name); for (i = 1; i < argc; ++i) { Modified: head/usr.bin/indent/indent.h == --- head/usr.bin/indent/indent.hMon Jan 2 20:14:06 2017 (r311137) +++ head/usr.bin/indent/indent.hMon Jan 2 20:23:46 2017 (r311138) @@ -45,5 +45,5 @@ void parsefont(struct fstate *, const ch void pr_comment(void); void set_defaults(void); void set_option(char *); -void set_profile(void); +void set_profile(const char *); void writefdef(struct fstate *f, int); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311137 - head/share/man/man5
Author: ngie Date: Mon Jan 2 20:14:06 2017 New Revision: 311137 URL: https://svnweb.freebsd.org/changeset/base/311137 Log: Regen src.conf after recent changes to tools/build/options/... and src.opts.mk Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Mon Jan 2 20:09:09 2017 (r311136) +++ head/share/man/man5/src.conf.5 Mon Jan 2 20:14:06 2017 (r311137) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z emaste .\" $FreeBSD$ -.Dd December 19, 2016 +.Dd January 2, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -635,6 +635,24 @@ Set to not build and install .Xr edit 1 , .Xr ee 1 , and related programs. +.It Va WITHOUT_EFI +.\" from FreeBSD: head/tools/build/options/WITHOUT_EFI 311135 2017-01-02 20:07:56Z ngie +Set not to build +.Xr efivar 3 +and +.Xr efivar 8 . +.Pp +It is a default setting on +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +.It Va WITH_EFI +.\" from FreeBSD: head/tools/build/options/WITH_EFI 311135 2017-01-02 20:07:56Z ngie +Set to build +.Xr efivar 3 +and +.Xr efivar 8 . +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_EISA .\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp Set to build EISA kernel modules. @@ -1369,7 +1387,7 @@ This includes .Xr rsh 1 , etc. .It Va WITH_REPRODUCIBLE_BUILD -.\" from FreeBSD: head/tools/build/options/WITH_REPRODUCIBLE_BUILD 310268 2016-12-19 14:45:59Z emaste +.\" from FreeBSD: head/tools/build/options/WITH_REPRODUCIBLE_BUILD 310271 2016-12-19 15:09:30Z gjb Set to exclude build metadata (such as the build time, user, or host) from the kernel, boot loaders, and uname output, so that builds produce bit-for-bit identical output. @@ -1431,6 +1449,12 @@ Set to not build world with propolice st .Pp It is a default setting on mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +.It Va WITH_SSP +.\" from FreeBSD: head/tools/build/options/WITH_SSP 311136 2017-01-02 20:09:09Z ngie +Set to build world with propolice stack smashing protection. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_STAGING .\" from FreeBSD: head/tools/build/options/WITH_STAGING 290816 2015-11-14 03:24:48Z sjg Enable staging of files to a stage tree. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r311136 - head/tools/build/options
> On Jan 2, 2017, at 12:09, Ngie Cooperwrote: > > Author: ngie > Date: Mon Jan 2 20:09:09 2017 > New Revision: 311136 > URL: https://svnweb.freebsd.org/changeset/base/311136 > > Log: > Add WITH_SSP to silence complaints from mkman about there not being a file I meant makeman. signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r311136 - head/tools/build/options
Author: ngie Date: Mon Jan 2 20:09:09 2017 New Revision: 311136 URL: https://svnweb.freebsd.org/changeset/base/311136 Log: Add WITH_SSP to silence complaints from mkman about there not being a file MFC after:3 days Added: head/tools/build/options/WITH_SSP (contents, props changed) Added: head/tools/build/options/WITH_SSP == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SSP Mon Jan 2 20:09:09 2017 (r311136) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build world with propolice stack smashing protection. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311135 - head/tools/build/options
Author: ngie Date: Mon Jan 2 20:07:56 2017 New Revision: 311135 URL: https://svnweb.freebsd.org/changeset/base/311135 Log: Add documentation for MK_EFI added in r307243 Added: head/tools/build/options/WITHOUT_EFI (contents, props changed) head/tools/build/options/WITH_EFI (contents, props changed) Added: head/tools/build/options/WITHOUT_EFI == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_EFIMon Jan 2 20:07:56 2017 (r311135) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set not to build +.Xr efivar 3 +and +.Xr efivar 8 . Added: head/tools/build/options/WITH_EFI == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_EFI Mon Jan 2 20:07:56 2017 (r311135) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build +.Xr efivar 3 +and +.Xr efivar 8 . ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311134 - head/share/mk
Author: ngie Date: Mon Jan 2 20:01:07 2017 New Revision: 311134 URL: https://svnweb.freebsd.org/changeset/base/311134 Log: rcs was removed in r307351; kill off WITH*_RCS MFC after:never Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Mon Jan 2 19:55:18 2017(r311133) +++ head/share/mk/src.opts.mk Mon Jan 2 20:01:07 2017(r311134) @@ -189,7 +189,6 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED \ OPENLDAP \ -RCS \ REPRODUCIBLE_BUILD \ SHARED_TOOLCHAIN \ SORT_THREADS \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311133 - head/share/mk
Author: ngie Date: Mon Jan 2 19:55:18 2017 New Revision: 311133 URL: https://svnweb.freebsd.org/changeset/base/311133 Log: Move the "MK_* options..." section before the "... MK_*_SUPPORT..." section For the case that someone set WITHOUT_GSSAPI=, now WITHOUT_KERBEROS_SUPPORT will be properly set. This will likely fix the issue for the default case noted in the PR I filed back in 2011. I am trying to fix the less obvious case documented in the PR still. MFC after:2 weeks PR: 159745 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Mon Jan 2 19:36:28 2017(r311132) +++ head/share/mk/src.opts.mk Mon Jan 2 19:55:18 2017(r311133) @@ -402,6 +402,21 @@ MK_CLANG_FULL:= no .endif # +# MK_* options whose default value depends on another option. +# +.for vv in \ +GSSAPI/KERBEROS \ +MAN_UTILS/MAN +.if defined(WITH_${vv:H}) +MK_${vv:H}:= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}:= no +.else +MK_${vv:H}:= ${MK_${vv:T}} +.endif +.endfor + +# # Set defaults for the MK_*_SUPPORT variables. # @@ -428,21 +443,6 @@ MK_${var}_SUPPORT:= yes .endif .endfor -# -# MK_* options whose default value depends on another option. -# -.for vv in \ -GSSAPI/KERBEROS \ -MAN_UTILS/MAN -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - .if !${COMPILER_FEATURES:Mc++11} MK_LLDB:= no .endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r311109 - head/usr.bin/patch
Hi; On 01/02/17 13:28, Conrad Meyer wrote: IMO this patch was mostly fine, you just need to restrict line length to UINT32_MAX/2 instead of UINT_MAX (== UINT32_MAX) for 32-bit platforms. Best, Conrad I dislike the idea of special cases for some platforms. I guess moving to int/INT_MAX would be the way to go. TBH, no one has asked for patches wider than USHRT_MAX though. Pedro. Index: usr.bin/patch/patch.c === --- usr.bin/patch/patch.c (revision 30) +++ usr.bin/patch/patch.c (working copy) @@ -753,7 +753,7 @@ fprintf(rejfp, "%c%s", ch, line); if (len == 0 || line[len - 1] != '\n') { - if (len >= USHRT_MAX) + if (len >= INT_MAX) fprintf(rejfp, "\n\\ Line too long\n"); else fprintf(rejfp, "\n\\ No newline at end of line\n"); @@ -1024,7 +1024,7 @@ LINENUM pat_lines = pch_ptrn_lines() - fuzz; const char *ilineptr; const char *plineptr; - unsigned short plinelen; + int plinelen; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); Index: usr.bin/patch/pch.c === --- usr.bin/patch/pch.c (revision 311109) +++ usr.bin/patch/pch.c (working copy) @@ -56,7 +56,7 @@ static LINENUM p_context = 3; /* # of context lines */ static LINENUM p_input_line = 0; /* current line # from patch file */ static char **p_line = NULL;/* the text of the hunk */ -static unsigned short *p_len = NULL; /* length of each line */ +static int *p_len = NULL; /* length of each line */ static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ @@ -136,7 +136,7 @@ if (p_line == NULL) p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = malloc(hunkmax * sizeof(unsigned short)); + p_len = malloc(hunkmax * sizeof(int)); if (p_char == NULL) p_char = malloc(hunkmax * sizeof(char)); } @@ -153,7 +153,7 @@ fatal("Internal memory allocation error\n"); p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); - p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); + p_len = reallocf(p_len, new_hunkmax * sizeof(int)); p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { @@ -1210,7 +1210,7 @@ pch_swap(void) { char **tp_line; /* the text of the hunk */ - unsigned short *tp_len;/* length of each line */ + int *tp_len; /* length of each line */ char *tp_char; /* +, -, and ! */ LINENUM i; LINENUM n; @@ -1367,7 +1367,7 @@ /* * Return the length of a particular patch line. */ -unsigned short +int pch_line_len(LINENUM line) { return p_len[line]; Index: usr.bin/patch/pch.h === --- usr.bin/patch/pch.h (revision 311109) +++ usr.bin/patch/pch.h (working copy) @@ -44,7 +44,7 @@ bool another_hunk(void); bool pch_swap(void); char *pfetch(LINENUM); -unsigned short pch_line_len(LINENUM); +int pch_line_len(LINENUM); LINENUM pch_first(void); LINENUM pch_ptrn_lines(void); LINENUM pch_newfirst(void); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311131 - head
Author: dim Date: Mon Jan 2 19:33:22 2017 New Revision: 311131 URL: https://svnweb.freebsd.org/changeset/base/311131 Log: Make native-xtools build correctly after clang/llvm 3.9.0 import During the clang/llvm 3.9.0 import, the build structure for it was completely revamped. This broke the native-xtools target. It first attempts to build libllvmminimal, then the llvm-tblgen and clang-tblgen executables, but these fail to link because they are linked to the 'full' libllvm by default, as they normally are during the 'world' stage. To make these link against libllvmminimal instead, define TOOLS_PREFIX, similarly as during the bootstrap-tools phase. The value itself is empty, as we don't really want to use a prefix. Reviewed by: imp PR: 215684 MFC after:3 days Differential Revision:https://reviews.freebsd.org/D9026 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Mon Jan 2 19:26:39 2017(r311130) +++ head/Makefile.inc1 Mon Jan 2 19:33:22 2017(r311131) @@ -1867,6 +1867,7 @@ cross-tools: .MAKE .PHONY NXBDESTDIR=${OBJTREE}/nxb-bin NXBENV=MAKEOBJDIRPREFIX=${OBJTREE}/nxb \ + TOOLS_PREFIX= \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin NXBMAKE= ${NXBENV} ${MAKE} \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311122 - head/sys/fs/nfsserver
Author: jpaetzel Date: Mon Jan 2 19:18:56 2017 New Revision: 311122 URL: https://svnweb.freebsd.org/changeset/base/311122 Log: Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem. Reviewed by kib MFC after:2 weeks Sponsored by: iXsystems Differential Revision:D9009 Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cMon Jan 2 19:18:33 2017 (r311121) +++ head/sys/fs/nfsserver/nfs_nfsdport.cMon Jan 2 19:18:56 2017 (r311122) @@ -2018,25 +2018,17 @@ again: } /* -* Check to see if entries in this directory can be safely acquired -* via VFS_VGET() or if a switch to VOP_LOOKUP() is required. -* ZFS snapshot directories need VOP_LOOKUP(), so that any -* automount of the snapshot directory that is required will -* be done. -* This needs to be done here for NFSv4, since NFSv4 never does -* a VFS_VGET() for "." or "..". +* For now ZFS requires VOP_LOOKUP as a workaround. Until ino_t is changed +* to 64 bit type a ZFS filesystem with over 1 billion files in it +* will suffer from 64bit -> 32bit truncation. */ - if (is_zfs == 1) { - r = VFS_VGET(mp, at.na_fileid, LK_SHARED, ); - if (r == EOPNOTSUPP) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = LK_SHARED | LK_RETRY; - cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; - } else if (r == 0) - vput(nvp); - } + if (is_zfs == 1) + usevget = 0; + + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = nd->nd_cred; + cn.cn_thread = p; /* * Save this position, in case there is an error before one entry @@ -2105,16 +2097,7 @@ again: else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { - if (usevget) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = - LK_SHARED | - LK_RETRY; - cn.cn_cred = - nd->nd_cred; - cn.cn_thread = p; - } + usevget = 0; cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; cn.cn_flags = ISLASTCN | ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311115 - head/kerberos5
Author: ngie Date: Mon Jan 2 19:03:01 2017 New Revision: 35 URL: https://svnweb.freebsd.org/changeset/base/35 Log: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" MFC after:1 week Modified: head/kerberos5/Makefile.inc Modified: head/kerberos5/Makefile.inc == --- head/kerberos5/Makefile.inc Mon Jan 2 19:02:00 2017(r34) +++ head/kerberos5/Makefile.inc Mon Jan 2 19:03:01 2017(r35) @@ -26,11 +26,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311114 - head/kerberos5/libexec
Author: ngie Date: Mon Jan 2 19:02:00 2017 New Revision: 34 URL: https://svnweb.freebsd.org/changeset/base/34 Log: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi MFC after:1 week Modified: head/kerberos5/libexec/Makefile Modified: head/kerberos5/libexec/Makefile == --- head/kerberos5/libexec/Makefile Mon Jan 2 18:59:23 2017 (r33) +++ head/kerberos5/libexec/Makefile Mon Jan 2 19:02:00 2017 (r34) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311113 - head/sys/kern
Author: kib Date: Mon Jan 2 18:59:23 2017 New Revision: 33 URL: https://svnweb.freebsd.org/changeset/base/33 Log: There is no need to use temporary statfs buffer for fsid obliteration and prison enforcement. Do it on the caller buffer directly. Besides eliminating memory copies, this change also removes large structure from the kernel stack. Extracted from: ino64 work by gleb Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cMon Jan 2 18:58:13 2017 (r32) +++ head/sys/kern/vfs_syscalls.cMon Jan 2 18:59:23 2017 (r33) @@ -247,7 +247,7 @@ statfs_scale_blocks(struct statfs *sf, l static int kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) { - struct statfs *sp, sb; + struct statfs *sp; int error; if (mp == NULL) @@ -271,13 +271,11 @@ kern_do_statfs(struct thread *td, struct error = VFS_STATFS(mp, sp); if (error != 0) goto out; + *buf = *sp; if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, , sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, ); - sp = + buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, buf); } - *buf = *sp; out: vfs_unbusy(mp); return (error); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311112 - head/kerberos5/lib
Author: ngie Date: Mon Jan 2 18:58:13 2017 New Revision: 32 URL: https://svnweb.freebsd.org/changeset/base/32 Log: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob MFC after:1 week Modified: head/kerberos5/lib/Makefile Modified: head/kerberos5/lib/Makefile == --- head/kerberos5/lib/Makefile Mon Jan 2 18:49:48 2017(r31) +++ head/kerberos5/lib/Makefile Mon Jan 2 18:58:13 2017(r32) @@ -1,11 +1,18 @@ - # $FreeBSD$ -SUBDIR=libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR=libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkrb5 \ libroken libsl libvers libkdc libwind libheimbase libheimipcc libheimipcs SUBDIR+= libkafs5 # requires krb_err.h from libkrb5 SUBDIR_DEPEND_libkafs5=libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311111 - head/sys/kern
Author: kib Date: Mon Jan 2 18:49:48 2017 New Revision: 31 URL: https://svnweb.freebsd.org/changeset/base/31 Log: Style. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cMon Jan 2 18:27:35 2017 (r30) +++ head/sys/kern/vfs_syscalls.cMon Jan 2 18:49:48 2017 (r31) @@ -374,7 +374,7 @@ kern_fstatfs(struct thread *td, int fd, AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; - if (mp) + if (mp != NULL) vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r311109 - head/usr.bin/patch
IMO this patch was mostly fine, you just need to restrict line length to UINT32_MAX/2 instead of UINT_MAX (== UINT32_MAX) for 32-bit platforms. Best, Conrad On Mon, Jan 2, 2017 at 10:23 AM, Pedro F. Giffuniwrote: > Author: pfg > Date: Mon Jan 2 18:23:31 2017 > New Revision: 311109 > URL: https://svnweb.freebsd.org/changeset/base/311109 > > Log: > Revert r311106: > patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX. > > This doesn't really work for 32 bit platforms. > > Pointed out by: kib > > Modified: > head/usr.bin/patch/patch.c > head/usr.bin/patch/pch.c > head/usr.bin/patch/pch.h > > Modified: head/usr.bin/patch/patch.c > == > --- head/usr.bin/patch/patch.c Mon Jan 2 18:20:22 2017(r311108) > +++ head/usr.bin/patch/patch.c Mon Jan 2 18:23:31 2017(r311109) > @@ -749,13 +749,15 @@ rej_line(int ch, LINENUM i) > size_t len; > const char *line = pfetch(i); > > - len = strnlen(line, UINT_MAX); > + len = strnlen(line, USHRT_MAX); > > fprintf(rejfp, "%c%s", ch, line); > - if (len == 0 || line[len-1] != '\n') > - fprintf(rejfp, "\n\\ No newline at end of line\n"); > - else if (len >= UINT_MAX) > - fprintf(rejfp, "\n\\ Line too long\n"); > + if (len == 0 || line[len-1] != '\n') { > + if (len >= USHRT_MAX) > + fprintf(rejfp, "\n\\ Line too long\n"); > + else > + fprintf(rejfp, "\n\\ No newline at end of line\n"); > + } > } > > static void > @@ -1022,7 +1024,7 @@ patch_match(LINENUM base, LINENUM offset > LINENUM pat_lines = pch_ptrn_lines() - fuzz; > const char *ilineptr; > const char *plineptr; > - u_int plinelen; > + unsigned short plinelen; > > for (iline = base + offset + fuzz; pline <= pat_lines; pline++, > iline++) { > ilineptr = ifetch(iline, offset >= 0); > > Modified: head/usr.bin/patch/pch.c > == > --- head/usr.bin/patch/pch.cMon Jan 2 18:20:22 2017(r311108) > +++ head/usr.bin/patch/pch.cMon Jan 2 18:23:31 2017(r311109) > @@ -56,7 +56,7 @@ static LINENUMp_max; /* max allowed va > static LINENUM p_context = 3; /* # of context lines */ > static LINENUM p_input_line = 0; /* current line # from patch file */ > static char**p_line = NULL;/* the text of the hunk */ > -static u_int *p_len = NULL; /* length of each line */ > +static unsigned short *p_len = NULL; /* length of each line */ > static char*p_char = NULL; /* +, -, and ! */ > static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with > */ > static int p_indent; /* indent to patch */ > @@ -136,7 +136,7 @@ set_hunkmax(void) > if (p_line == NULL) > p_line = malloc(hunkmax * sizeof(char *)); > if (p_len == NULL) > - p_len = malloc(hunkmax * sizeof(u_int)); > + p_len = malloc(hunkmax * sizeof(unsigned short)); > if (p_char == NULL) > p_char = malloc(hunkmax * sizeof(char)); > } > @@ -153,7 +153,7 @@ grow_hunkmax(void) > fatal("Internal memory allocation error\n"); > > p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); > - p_len = reallocf(p_len, new_hunkmax * sizeof(u_int)); > + p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); > p_char = reallocf(p_char, new_hunkmax * sizeof(char)); > > if (p_line != NULL && p_len != NULL && p_char != NULL) { > @@ -1210,7 +1210,7 @@ bool > pch_swap(void) > { > char**tp_line; /* the text of the hunk */ > - u_int *tp_len;/* length of each line */ > + unsigned short *tp_len;/* length of each line */ > char*tp_char; /* +, -, and ! */ > LINENUM i; > LINENUM n; > @@ -1367,7 +1367,7 @@ pch_context(void) > /* > * Return the length of a particular patch line. > */ > -u_int > +unsigned short > pch_line_len(LINENUM line) > { > return p_len[line]; > > Modified: head/usr.bin/patch/pch.h > == > --- head/usr.bin/patch/pch.hMon Jan 2 18:20:22 2017(r311108) > +++ head/usr.bin/patch/pch.hMon Jan 2 18:23:31 2017(r311109) > @@ -44,7 +44,7 @@ bool there_is_another_patch(void); > bool another_hunk(void); > bool pch_swap(void); > char *pfetch(LINENUM); > -u_int pch_line_len(LINENUM); > +unsigned short pch_line_len(LINENUM); > LINENUMpch_first(void); > LINENUMpch_ptrn_lines(void); > LINENUMpch_newfirst(void); >
svn commit: r311110 - head/usr.bin/patch
Author: pfg Date: Mon Jan 2 18:27:35 2017 New Revision: 30 URL: https://svnweb.freebsd.org/changeset/base/30 Log: patch(1): replace strnlen() with a simpler strlen(). Small style fix with here. Pointed out by: kib Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c == --- head/usr.bin/patch/patch.c Mon Jan 2 18:23:31 2017(r311109) +++ head/usr.bin/patch/patch.c Mon Jan 2 18:27:35 2017(r30) @@ -749,10 +749,10 @@ rej_line(int ch, LINENUM i) size_t len; const char *line = pfetch(i); - len = strnlen(line, USHRT_MAX); + len = strlen(line); fprintf(rejfp, "%c%s", ch, line); - if (len == 0 || line[len-1] != '\n') { + if (len == 0 || line[len - 1] != '\n') { if (len >= USHRT_MAX) fprintf(rejfp, "\n\\ Line too long\n"); else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311109 - head/usr.bin/patch
Author: pfg Date: Mon Jan 2 18:23:31 2017 New Revision: 311109 URL: https://svnweb.freebsd.org/changeset/base/311109 Log: Revert r311106: patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX. This doesn't really work for 32 bit platforms. Pointed out by: kib Modified: head/usr.bin/patch/patch.c head/usr.bin/patch/pch.c head/usr.bin/patch/pch.h Modified: head/usr.bin/patch/patch.c == --- head/usr.bin/patch/patch.c Mon Jan 2 18:20:22 2017(r311108) +++ head/usr.bin/patch/patch.c Mon Jan 2 18:23:31 2017(r311109) @@ -749,13 +749,15 @@ rej_line(int ch, LINENUM i) size_t len; const char *line = pfetch(i); - len = strnlen(line, UINT_MAX); + len = strnlen(line, USHRT_MAX); fprintf(rejfp, "%c%s", ch, line); - if (len == 0 || line[len-1] != '\n') - fprintf(rejfp, "\n\\ No newline at end of line\n"); - else if (len >= UINT_MAX) - fprintf(rejfp, "\n\\ Line too long\n"); + if (len == 0 || line[len-1] != '\n') { + if (len >= USHRT_MAX) + fprintf(rejfp, "\n\\ Line too long\n"); + else + fprintf(rejfp, "\n\\ No newline at end of line\n"); + } } static void @@ -1022,7 +1024,7 @@ patch_match(LINENUM base, LINENUM offset LINENUM pat_lines = pch_ptrn_lines() - fuzz; const char *ilineptr; const char *plineptr; - u_int plinelen; + unsigned short plinelen; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); Modified: head/usr.bin/patch/pch.c == --- head/usr.bin/patch/pch.cMon Jan 2 18:20:22 2017(r311108) +++ head/usr.bin/patch/pch.cMon Jan 2 18:23:31 2017(r311109) @@ -56,7 +56,7 @@ static LINENUMp_max; /* max allowed va static LINENUM p_context = 3; /* # of context lines */ static LINENUM p_input_line = 0; /* current line # from patch file */ static char**p_line = NULL;/* the text of the hunk */ -static u_int *p_len = NULL; /* length of each line */ +static unsigned short *p_len = NULL; /* length of each line */ static char*p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ @@ -136,7 +136,7 @@ set_hunkmax(void) if (p_line == NULL) p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = malloc(hunkmax * sizeof(u_int)); + p_len = malloc(hunkmax * sizeof(unsigned short)); if (p_char == NULL) p_char = malloc(hunkmax * sizeof(char)); } @@ -153,7 +153,7 @@ grow_hunkmax(void) fatal("Internal memory allocation error\n"); p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); - p_len = reallocf(p_len, new_hunkmax * sizeof(u_int)); + p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { @@ -1210,7 +1210,7 @@ bool pch_swap(void) { char**tp_line; /* the text of the hunk */ - u_int *tp_len;/* length of each line */ + unsigned short *tp_len;/* length of each line */ char*tp_char; /* +, -, and ! */ LINENUM i; LINENUM n; @@ -1367,7 +1367,7 @@ pch_context(void) /* * Return the length of a particular patch line. */ -u_int +unsigned short pch_line_len(LINENUM line) { return p_len[line]; Modified: head/usr.bin/patch/pch.h == --- head/usr.bin/patch/pch.hMon Jan 2 18:20:22 2017(r311108) +++ head/usr.bin/patch/pch.hMon Jan 2 18:23:31 2017(r311109) @@ -44,7 +44,7 @@ bool there_is_another_patch(void); bool another_hunk(void); bool pch_swap(void); char *pfetch(LINENUM); -u_int pch_line_len(LINENUM); +unsigned short pch_line_len(LINENUM); LINENUMpch_first(void); LINENUMpch_ptrn_lines(void); LINENUMpch_newfirst(void); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311108 - head/sys/kern
Author: kib Date: Mon Jan 2 18:20:22 2017 New Revision: 311108 URL: https://svnweb.freebsd.org/changeset/base/311108 Log: Move common code from kern_statfs() and kern_fstatfs() into a new helper. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cMon Jan 2 17:40:23 2017 (r311107) +++ head/sys/kern/vfs_syscalls.cMon Jan 2 18:20:22 2017 (r311108) @@ -244,6 +244,45 @@ statfs_scale_blocks(struct statfs *sf, l sf->f_bavail >>= shift; } +static int +kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf) +{ + struct statfs *sp, sb; + int error; + + if (mp == NULL) + return (EBADF); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error != 0) + return (error); +#ifdef MAC + error = mac_mount_check_stat(td->td_ucred, mp); + if (error != 0) + goto out; +#endif + /* +* Set these in case the underlying filesystem fails to do so. +*/ + sp = >mnt_stat; + sp->f_version = STATFS_VERSION; + sp->f_namemax = NAME_MAX; + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + error = VFS_STATFS(mp, sp); + if (error != 0) + goto out; + if (priv_check(td, PRIV_VFS_GENERATION)) { + bcopy(sp, , sizeof(sb)); + sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; + prison_enforce_statfs(td->td_ucred, mp, ); + sp = + } + *buf = *sp; +out: + vfs_unbusy(mp); + return (error); +} + /* * Get filesystem statistics. */ @@ -275,7 +314,6 @@ kern_statfs(struct thread *td, char *pat struct statfs *buf) { struct mount *mp; - struct statfs *sp, sb; struct nameidata nd; int error; @@ -288,35 +326,7 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(, NDF_ONLY_PNBUF); vput(nd.ni_vp); - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* -* Set these in case the underlying filesystem fails to do so. -*/ - sp = >mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, , sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, ); - sp = - } - *buf = *sp; -out: - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* @@ -350,7 +360,6 @@ kern_fstatfs(struct thread *td, int fd, { struct file *fp; struct mount *mp; - struct statfs *sp, sb; struct vnode *vp; cap_rights_t rights; int error; @@ -369,40 +378,7 @@ kern_fstatfs(struct thread *td, int fd, vfs_ref(mp); VOP_UNLOCK(vp, 0); fdrop(fp, td); - if (mp == NULL) { - error = EBADF; - goto out; - } - error = vfs_busy(mp, 0); - vfs_rel(mp); - if (error != 0) - return (error); -#ifdef MAC - error = mac_mount_check_stat(td->td_ucred, mp); - if (error != 0) - goto out; -#endif - /* -* Set these in case the underlying filesystem fails to do so. -*/ - sp = >mnt_stat; - sp->f_version = STATFS_VERSION; - sp->f_namemax = NAME_MAX; - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - error = VFS_STATFS(mp, sp); - if (error != 0) - goto out; - if (priv_check(td, PRIV_VFS_GENERATION)) { - bcopy(sp, , sizeof(sb)); - sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; - prison_enforce_statfs(td->td_ucred, mp, ); - sp = - } - *buf = *sp; -out: - if (mp) - vfs_unbusy(mp); - return (error); + return (kern_do_statfs(td, mp, buf)); } /* ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311106 - head/usr.bin/patch
Author: pfg Date: Mon Jan 2 17:12:14 2017 New Revision: 311106 URL: https://svnweb.freebsd.org/changeset/base/311106 Log: patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX. We can handle such "big data" without much trouble. Try to do a better job at detecting the rejection cause while here. MFC after:2 weeks Modified: head/usr.bin/patch/patch.c head/usr.bin/patch/pch.c head/usr.bin/patch/pch.h Modified: head/usr.bin/patch/patch.c == --- head/usr.bin/patch/patch.c Mon Jan 2 16:58:55 2017(r311105) +++ head/usr.bin/patch/patch.c Mon Jan 2 17:12:14 2017(r311106) @@ -749,15 +749,13 @@ rej_line(int ch, LINENUM i) size_t len; const char *line = pfetch(i); - len = strnlen(line, USHRT_MAX); + len = strnlen(line, UINT_MAX); fprintf(rejfp, "%c%s", ch, line); - if (len == 0 || line[len-1] != '\n') { - if (len >= USHRT_MAX) - fprintf(rejfp, "\n\\ Line too long\n"); - else - fprintf(rejfp, "\n\\ No newline at end of line\n"); - } + if (len == 0 || line[len-1] != '\n') + fprintf(rejfp, "\n\\ No newline at end of line\n"); + else if (len >= UINT_MAX) + fprintf(rejfp, "\n\\ Line too long\n"); } static void @@ -1024,7 +1022,7 @@ patch_match(LINENUM base, LINENUM offset LINENUM pat_lines = pch_ptrn_lines() - fuzz; const char *ilineptr; const char *plineptr; - unsigned short plinelen; + u_int plinelen; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); Modified: head/usr.bin/patch/pch.c == --- head/usr.bin/patch/pch.cMon Jan 2 16:58:55 2017(r311105) +++ head/usr.bin/patch/pch.cMon Jan 2 17:12:14 2017(r311106) @@ -56,7 +56,7 @@ static LINENUMp_max; /* max allowed va static LINENUM p_context = 3; /* # of context lines */ static LINENUM p_input_line = 0; /* current line # from patch file */ static char**p_line = NULL;/* the text of the hunk */ -static unsigned short *p_len = NULL; /* length of each line */ +static u_int *p_len = NULL; /* length of each line */ static char*p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ @@ -136,7 +136,7 @@ set_hunkmax(void) if (p_line == NULL) p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = malloc(hunkmax * sizeof(unsigned short)); + p_len = malloc(hunkmax * sizeof(u_int)); if (p_char == NULL) p_char = malloc(hunkmax * sizeof(char)); } @@ -153,7 +153,7 @@ grow_hunkmax(void) fatal("Internal memory allocation error\n"); p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); - p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); + p_len = reallocf(p_len, new_hunkmax * sizeof(u_int)); p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { @@ -1210,7 +1210,7 @@ bool pch_swap(void) { char**tp_line; /* the text of the hunk */ - unsigned short *tp_len;/* length of each line */ + u_int *tp_len;/* length of each line */ char*tp_char; /* +, -, and ! */ LINENUM i; LINENUM n; @@ -1367,7 +1367,7 @@ pch_context(void) /* * Return the length of a particular patch line. */ -unsigned short +u_int pch_line_len(LINENUM line) { return p_len[line]; Modified: head/usr.bin/patch/pch.h == --- head/usr.bin/patch/pch.hMon Jan 2 16:58:55 2017(r311105) +++ head/usr.bin/patch/pch.hMon Jan 2 17:12:14 2017(r311106) @@ -44,7 +44,7 @@ bool there_is_another_patch(void); bool another_hunk(void); bool pch_swap(void); char *pfetch(LINENUM); -unsigned short pch_line_len(LINENUM); +u_int pch_line_len(LINENUM); LINENUMpch_first(void); LINENUMpch_ptrn_lines(void); LINENUMpch_newfirst(void); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311105 - head/sys/dev/usb/wlan
Author: avos Date: Mon Jan 2 16:58:55 2017 New Revision: 311105 URL: https://svnweb.freebsd.org/changeset/base/311105 Log: rsu: restore 40Mhz channel support. MFC after:4 days. Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c == --- head/sys/dev/usb/wlan/if_rsu.c Mon Jan 2 16:50:52 2017 (r311104) +++ head/sys/dev/usb/wlan/if_rsu.c Mon Jan 2 16:58:55 2017 (r311105) @@ -775,7 +775,8 @@ rsu_getradiocaps(struct ieee80211com *ic if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, 0); + rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, + (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); } static void ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311104 - head/sys/vm
Author: jhibbits Date: Mon Jan 2 16:50:52 2017 New Revision: 311104 URL: https://svnweb.freebsd.org/changeset/base/311104 Log: Print flags in hex instead of decimal. Hex is easier to grok for flags, and consistent with other prints. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Mon Jan 2 15:19:22 2017(r311103) +++ head/sys/vm/uma_core.c Mon Jan 2 16:50:52 2017(r311104) @@ -1184,7 +1184,7 @@ page_free(void *mem, vm_size_t size, uin else if (flags & UMA_SLAB_KERNEL) vmem = kernel_arena; else - panic("UMA: page_free used with invalid flags %d", flags); + panic("UMA: page_free used with invalid flags %x", flags); kmem_free(vmem, (vm_offset_t)mem, size); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311103 - head/etc
Author: ian Date: Mon Jan 2 15:19:22 2017 New Revision: 311103 URL: https://svnweb.freebsd.org/changeset/base/311103 Log: Update ntp.conf to use the ntpd pool feature. Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org using 3 separate 'server' config lines. That is now replaced with a single 'pool' line which causes ntpd to add multiple servers from the pool. More than just making the config smaller, the pool feature in ntpd has one major advantage over configuring 3 separate servers from a pool: if a server that was added using a 'pool' statement provides bad time (initially or at some later date), ntpd automatically discards it and configures a new different server from the pool without needing to be restarted. These changes also add a 'tos' line to control how many pool servers get added, a 'restrict source' line that is required to allow ntpd to add new peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does nothing and should never have been there (127.127.1.0 is not a valid IP address, it's a refclock identifier). Differential Revision:https://reviews.freebsd.org/D9011 Modified: head/etc/ntp.conf Modified: head/etc/ntp.conf == --- head/etc/ntp.conf Mon Jan 2 15:17:33 2017(r311102) +++ head/etc/ntp.conf Mon Jan 2 15:19:22 2017(r311103) @@ -11,28 +11,43 @@ # # -# The following three servers will give you a random set of three -# NTP servers geographically close to you. -# See http://www.pool.ntp.org/ for details. Note, the pool encourages +# Set the target and limit for adding servers configured via pool statements +# or discovered dynamically via mechanisms such as broadcast and manycast. +# Ntpd automatically adds maxclock-1 servers from configured pools, and may +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistant time. +# +tos minclock 3 maxclock 6 + +# +# The following pool statement will give you a random set of NTP servers +# geographically close to you. A single pool statement adds multiple +# servers from the pool, according to the tos minclock/maxclock targets. +# See http://www.pool.ntp.org/ for details. Note, pool.ntp.org encourages # users with a static IP and good upstream NTP servers to add a server # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # # The option `iburst' is used for faster initial synchronization. # -server 0.freebsd.pool.ntp.org iburst -server 1.freebsd.pool.ntp.org iburst -server 2.freebsd.pool.ntp.org iburst -#server 3.freebsd.pool.ntp.org iburst +pool 0.freebsd.pool.ntp.org iburst # # If you want to pick yourself which country's public NTP server -# you want sync against, comment out the above servers, uncomment -# the next ones and replace CC with the country's abbreviation. -# Make sure that the hostnames resolve to a proper IP address! -# -# server 0.CC.pool.ntp.org iburst -# server 1.CC.pool.ntp.org iburst -# server 2.CC.pool.ntp.org iburst +# you want to sync against, comment out the above pool, uncomment +# the next one, and replace CC with the country's abbreviation. +# Make sure that the hostname resolves to a proper IP address! +# +# pool 0.CC.pool.ntp.org iburst + +# +# To configure a specific server, such as an organization-wide local +# server, add lines similar to the following. One or more specific +# servers can be configured in addition to, or instead of, any server +# pools specified above. When both are configured, ntpd first adds all +# the specific servers, then adds servers from the pool until the tos +# minclock/maxclock targets are met. +# +#server time.my-internal.org iburst # # Security: @@ -40,11 +55,17 @@ server 2.freebsd.pool.ntp.org iburst # By default, only allow time queries and block all other requests # from unauthenticated clients. # +# The "restrict source" line allows peers to be mobilized when added by +# ntpd from a pool, but does not enable mobilizing a new peer association +# by other dynamic means (broadcast, manycast, ntpq commands, etc). +# # See http://support.ntp.org/bin/view/Support/AccessRestrictions # for more information. # -restrict default limited kod nomodify notrap nopeer noquery -restrict -6 default limited kod nomodify notrap nopeer noquery +restrictdefault limited kod nomodify notrap noquery nopeer +restrict -6 default limited kod nomodify notrap noquery nopeer +restrictsource limited kod nomodify notrap noquery + # # Alternatively, the following rules would block all unauthorized access. # @@ -65,7 +86,6 @@ restrict -6 default limited kod nomodify # The following settings allow unrestricted access from the localhost restrict 127.0.0.1 restrict -6 ::1 -restrict 127.127.1.0 # # If a server loses sync with all upstream servers, NTP clients
svn commit: r311102 - head/lib/libc/net
Author: pfg Date: Mon Jan 2 15:17:33 2017 New Revision: 311102 URL: https://svnweb.freebsd.org/changeset/base/311102 Log: Cleanup inelegant calloc(3) introduced in r310984. Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c == --- head/lib/libc/net/getaddrinfo.c Mon Jan 2 15:12:11 2017 (r311101) +++ head/lib/libc/net/getaddrinfo.c Mon Jan 2 15:17:33 2017 (r311102) @@ -691,7 +691,7 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = calloc(1, sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ /* retrieve address selection policy from the kernel */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r311101 - head/lib/libkvm
Author: pfg Date: Mon Jan 2 15:12:11 2017 New Revision: 311101 URL: https://svnweb.freebsd.org/changeset/base/311101 Log: libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from:DragonflyBSD (ecc2e461) MFC after:2 weeks Modified: head/lib/libkvm/kvm.h head/lib/libkvm/kvm_getswapinfo.3 head/lib/libkvm/kvm_getswapinfo.c Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Mon Jan 2 12:54:12 2017(r311100) +++ head/lib/libkvm/kvm.h Mon Jan 2 15:12:11 2017(r311101) @@ -66,11 +66,11 @@ struct proc; struct kvm_swap { charksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX0x0002 Modified: head/lib/libkvm/kvm_getswapinfo.3 == --- head/lib/libkvm/kvm_getswapinfo.3 Mon Jan 2 12:54:12 2017 (r311100) +++ head/lib/libkvm/kvm_getswapinfo.3 Mon Jan 2 15:12:11 2017 (r311101) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fi .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El Modified: head/lib/libkvm/kvm_getswapinfo.c == --- head/lib/libkvm/kvm_getswapinfo.c Mon Jan 2 12:54:12 2017 (r311100) +++ head/lib/libkvm/kvm_getswapinfo.c Mon Jan 2 15:12:11 2017 (r311101) @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -163,7 +164,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r311012 - head/include
Hi Conrad; On 01/01/17 13:17, Conrad Meyer wrote: Hey Pedro, Why not just remove __nonnull and replace it with _Nonnull in the same commit? Best, Conrad The main reason is that I want to MFC this change. Introducing _Nonnull to -stable involves some complexity: It may break use of pre-existing GCC ports. Pedro. On Sun, Jan 1, 2017 at 9:16 AM, Pedro F. Giffuniwrote: Author: pfg Date: Sun Jan 1 17:16:47 2017 New Revision: 311012 URL: https://svnweb.freebsd.org/changeset/base/311012 Log: Remove some uses of the GCC __nonnull() attribute. While the checks are considered useful, the attribute does dangerous optimizations, removing NULL checks where they can be needed. Remove the uses of this attribute introduced in r281130: the changes were inspired on Google's bionic where this attribute is not used anymore. The __nonnull() attribute will be deprecrated from our headers and replaced with the Clang _Nonnull qualifier in the future. MFC after:3 days Modified: head/include/pthread.h head/include/signal.h head/include/stdlib.h Modified: head/include/pthread.h == --- head/include/pthread.h Sun Jan 1 12:35:41 2017(r311011) +++ head/include/pthread.h Sun Jan 1 17:16:47 2017(r311012) @@ -147,25 +147,19 @@ struct _pthread_cleanup_info { */ __BEGIN_DECLS intpthread_atfork(void (*)(void), void (*)(void), void (*)(void)); -intpthread_attr_destroy(pthread_attr_t *) __nonnull(1); +intpthread_attr_destroy(pthread_attr_t *); intpthread_attr_getstack(const pthread_attr_t * __restrict, - void ** __restrict, size_t * __restrict) - __nonnull_all; -intpthread_attr_getstacksize(const pthread_attr_t *, size_t *) - __nonnull_all; + void ** __restrict, size_t * __restrict); +intpthread_attr_getstacksize(const pthread_attr_t *, size_t *); intpthread_attr_getguardsize(const pthread_attr_t *, size_t *); intpthread_attr_getstackaddr(const pthread_attr_t *, void **); -intpthread_attr_getdetachstate(const pthread_attr_t *, int *) - __nonnull_all; -intpthread_attr_init(pthread_attr_t *) __nonnull(1); -intpthread_attr_setstacksize(pthread_attr_t *, size_t) - __nonnull(1); -intpthread_attr_setguardsize(pthread_attr_t *, size_t) - __nonnull(1); -intpthread_attr_setstack(pthread_attr_t *, void *, size_t) - __nonnull(1); +intpthread_attr_getdetachstate(const pthread_attr_t *, int *); +intpthread_attr_init(pthread_attr_t *); +intpthread_attr_setstacksize(pthread_attr_t *, size_t); +intpthread_attr_setguardsize(pthread_attr_t *, size_t); +intpthread_attr_setstack(pthread_attr_t *, void *, size_t); intpthread_attr_setstackaddr(pthread_attr_t *, void *); -intpthread_attr_setdetachstate(pthread_attr_t *, int) __nonnull(1); +intpthread_attr_setdetachstate(pthread_attr_t *, int); intpthread_barrier_destroy(pthread_barrier_t *); intpthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *, unsigned); @@ -173,7 +167,7 @@ int pthread_barrier_wait(pthread_barrie intpthread_barrierattr_destroy(pthread_barrierattr_t *); intpthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); -intpthread_barrierattr_init(pthread_barrierattr_t *) __nonnull(1); +intpthread_barrierattr_init(pthread_barrierattr_t *); intpthread_barrierattr_setpshared(pthread_barrierattr_t *, int); #definepthread_cleanup_push(cleanup_routine, cleanup_arg) \ @@ -189,111 +183,100 @@ int pthread_barrierattr_setpshared(pthr __pthread_cleanup_pop_imp(execute); \ } -intpthread_condattr_destroy(pthread_condattr_t *) __nonnull(1); +intpthread_condattr_destroy(pthread_condattr_t *); intpthread_condattr_getclock(const pthread_condattr_t *, - clockid_t *) __nonnull_all; -intpthread_condattr_getpshared(const pthread_condattr_t *, int *) - __nonnull_all; -intpthread_condattr_init(pthread_condattr_t *) __nonnull(1); -intpthread_condattr_setclock(pthread_condattr_t *, clockid_t) - __nonnull(1); -intpthread_condattr_setpshared(pthread_condattr_t *, int) - __nonnull(1); -intpthread_cond_broadcast(pthread_cond_t *) - __nonnull(1); -int
svn commit: r311055 - head/sys/sys
Author: kib Date: Mon Jan 2 09:02:39 2017 New Revision: 311055 URL: https://svnweb.freebsd.org/changeset/base/311055 Log: Remove unneeded externs keywords. Reindent long lines. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/sys/event.h Modified: head/sys/sys/event.h == --- head/sys/sys/event.hMon Jan 2 08:58:51 2017(r311054) +++ head/sys/sys/event.hMon Jan 2 09:02:39 2017(r311055) @@ -259,30 +259,30 @@ struct knlist; struct mtx; struct rwlock; -extern voidknote(struct knlist *list, long hint, int lockflags); -extern voidknote_fork(struct knlist *list, int pid); -extern struct knlist *knlist_alloc(struct mtx *lock); -extern voidknlist_detach(struct knlist *knl); -extern voidknlist_add(struct knlist *knl, struct knote *kn, int islocked); -extern voidknlist_remove(struct knlist *knl, struct knote *kn, int islocked); -extern int knlist_empty(struct knlist *knl); -extern voidknlist_init(struct knlist *knl, void *lock, -void (*kl_lock)(void *), void (*kl_unlock)(void *), -void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)); -extern voidknlist_init_mtx(struct knlist *knl, struct mtx *lock); -extern voidknlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); -extern voidknlist_destroy(struct knlist *knl); -extern voidknlist_cleardel(struct knlist *knl, struct thread *td, - int islocked, int killkn); +void knote(struct knlist *list, long hint, int lockflags); +void knote_fork(struct knlist *list, int pid); +struct knlist *knlist_alloc(struct mtx *lock); +void knlist_detach(struct knlist *knl); +void knlist_add(struct knlist *knl, struct knote *kn, int islocked); +void knlist_remove(struct knlist *knl, struct knote *kn, int islocked); +intknlist_empty(struct knlist *knl); +void knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *), + void (*kl_unlock)(void *), void (*kl_assert_locked)(void *), + void (*kl_assert_unlocked)(void *)); +void knlist_init_mtx(struct knlist *knl, struct mtx *lock); +void knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock); +void knlist_destroy(struct knlist *knl); +void knlist_cleardel(struct knlist *knl, struct thread *td, + int islocked, int killkn); #define knlist_clear(knl, islocked)\ - knlist_cleardel((knl), NULL, (islocked), 0) + knlist_cleardel((knl), NULL, (islocked), 0) #define knlist_delete(knl, td, islocked) \ - knlist_cleardel((knl), (td), (islocked), 1) -extern voidknote_fdclose(struct thread *p, int fd); -extern int kqfd_register(int fd, struct kevent *kev, struct thread *p, - int waitok); -extern int kqueue_add_filteropts(int filt, struct filterops *filtops); -extern int kqueue_del_filteropts(int filt); + knlist_cleardel((knl), (td), (islocked), 1) +void knote_fdclose(struct thread *p, int fd); +intkqfd_register(int fd, struct kevent *kev, struct thread *p, + int waitok); +intkqueue_add_filteropts(int filt, struct filterops *filtops); +intkqueue_del_filteropts(int filt); #else /* !_KERNEL */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"