From owner-svn-src-stable-10@freebsd.org Sun Jul 16 17:36:24 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D79CFC09E38; Sun, 16 Jul 2017 17:36:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A62BE19F7; Sun, 16 Jul 2017 17:36:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GHaNkY071605; Sun, 16 Jul 2017 17:36:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GHaNTT071604; Sun, 16 Jul 2017 17:36:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201707161736.v6GHaNTT071604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 16 Jul 2017 17:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321051 - in stable: 10/sys/conf 11/sys/conf X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/sys/conf 11/sys/conf X-SVN-Commit-Revision: 321051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2017 17:36:25 -0000 Author: gjb Date: Sun Jul 16 17:36:23 2017 New Revision: 321051 URL: https://svnweb.freebsd.org/changeset/base/321051 Log: MFC r320969: Fix a missing comment marker. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/NOTES Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Sun Jul 16 17:29:27 2017 (r321050) +++ stable/10/sys/conf/NOTES Sun Jul 16 17:36:23 2017 (r321051) @@ -290,7 +290,7 @@ options SX_NOINLINE # TURNSTILE_PROFILING enables rudimentary profiling of the hash table # used to hold active lock queues. # UMTX_PROFILING enables rudimentary profiling of the hash table used - to hold active lock queues. +# to hold active lock queues. # WITNESS enables the witness code which detects deadlocks and cycles # during locking operations. # WITNESS_KDB causes the witness code to drop into the kernel debugger if From owner-svn-src-stable-10@freebsd.org Sun Jul 16 19:25:19 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 668B9C78383; Sun, 16 Jul 2017 19:25:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3040964037; Sun, 16 Jul 2017 19:25:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GJPIi4017596; Sun, 16 Jul 2017 19:25:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJPIpS017595; Sun, 16 Jul 2017 19:25:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707161925.v6GJPIpS017595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 16 Jul 2017 19:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321056 - stable/10/sys/security/mac_bsdextended X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/security/mac_bsdextended X-SVN-Commit-Revision: 321056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2017 19:25:19 -0000 Author: emaste Date: Sun Jul 16 19:25:18 2017 New Revision: 321056 URL: https://svnweb.freebsd.org/changeset/base/321056 Log: MFC r319890: Correct bitwise test in mac_bsdextended ugidfw_rule_valid() PR: 218039 CID: 1008934 Reported by: Coverity, PVS-Studio Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:24:09 2017 (r321055) +++ stable/10/sys/security/mac_bsdextended/mac_bsdextended.c Sun Jul 16 19:25:18 2017 (r321056) @@ -126,7 +126,7 @@ ugidfw_rule_valid(struct mac_bsdextended_rule *rule) return (EINVAL); if ((rule->mbr_object.mbo_neg | MBO_ALL_FLAGS) != MBO_ALL_FLAGS) return (EINVAL); - if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) && + if (((rule->mbr_object.mbo_flags & MBO_TYPE_DEFINED) != 0) && (rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE) return (EINVAL); if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM) From owner-svn-src-stable-10@freebsd.org Sun Jul 16 19:36:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E90C787D0; Sun, 16 Jul 2017 19:36:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D832645E6; Sun, 16 Jul 2017 19:36:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6GJaijR021851; Sun, 16 Jul 2017 19:36:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6GJaiOF021850; Sun, 16 Jul 2017 19:36:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707161936.v6GJaiOF021850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 16 Jul 2017 19:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321057 - stable/10/sys/fs/nfsclient X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsclient X-SVN-Commit-Revision: 321057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jul 2017 19:36:45 -0000 Author: rmacklem Date: Sun Jul 16 19:36:44 2017 New Revision: 321057 URL: https://svnweb.freebsd.org/changeset/base/321057 Log: MFC: r320458 Fix an NFSv3 client case that probably never happens. If an NFSv3 server were to reply with weak cache consistency attributes, but not post operation attributes, the client would use garbage attributes from memory. This was spotted during work on the code for the NFSv4.1 client. I have never seen evidence that this happens and it wouldn't make sense for an NFSv3 server to do this, so this patch is basically "theoretical", but does fix the problem if a server were to do the above. Modified: stable/10/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clport.c Sun Jul 16 19:25:18 2017 (r321056) +++ stable/10/sys/fs/nfsclient/nfs_clport.c Sun Jul 16 19:36:44 2017 (r321057) @@ -666,6 +666,8 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode } } error = nfscl_postop_attr(nd, nap, flagp, stuff); + if (wccflagp != NULL && *flagp == 0) + *wccflagp = 0; } else if ((nd->nd_flag & (ND_NOMOREDATA | ND_NFSV4 | ND_V4WCCATTR)) == (ND_NFSV4 | ND_V4WCCATTR)) { error = nfsv4_loadattr(nd, NULL, &nfsva, NULL, From owner-svn-src-stable-10@freebsd.org Mon Jul 17 06:28:35 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5D1CFD92F; Mon, 17 Jul 2017 06:28:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241F1748F0; Mon, 17 Jul 2017 06:28:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6H6SYmw089266; Mon, 17 Jul 2017 06:28:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6SYvw089263; Mon, 17 Jul 2017 06:28:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170628.v6H6SYvw089263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321067 - in stable/10: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 321067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 06:28:35 -0000 Author: delphij Date: Mon Jul 17 06:28:34 2017 New Revision: 321067 URL: https://svnweb.freebsd.org/changeset/base/321067 Log: MFC r320986: Update arcmsr(4) to 1.40.00.00 in order to add support of ARC-1884 SATA RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/10/share/man/man4/arcmsr.4 stable/10/sys/dev/arcmsr/arcmsr.c stable/10/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Mon Jul 17 06:14:48 2017 (r321066) +++ stable/10/share/man/man4/arcmsr.4 Mon Jul 17 06:28:34 2017 (r321067) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2015 +.Dd July 14, 2017 .Dt ARCMSR 4 .Os .Sh NAME @@ -147,6 +147,8 @@ ARC-1880 ARC-1882 .It ARC-1883 +.It +ARC-1884 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/10/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/10/sys/dev/arcmsr/arcmsr.c Mon Jul 17 06:14:48 2017 (r321066) +++ stable/10/sys/dev/arcmsr/arcmsr.c Mon Jul 17 06:28:34 2017 (r321067) @@ -77,6 +77,7 @@ ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs ** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 +** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 ****************************************************************************************** */ @@ -148,7 +149,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.30.00.00 2015-11-30" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.00 2017-07-11" #include /* ************************************************************************** @@ -185,6 +186,8 @@ static void arcmsr_rescanLun_cb(struct cam_periph *per static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); +static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); +void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); #endif @@ -376,6 +379,12 @@ static u_int32_t arcmsr_disable_allintr( struct Adapte CHIP_REG_WRITE32(HBD_MessageUnit, 0, pcief0_int_enable, ARCMSR_HBDMU_ALL_INT_DISABLE); } break; + case ACB_ADAPTER_TYPE_E: { + /* disable all outbound interrupt */ + intmask_org = CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_mask) ; /* disable outbound message0 int */ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org | ARCMSR_HBEMU_ALL_INTMASKENABLE); + } + break; } return (intmask_org); } @@ -418,6 +427,13 @@ static void arcmsr_enable_allintr( struct AdapterContr acb->outbound_int_enable = mask; } break; + case ACB_ADAPTER_TYPE_E: { + /* enable outbound Post Queue, outbound doorbell Interrupt */ + mask = ~(ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR | ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_mask, intmask_org & mask); + acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f; + } + break; } } /* @@ -503,6 +519,28 @@ static u_int8_t arcmsr_hbd_wait_msgint_ready(struct Ad return (FALSE); } /* +********************************************************************** +********************************************************************** +*/ +static u_int8_t arcmsr_hbe_wait_msgint_ready(struct AdapterControlBlock *acb) +{ + u_int32_t Index, read_doorbell; + u_int8_t Retries = 0x00; + + do { + for(Index=0; Index < 100; Index++) { + read_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + if((read_doorbell ^ acb->in_doorbell) & ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE) { + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0);/*clear interrupt*/ + acb->in_doorbell = read_doorbell; + return TRUE; + } + UDELAY(10000); + }/*max 1 seconds*/ + }while(Retries++ < 20);/*max 20 sec*/ + return (FALSE); +} +/* ************************************************************************ ************************************************************************ */ @@ -576,6 +614,25 @@ static void arcmsr_flush_hbd_cache(struct AdapterContr ************************************************************************ ************************************************************************ */ +static void arcmsr_flush_hbe_cache(struct AdapterControlBlock *acb) +{ + int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + do { + if(arcmsr_hbe_wait_msgint_ready(acb)) { + break; + } else { + retry_count--; + } + }while(retry_count != 0); +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -595,6 +652,10 @@ static void arcmsr_flush_adapter_cache(struct AdapterC arcmsr_flush_hbd_cache(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_flush_hbe_cache(acb); + } + break; } } /* @@ -715,6 +776,19 @@ static void arcmsr_abort_hbd_allcmd(struct AdapterCont ********************************************************************* ********************************************************************* */ +static void arcmsr_abort_hbe_allcmd(struct AdapterControlBlock *acb) +{ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_ABORT_CMD); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); + } +} +/* +********************************************************************* +********************************************************************* +*/ static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -734,6 +808,10 @@ static void arcmsr_abort_allcmd(struct AdapterControlB arcmsr_abort_hbd_allcmd(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_abort_hbe_allcmd(acb); + } + break; } } /* @@ -836,6 +914,9 @@ static void arcmsr_drain_donequeue(struct AdapterContr case ACB_ADAPTER_TYPE_D: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ break; + case ACB_ADAPTER_TYPE_E: + srb = acb->psrb_pool[flag_srb]; + break; case ACB_ADAPTER_TYPE_A: case ACB_ADAPTER_TYPE_B: default: @@ -938,6 +1019,10 @@ static void arcmsr_done4abort_postqueue(struct Adapter arcmsr_hbd_postqueue_isr(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_hbe_postqueue_isr(acb); + } + break; } } /* @@ -963,9 +1048,9 @@ static void arcmsr_iop_reset(struct AdapterControlBloc srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); - printf("arcmsr%d: scsi id=%d lun=%d srb='%p' aborted\n" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p' aborted\n" , acb->pci_unit, srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); } } /* enable all outbound interrupt */ @@ -1149,6 +1234,15 @@ static void arcmsr_post_srb(struct AdapterControlBlock ARCMSR_LOCK_RELEASE(&acb->postDone_lock); } break; + case ACB_ADAPTER_TYPE_E: { + u_int32_t ccb_post_stamp, arc_cdb_size; + + arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; + ccb_post_stamp = (srb->smid | ((arc_cdb_size-1) >> 6)); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_high, 0); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); + } + break; } } /* @@ -1184,6 +1278,12 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_rbuffer; } break; + case ACB_ADAPTER_TYPE_E: { + struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; + + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; + } + break; } return(qbuffer); } @@ -1220,6 +1320,12 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_wbuffer; } break; + case ACB_ADAPTER_TYPE_E: { + struct HBE_MessageUnit *phbcmu = (struct HBE_MessageUnit *)acb->pmu; + + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; + } + break; } return(qbuffer); } @@ -1251,6 +1357,12 @@ static void arcmsr_iop_message_read(struct AdapterCont CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); } break; + case ACB_ADAPTER_TYPE_E: { + /* let IOP know data has been read */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -1293,6 +1405,15 @@ static void arcmsr_iop_message_wrote(struct AdapterCon CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY); } break; + case ACB_ADAPTER_TYPE_E: { + /* + ** push inbound doorbell tell iop, driver data write ok + ** and wait reply on next hwinterrupt for next Qbuffer post + */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_WRITE_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -1352,6 +1473,20 @@ static void arcmsr_stop_hbd_bgrb(struct AdapterControl ************************************************************************ ************************************************************************ */ +static void arcmsr_stop_hbe_bgrb(struct AdapterControlBlock *acb) +{ + acb->acb_flags &= ~ACB_F_MSG_START_BGRB; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n", acb->pci_unit); + } +} +/* +************************************************************************ +************************************************************************ +*/ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -1371,6 +1506,10 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterCon arcmsr_stop_hbd_bgrb(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_stop_hbe_bgrb(acb); + } + break; } } /* @@ -1398,8 +1537,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struc struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; - u_int8_t *buf1 = 0; - u_int32_t *iop_data, *buf2 = 0; + u_int8_t *buf1 = NULL; + u_int32_t *iop_data, *buf2 = NULL; u_int32_t iop_len, data_len; iop_data = (u_int32_t *)prbuffer->data; @@ -1446,7 +1585,8 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || + (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1494,8 +1634,8 @@ static void arcmsr_Write_data_2iop_wqbuffer_D(struct A { u_int8_t *pQbuffer; struct QBUFFER *pwbuffer; - u_int8_t *buf1 = 0; - u_int32_t *iop_data, *buf2 = 0; + u_int8_t *buf1 = NULL; + u_int32_t *iop_data, *buf2 = NULL; u_int32_t allxfer_len = 0, data_len; if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { @@ -1541,7 +1681,8 @@ static void arcmsr_Write_data_2iop_wqbuffer(struct Ada u_int8_t *iop_data; int32_t allxfer_len=0; - if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || + (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1694,6 +1835,14 @@ static void arcmsr_dr_handle(struct AdapterControlBloc devicemap += 4; } break; + case ACB_ADAPTER_TYPE_E: + devicemap = offsetof(struct HBE_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; } if(acb->acb_flags & ACB_F_BUS_HANG_ON) @@ -1792,6 +1941,18 @@ static void arcmsr_hbd_message_isr(struct AdapterContr ************************************************************************** ************************************************************************** */ +static void arcmsr_hbe_message_isr(struct AdapterControlBlock *acb) { + u_int32_t outbound_message; + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); + outbound_message = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[0]); + if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) + arcmsr_dr_handle( acb ); +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { u_int32_t doorbell_status; @@ -1876,6 +2037,35 @@ static void arcmsr_hbd_doorbell_isr(struct AdapterCont ************************************************************************** ************************************************************************** */ +static void arcmsr_hbe_doorbell_isr(struct AdapterControlBlock *acb) +{ + u_int32_t doorbell_status, in_doorbell; + + /* + ******************************************************************* + ** Maybe here we need to check wrqbuffer_lock is lock or not + ** DOORBELL: din! don! + ** check if there are any mail need to pack from firmware + ******************************************************************* + */ + in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /* clear doorbell interrupt */ + doorbell_status = in_doorbell ^ acb->in_doorbell; + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK) { + arcmsr_iop2drv_data_wrote_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK) { + arcmsr_iop2drv_data_read_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE) { + arcmsr_hbe_message_isr(acb); /* messenger of "driver to iop commands" */ + } + acb->in_doorbell = in_doorbell; +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) { u_int32_t flag_srb; @@ -2013,6 +2203,34 @@ static void arcmsr_hbd_postqueue_isr(struct AdapterCon CHIP_REG_READ32(HBD_MessageUnit, 0, outboundlist_interrupt_cause); /*Dummy ioread32 to force pci flush */ } /* +************************************************************************** +************************************************************************** +*/ +static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb) +{ + u_int16_t error; + uint32_t doneq_index; + uint16_t cmdSMID; + + /* + ***************************************************************************** + ** areca cdb command done + ***************************************************************************** + */ + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + doneq_index = acb->doneq_index; + while ((CHIP_REG_READ32(HBE_MessageUnit, 0, reply_post_producer_index) & 0xFFFF) != doneq_index) { + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + arcmsr_drain_donequeue(acb, (u_int32_t)cmdSMID, error); + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + } + acb->doneq_index = doneq_index; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_consumer_index, doneq_index); +} +/* ********************************************************************** ********************************************************************** */ @@ -2143,6 +2361,37 @@ static void arcmsr_handle_hbd_isr( struct AdapterContr // CHIP_REG_READ32(HBD_MessageUnit, 0, pcief0_int_enable); } /* +********************************************************************** +********************************************************************** +*/ +static void arcmsr_handle_hbe_isr( struct AdapterControlBlock *acb) +{ + u_int32_t host_interrupt_status; + /* + ********************************************* + ** check outbound intstatus + ********************************************* + */ + host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status) & + (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR); + if(!host_interrupt_status) { + /*it must be share irq*/ + return; + } + do { + /* MU doorbell interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { + arcmsr_hbe_doorbell_isr(acb); + } + /* MU post queue interrupts*/ + if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { + arcmsr_hbe_postqueue_isr(acb); + } + host_interrupt_status = CHIP_REG_READ32(HBE_MessageUnit, 0, host_int_status); + } while (host_interrupt_status & (ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR | ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR)); +} +/* ****************************************************************************** ****************************************************************************** */ @@ -2161,6 +2410,9 @@ static void arcmsr_interrupt(struct AdapterControlBloc case ACB_ADAPTER_TYPE_D: arcmsr_handle_hbd_isr(acb); break; + case ACB_ADAPTER_TYPE_E: + arcmsr_handle_hbe_isr(acb); + break; default: printf("arcmsr%d: interrupt service," " unknown adapter type =%d\n", acb->pci_unit, acb->adapter_type); @@ -2205,6 +2457,12 @@ static void arcmsr_polling_devmap(void *arg) case ACB_ADAPTER_TYPE_D: CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); break; + + case ACB_ADAPTER_TYPE_E: + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + break; } if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0) @@ -2754,10 +3012,10 @@ static u_int8_t arcmsr_seek_cmd2abort(union ccb *abort if(srb->srb_state == ARCMSR_SRB_START) { if(srb->pccb == abortccb) { srb->srb_state = ARCMSR_SRB_ABORTED; - printf("arcmsr%d:scsi id=%d lun=%d abort srb '%p'" + printf("arcmsr%d:scsi id=%d lun=%jx abort srb '%p'" "outstanding command \n" , acb->pci_unit, abortccb->ccb_h.target_id - , abortccb->ccb_h.target_lun, srb); + , (uintmax_t)abortccb->ccb_h.target_lun, srb); arcmsr_polling_srbdone(acb, srb); /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); @@ -2883,12 +3141,6 @@ static void arcmsr_action(struct cam_sim *psim, union } break; } - case XPT_TARGET_IO: { - /* target mode not yet support vendor specific commands. */ - pccb->ccb_h.status |= CAM_REQ_CMP; - xpt_done(pccb); - break; - } case XPT_PATH_INQ: { struct ccb_pathinq *cpi = &pccb->cpi; @@ -2913,6 +3165,7 @@ static void arcmsr_action(struct cam_sim *psim, union else cpi->base_transfer_speed = 300000; if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1884) || (acb->vendor_device_id == PCIDevVenIDARC1680) || (acb->vendor_device_id == PCIDevVenIDARC1214)) { @@ -2938,7 +3191,6 @@ static void arcmsr_action(struct cam_sim *psim, union pabort_ccb = pccb->cab.abort_ccb; switch (pabort_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: - case XPT_IMMED_NOTIFY: case XPT_CONT_TARGET_IO: if(arcmsr_seek_cmd2abort(pabort_ccb)==TRUE) { pabort_ccb->ccb_h.status |= CAM_REQ_ABORTED; @@ -2998,6 +3250,7 @@ static void arcmsr_action(struct cam_sim *psim, union cts->protocol = PROTO_SCSI; if((acb->vendor_device_id == PCIDevVenIDARC1880) || + (acb->vendor_device_id == PCIDevVenIDARC1884) || (acb->vendor_device_id == PCIDevVenIDARC1680) || (acb->vendor_device_id == PCIDevVenIDARC1214)) { @@ -3157,6 +3410,20 @@ static void arcmsr_start_hbd_bgrb(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_start_hbe_bgrb(struct AdapterControlBlock *acb) +{ + acb->acb_flags |= ACB_F_MSG_START_BGRB; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_START_BGRB); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit); + } +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -3172,6 +3439,9 @@ static void arcmsr_start_adapter_bgrb(struct AdapterCo case ACB_ADAPTER_TYPE_D: arcmsr_start_hbd_bgrb(acb); break; + case ACB_ADAPTER_TYPE_E: + arcmsr_start_hbe_bgrb(acb); + break; } } /* @@ -3210,11 +3480,11 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3269,11 +3539,11 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'" + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'" "poll command abort successfully \n" , acb->pci_unit , srb->pccb->ccb_h.target_id - , srb->pccb->ccb_h.target_lun, srb); + , (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3324,8 +3594,8 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3380,8 +3650,8 @@ polling_ccb_retry: poll_srb_done = (srb == poll_srb) ? 1:0; if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { if(srb->srb_state == ARCMSR_SRB_ABORTED) { - printf("arcmsr%d: scsi id=%d lun=%d srb='%p'poll command abort successfully \n" - , acb->pci_unit, srb->pccb->ccb_h.target_id, srb->pccb->ccb_h.target_lun, srb); + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; arcmsr_srb_complete(srb, 1); continue; @@ -3395,8 +3665,63 @@ polling_ccb_retry: } /* ********************************************************************** +** ********************************************************************** */ +static void arcmsr_polling_hbe_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) +{ + struct CommandControlBlock *srb; + u_int32_t poll_srb_done=0, poll_count=0, doneq_index; + u_int16_t error, cmdSMID; + +polling_ccb_retry: + poll_count++; + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); + while(1) { + doneq_index = acb->doneq_index; + if((CHIP_REG_READ32(HBE_MessageUnit, 0, reply_post_producer_index) & 0xFFFF) == doneq_index) { + if(poll_srb_done) { + break;/*chip FIFO no ccb for completion already*/ + } else { + UDELAY(25000); + if ((poll_count > 100) && (poll_srb != NULL)) { + break; + } + if (acb->srboutstandingcount == 0) { + break; + } + goto polling_ccb_retry; + } + } + cmdSMID = acb->pCompletionQ[doneq_index].cmdSMID; + doneq_index++; + if (doneq_index >= acb->completionQ_entry) + doneq_index = 0; + acb->doneq_index = doneq_index; + srb = acb->psrb_pool[cmdSMID]; + error = (acb->pCompletionQ[doneq_index].cmdFlag & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + if (poll_srb != NULL) + poll_srb_done = (srb == poll_srb) ? 1:0; + if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) { + if(srb->srb_state == ARCMSR_SRB_ABORTED) { + printf("arcmsr%d: scsi id=%d lun=%jx srb='%p'poll command abort successfully \n" + , acb->pci_unit, srb->pccb->ccb_h.target_id, (uintmax_t)srb->pccb->ccb_h.target_lun, srb); + srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; + arcmsr_srb_complete(srb, 1); + continue; + } + printf("arcmsr%d: polling get an illegal srb command done srb='%p'srboutstandingcount=%d \n" + , acb->pci_unit, srb, acb->srboutstandingcount); + continue; + } + arcmsr_report_srb_state(acb, srb, error); + } /*drain reply FIFO*/ + CHIP_REG_WRITE32(HBE_MessageUnit, 0, reply_post_producer_index, doneq_index); +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_polling_srbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_srb) { switch (acb->adapter_type) { @@ -3416,6 +3741,10 @@ static void arcmsr_polling_srbdone(struct AdapterContr arcmsr_polling_hbd_srbdone(acb, poll_srb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_polling_hbe_srbdone(acb, poll_srb); + } + break; } } /* @@ -3622,6 +3951,58 @@ static void arcmsr_get_hbd_config(struct AdapterContro ********************************************************************** ********************************************************************** */ +static void arcmsr_get_hbe_config(struct AdapterControlBlock *acb) +{ + char *acb_firm_model = acb->firm_model; + char *acb_firm_version = acb->firm_version; + char *acb_device_map = acb->device_map; + size_t iop_firm_model = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_MODEL_OFFSET]); /*firm_model,15,60-67*/ + size_t iop_firm_version = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/ + size_t iop_device_map = offsetof(struct HBE_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + int i; + + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit); + } + + i = 0; + while(i < 8) { + *acb_firm_model = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_model+i); + /* 8 bytes firm_model, 15, 60-67*/ + acb_firm_model++; + i++; + } + i = 0; + while(i < 16) { + *acb_firm_version = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_firm_version+i); + /* 16 bytes firm_version, 17, 68-83*/ + acb_firm_version++; + i++; + } + i = 0; + while(i < 16) { + *acb_device_map = bus_space_read_1(acb->btag[0], acb->bhandle[0], iop_device_map+i); + acb_device_map++; + i++; + } + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); + acb->firm_request_len = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ + acb->firm_numbers_queue = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ + acb->firm_sdram_size = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ + acb->firm_ide_channels = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ + acb->firm_cfg_version = CHIP_REG_READ32(HBE_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; +} +/* +********************************************************************** +********************************************************************** +*/ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) { switch (acb->adapter_type) { @@ -3641,6 +4022,10 @@ static void arcmsr_get_firmware_spec(struct AdapterCon arcmsr_get_hbd_config(acb); } break; + case ACB_ADAPTER_TYPE_E: { + arcmsr_get_hbe_config(acb); + } + break; } } /* @@ -3702,6 +4087,18 @@ static void arcmsr_wait_firmware_ready( struct Adapter } } break; + case ACB_ADAPTER_TYPE_E: { + while ((CHIP_REG_READ32(HBE_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK) == 0) + { + if (timeout++ > 4000) /* (4000*15)/1000 = 60 sec */ + { + printf( "arcmsr%d:timed out waiting for firmware ready\n", acb->pci_unit); + return; + } + UDELAY(15000); /* wait 15 milli-seconds */ + } + } + break; } } /* @@ -3745,6 +4142,14 @@ static void arcmsr_clear_doorbell_queue_buffer( struct } break; + case ACB_ADAPTER_TYPE_E: { + /* empty doorbell Qbuffer if door bell ringed */ + acb->in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear doorbell interrupt */ + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + } + break; } } /* @@ -3851,6 +4256,27 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont } } break; + case ACB_ADAPTER_TYPE_E: { + u_int32_t cdb_phyaddr_lo32; + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + offsetof(struct CommandControlBlock, arcmsr_cdb); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[1], ARCMSR_SIGNATURE_1884); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[2], cdb_phyaddr_lo32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[3], srb_phyaddr_hi32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[4], SRB_SIZE); + cdb_phyaddr_lo32 = srb_phyaddr_lo32 + ARCMSR_SRBS_POOL_SIZE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[5], cdb_phyaddr_lo32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[6], srb_phyaddr_hi32); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, msgcode_rwbuffer[7], COMPLETION_Q_POOL_SIZE); + CHIP_REG_WRITE32(HBE_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_SET_CONFIG); + acb->out_doorbell ^= ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE; + CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, acb->out_doorbell); + if(!arcmsr_hbe_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'set srb high part physical address' timeout \n", acb->pci_unit); + return FALSE; + } + } + break; } return (TRUE); } @@ -3860,21 +4286,14 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterCont */ static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb) { - switch (acb->adapter_type) + if (acb->adapter_type == ACB_ADAPTER_TYPE_B) { - case ACB_ADAPTER_TYPE_A: - case ACB_ADAPTER_TYPE_C: - case ACB_ADAPTER_TYPE_D: - break; - case ACB_ADAPTER_TYPE_B: { - struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ACTIVE_EOI_MODE); - if(!arcmsr_hbb_wait_msgint_ready(acb)) { - printf( "arcmsr%d: 'iop enable eoi mode' timeout \n", acb->pci_unit); - return; - } + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ACTIVE_EOI_MODE); + if(!arcmsr_hbb_wait_msgint_ready(acb)) { + printf( "arcmsr%d: 'iop enable eoi mode' timeout \n", acb->pci_unit); + return; } - break; } } /* @@ -3920,7 +4339,8 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg " srb dmamap bus_dmamap_create error\n", acb->pci_unit); return; } - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D)) + if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) + || (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { srb_tmp->cdb_phyaddr_low = srb_phyaddr; srb_tmp->cdb_phyaddr_high = (u_int32_t)((srb_phyaddr >> 16) >> 16); @@ -3928,10 +4348,12 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg else srb_tmp->cdb_phyaddr_low = srb_phyaddr >> 5; srb_tmp->acb = acb; + srb_tmp->smid = i << 16; acb->srbworkingQ[i] = acb->psrb_pool[i] = srb_tmp; srb_phyaddr = srb_phyaddr + SRB_SIZE; srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp + SRB_SIZE); } + acb->pCompletionQ = (pCompletion_Q)srb_tmp; acb->vir2phy_offset = (unsigned long)srb_tmp - (unsigned long)srb_phyaddr; } /* @@ -3999,6 +4421,12 @@ static u_int32_t arcmsr_initialize(device_t dev) max_coherent_size = ARCMSR_SRBS_POOL_SIZE; } break; + case PCIDevVenIDARC1884: + acb->adapter_type = ACB_ADAPTER_TYPE_E; + acb->adapter_bus_speed = ACB_BUS_SPEED_12G; + max_coherent_size = ARCMSR_SRBS_POOL_SIZE + COMPLETION_Q_POOL_SIZE; + acb->completionQ_entry = COMPLETION_Q_POOL_SIZE / sizeof(struct deliver_completeQ); + break; case PCIDevVenIDARC1214: { acb->adapter_type = ACB_ADAPTER_TYPE_D; acb->adapter_bus_speed = ACB_BUS_SPEED_6G; @@ -4147,141 +4575,177 @@ static u_int32_t arcmsr_initialize(device_t dev) pci_write_config(dev, PCIR_COMMAND, pci_command, 2); switch(acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { - u_int32_t rid0 = PCIR_BAR(0); - vm_offset_t mem_base0; + u_int32_t rid0 = PCIR_BAR(0); + vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); - if(acb->sys_res_arcmsr[0] == NULL) { - arcmsr_free_resource(acb); - printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); - return ENOMEM; - } - if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); - return ENXIO; - } - mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); - if(mem_base0 == 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); - return ENXIO; - } - acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); - acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); - acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); + if(acb->sys_res_arcmsr[0] == NULL) { + arcmsr_free_resource(acb); + printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); + return ENOMEM; } + if(rman_get_start(acb->sys_res_arcmsr[0]) <= 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_start failure!\n", device_get_unit(dev)); + return ENXIO; + } + mem_base0 = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[0]); + if(mem_base0 == 0) { + arcmsr_free_resource(acb); + printf("arcmsr%d: rman_get_virtual failure!\n", device_get_unit(dev)); + return ENXIO; + } + acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); + acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); + acb->pmu = (struct MessageUnit_UNION *)mem_base0; + acb->rid = 0; + } break; case ACB_ADAPTER_TYPE_B: { - struct HBB_MessageUnit *phbbmu; - struct CommandControlBlock *freesrb; - u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) }; - vm_offset_t mem_base[]={0,0}; - u_long size; - if (vendor_dev_id == PCIDevVenIDARC1203) - size = sizeof(struct HBB_DOORBELL_1203); - else - size = sizeof(struct HBB_DOORBELL); - for(i=0; i < 2; i++) { - if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } - if(acb->sys_res_arcmsr[i] == NULL) { - arcmsr_free_resource(acb); - printf("arcmsr%d: bus_alloc_resource %d failure!\n", device_get_unit(dev), i); - return ENOMEM; - } - if(rman_get_start(acb->sys_res_arcmsr[i]) <= 0) { - arcmsr_free_resource(acb); - printf("arcmsr%d: rman_get_start %d failure!\n", device_get_unit(dev), i); - return ENXIO; - } - mem_base[i] = (vm_offset_t) rman_get_virtual(acb->sys_res_arcmsr[i]); - if(mem_base[i] == 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Jul 17 06:37:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E220BCFDD95; Mon, 17 Jul 2017 06:37:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09E875115; Mon, 17 Jul 2017 06:37:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6H6bk9r093490; Mon, 17 Jul 2017 06:37:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6bkpT093489; Mon, 17 Jul 2017 06:37:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170637.v6H6bkpT093489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321069 - stable/10/libexec/rshd X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/libexec/rshd X-SVN-Commit-Revision: 321069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 06:37:48 -0000 Author: delphij Date: Mon Jul 17 06:37:46 2017 New Revision: 321069 URL: https://svnweb.freebsd.org/changeset/base/321069 Log: MFC r320433: Use strlcpy() instead of strncpy() and nul-terminating. Modified: stable/10/libexec/rshd/rshd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rshd/rshd.c ============================================================================== --- stable/10/libexec/rshd/rshd.c Mon Jul 17 06:36:42 2017 (r321068) +++ stable/10/libexec/rshd/rshd.c Mon Jul 17 06:37:46 2017 (r321069) @@ -322,8 +322,7 @@ doit(struct sockaddr *fromp) pam_err = pam_authenticate(pamh, 0); if (pam_err == PAM_SUCCESS) { if ((pam_err = pam_get_user(pamh, &cp, NULL)) == PAM_SUCCESS) { - strncpy(luser, cp, sizeof(luser)); - luser[sizeof(luser) - 1] = '\0'; + strlcpy(luser, cp, sizeof(luser)); /* XXX truncation! */ } pam_err = pam_acct_mgmt(pamh, 0); @@ -364,9 +363,7 @@ doit(struct sockaddr *fromp) if (lc != NULL && fromp->sa_family == AF_INET) { /*XXX*/ char remote_ip[MAXHOSTNAMELEN]; - strncpy(remote_ip, numericname, - sizeof(remote_ip) - 1); - remote_ip[sizeof(remote_ip) - 1] = 0; + strlcpy(remote_ip, numericname, sizeof(remote_ip)); /* XXX truncation! */ if (!auth_hostok(lc, rhost, remote_ip)) { syslog(LOG_INFO|LOG_AUTH, From owner-svn-src-stable-10@freebsd.org Mon Jul 17 06:46:58 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 997F3CFE091; Mon, 17 Jul 2017 06:46:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 634677571A; Mon, 17 Jul 2017 06:46:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6H6kvSd097565; Mon, 17 Jul 2017 06:46:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H6kv1t097562; Mon, 17 Jul 2017 06:46:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707170646.v6H6kv1t097562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Jul 2017 06:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321071 - stable/10/lib/libstand X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/lib/libstand X-SVN-Commit-Revision: 321071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 06:46:58 -0000 Author: delphij Date: Mon Jul 17 06:46:57 2017 New Revision: 321071 URL: https://svnweb.freebsd.org/changeset/base/321071 Log: MFC r320468: Don't bother to set target for SEEK_END. While there also collapase SEEK_END into default case in lseek. Modified: stable/10/lib/libstand/bzipfs.c stable/10/lib/libstand/gzipfs.c stable/10/lib/libstand/lseek.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/bzipfs.c ============================================================================== --- stable/10/lib/libstand/bzipfs.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/bzipfs.c Mon Jul 17 06:46:57 2017 (r321071) @@ -320,8 +320,6 @@ bzf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + bzf->bzf_bzstream.total_out_lo32; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/10/lib/libstand/gzipfs.c ============================================================================== --- stable/10/lib/libstand/gzipfs.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/gzipfs.c Mon Jul 17 06:46:57 2017 (r321071) @@ -300,8 +300,6 @@ zf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + zf->zf_zstream.total_out; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); Modified: stable/10/lib/libstand/lseek.c ============================================================================== --- stable/10/lib/libstand/lseek.c Mon Jul 17 06:45:13 2017 (r321070) +++ stable/10/lib/libstand/lseek.c Mon Jul 17 06:46:57 2017 (r321071) @@ -87,7 +87,6 @@ lseek(int fd, off_t offset, int where) case SEEK_CUR: f->f_offset += offset; break; - case SEEK_END: default: errno = EOFFSET; return (-1); From owner-svn-src-stable-10@freebsd.org Mon Jul 17 09:26:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19219D6D594; Mon, 17 Jul 2017 09:26:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B7E7E076; Mon, 17 Jul 2017 09:26:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6H9QhGt062786; Mon, 17 Jul 2017 09:26:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6H9Qhj2062785; Mon, 17 Jul 2017 09:26:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707170926.v6H9Qhj2062785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 17 Jul 2017 09:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321073 - stable/10/share/misc X-SVN-Group: stable-10 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/10/share/misc X-SVN-Commit-Revision: 321073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 09:26:44 -0000 Author: bapt Date: Mon Jul 17 09:26:42 2017 New Revision: 321073 URL: https://svnweb.freebsd.org/changeset/base/321073 Log: MFC r320988: Update pci_vendors to 2017.07.13 Modified: stable/10/share/misc/pci_vendors Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/pci_vendors ============================================================================== --- stable/10/share/misc/pci_vendors Mon Jul 17 08:53:51 2017 (r321072) +++ stable/10/share/misc/pci_vendors Mon Jul 17 09:26:42 2017 (r321073) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.05.25 -# Date: 2017-05-25 03:15:02 +# Version: 2017.07.13 +# Date: 2017-07-13 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -561,6 +561,7 @@ 00af SAS3408 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0200 ThinkSystem 430-8i SAS/SATA 12Gb HBA 1d49 0202 ThinkSystem 430-8e SAS/SATA 12Gb HBA + 1d49 0204 ThinkSystem 430-8i SAS/SATA 12Gb Dense HBA 00be SAS3504 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00bf SAS3404 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 00c0 SAS3324 PCI-Express Fusion-MPT SAS-3 @@ -2139,13 +2140,12 @@ # Radeon HD 7970 X2 1787 2317 Radeon HD 7990 1787 3000 Tahiti XT2 [Radeon HD 7970 GHz Edition] - 6799 New Zealand [Radeon HD 7900 Series] 679a Tahiti PRO [Radeon HD 7950/8950 OEM / R9 280] 1002 0b01 Radeon HD 8950 OEM 1002 3000 Tahiti PRO2 [Radeon HD 7950 Boost] 1462 3000 Radeon HD 8950 OEM 174b a003 Radeon R9 280 - 679b Malta [Radeon HD 7990] + 679b Malta [Radeon HD 7990/8990 OEM] 1002 0b28 Radeon HD 8990 OEM 1002 0b2a Radeon HD 7990 1462 8036 Radeon HD 8990 OEM @@ -2205,28 +2205,34 @@ 174b e324 Sapphire Nitro R9 390 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE - 67c0 Ellesmere [Polaris10] + 67c0 Ellesmere [Radeon Pro WX 7100] 67c4 Ellesmere [Radeon Pro WX 7100] + 1002 0336 Radeon Pro Duo + 1002 1336 Radeon Pro Duo 67c7 Ellesmere [Radeon Pro WX 5100] 67ca Ellesmere [Polaris10] 67cc Ellesmere [Polaris10] 67cf Ellesmere [Polaris10] - 67df Ellesmere [Radeon RX 470/480] + 67df Ellesmere [Radeon RX 470/480/570/580] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 1043 04fd Radeon RX 480 8GB + 1458 22f0 Radeon RX 570 1462 3411 Radeon RX 470 1462 3413 Radeon RX 480 148c 2372 Radeon RX 480 148c 2373 Radeon RX 470 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 + 1682 9588 Radeon RX 580 XTR 174b e347 Radeon RX 470/480 174b e349 Radeon RX 470 1787 a470 Radeon RX 470 1787 a480 Radeon RX 480 + 1da2 e353 Sapphire Radeon RX 580 Pulse 8GB + 1da2 e366 Radeon RX 570 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] 67e3 Baffin [Radeon Pro WX 4100] @@ -2234,7 +2240,7 @@ 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] 67ef Baffin [Radeon RX 460] - 67ff Baffin [Polaris11] + 67ff Baffin [Radeon RX 560] 6800 Wimbledon XT [Radeon HD 7970M] 1002 0124 Radeon HD 7970M 8086 2110 Radeon HD 7970M @@ -2430,6 +2436,7 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] + 6863 Vega 10 [Radeon Vega Frontier Edition] 687f Vega [Radeon RX Vega] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] @@ -2940,9 +2947,10 @@ 174b e308 Radeon R9 380 Nitro 4G D5 6980 Polaris12 6981 Polaris12 - 6985 Polaris12 + 6985 Lexa XT [Radeon PRO WX 3100] 6986 Polaris12 6987 Polaris12 + 6995 Lexa XT [Radeon PRO WX 2100] 699f Lexa PRO [Radeon RX 550] 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge @@ -3804,6 +3812,7 @@ 1014 0338 PCI-X DDR Auxiliary Cache Adapter (575C) 0302 Winnipeg PCI-X Host Bridge 0308 CalIOC2 PCI-E Root Port + 0311 FC 5740/1954 4-Port 10/100/1000 Base-TX PCI-X Adapter for POWER 0314 ZISC 036 Neural accelerator card 032d Axon - Cell Companion Chip 1014 03a1 PCIe PowerXCell 8i Cell Accelerator Board @@ -3834,6 +3843,7 @@ 1014 04c7 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCA) 1014 04c8 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CD2) 1014 04c9 PCIe3 x 8 Cache SAS RAID Internal Adapter 6GB(2CCD) + 03dc POWER8 Host Bridge (PHB3) 044b GenWQE Accelerator Adapter 04aa Flash Adapter 90 (PCIe2 0.9TB) 04da PCI-E IPR SAS+ Adapter (ASIC) @@ -4499,6 +4509,8 @@ 0533 MGA G200EH 103c 3381 iLO4 0534 G200eR2 + 0538 G200eH + 1590 00e4 iLO5 VGA 0540 M91XX 102b 2080 M9140 LP PCIe x16 102b 20c0 Xenia @@ -5011,6 +5023,8 @@ 12ee PCI-X 2.0 Local Bus Adapter 1302 RMP-3 Shared Memory Driver 1303 RMP-3 (Remote Management Processor) + 22f6 iLO5 Virtual USB Controller + 1590 00e4 iLO5 Standard Virtual USB Controller 2910 E2910A PCIBus Exerciser 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer 3206 Adaptec Embedded Serial ATA HostRAID @@ -5398,6 +5412,7 @@ 1546 803c FWB-PCIE1X11B 8240 XIO2001 PCI Express-to-PCI Bridge 8241 TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller + 1014 04b2 S824 (8286-42A) 8400 ACX 100 22Mbps Wireless Interface 1186 3b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus] 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter @@ -6015,6 +6030,7 @@ 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter + 1590 0223 Synergy 6810C 25/50Gb Ethernet Adapter 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter @@ -6068,8 +6084,12 @@ 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA 103c 7040 FC1142SR 4Gb 1-port PCIe Fibre Channel Host Bus Adapter [HPAE311A] 2532 ISP2532-based 8Gb Fibre Channel to PCI Express HBA + 1014 041e FC EN0Y/EN12 PCIe2 LP 8 Gb 4-port Fibre Channel Adapter for POWER 103c 3262 StorageWorks 81Q 103c 3263 StorageWorks 82Q + 1077 015c QLE2560 PCI Express to 8Gb FC Single Channel + 1077 015d QLE2562 PCI Express to 8Gb FC Dual Channel + 1077 015e QLE2564 PCI Express to 8Gb FC Quad Channel 1077 0167 QME2572 Dual Port FC8 HBA Mezzanine 1590 00fc StoreFabric 84Q 8Gb Quad Port Fibre Channel Host Bus Adapter 3022 ISP4022-based Ethernet NIC @@ -6084,6 +6104,7 @@ 7322 IBA7322 QDR InfiniBand HCA 8000 10GbE Converged Network Adapter (TCP/IP Networking) 8001 10GbE Converged Network Adapter (FCoE) + 1014 03af FC 5708/5270 10 Gb FCoE PCIe Dual Port Adapter for POWER 8020 cLOM8214 1/10GbE Controller 1028 1f64 QMD8262-k 10G DP bNDC KR 103c 3346 CN1000Q Dual Port Converged Network Adapter @@ -6107,15 +6128,27 @@ 8031 8300 Series 10GbE Converged Network Adapter (FCoE) 8032 8300 Series 10GbE Converged Network Adapter (iSCSI) 8070 FastLinQ QL41000 Series 10/25/40/50GbE Controller + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 0011 FastLinQ QL41212H 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter 8080 FastLinQ QL41000 Series 10/25/40/50GbE Controller (FCoE) + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter 1077 000e FastLinQ QL41162H 10GbE FCoE Adapter 8084 FastLinQ QL41000 Series 10/25/40/50GbE Controller (iSCSI) + 1077 0001 10GE 2P QL41162HxRJ-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE iSCSI Adapter 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter 8090 FastLinQ QL41000 Series Gigabit Ethernet Controller (SR-IOV VF) + 1077 0001 25GE 2P QL41262HxCU-DE Adapter + 1077 0002 10GE 2P QL41112HxCU-DE Adapter + 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 000d FastLinQ QL41262H 25GbE FCoE Adapter (SR-IOV VF) 1077 000e FastLinQ QL41162H 10GbE iSCSI Adapter (SR-IOV VF) 1077 0011 FastLinQ QL41212H 25GbE Adapter (SR-IOV VF) @@ -9947,6 +9980,8 @@ 0f02 GF108 [GeForce GT 730] 0f06 GF108 [GeForce GT 730] 0fb0 GM200 High Definition Audio + 0fb8 GP108 High Definition Audio Controller + 0fb9 GP107GL High Definition Audio Controller 0fbb GM204 High Definition Audio Controller 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] @@ -10620,6 +10655,7 @@ 134f GM108M [GeForce 920MX] 137a GM108GLM [Quadro K620M / Quadro M500M] 17aa 505a Quadro M500M + 137b GM108GLM [Quadro M520 Mobile] 137d GM108M [GeForce 940A] 1380 GM107 [GeForce GTX 750 Ti] 1381 GM107 [GeForce GTX 750] @@ -10665,6 +10701,7 @@ 13d8 GM204M [GeForce GTX 970M] 13d9 GM204M [GeForce GTX 965M] 13da GM204M [GeForce GTX 980] + 13e7 GM204 [GeForce GTX 980 Engineering Sample] 13f0 GM204GL [Quadro M5000] 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] @@ -10690,7 +10727,7 @@ 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] - 161a GM204M [GeForce GTX 980] + 161a GM204M [GeForce GTX 980 Mobile] 1667 GM204M [GeForce GTX 965M] 1725 GP100 172e GP100 @@ -10744,10 +10781,11 @@ 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL - 1cb1 GP107GL [Quardo P1000] - 1cb2 GP107GL [Quardo P600] - 1cb3 GP107GL [Quardo P400] + 1cb1 GP107GL [Quadro P1000] + 1cb2 GP107GL [Quadro P600] + 1cb3 GP107GL [Quadro P400] 1d01 GP108 [GeForce GT 1030] + 1d10 GP108 [GeForce MX150] 1d81 GV100 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) @@ -10771,7 +10809,8 @@ e100 Proteus-X: LightPulse IOV Fibre Channel Host Adapter e131 LightPulse 8Gb/s PCIe Shared I/O Fibre Channel Adapter e180 Proteus-X: LightPulse IOV Fibre Channel Host Adapter - e200 Lancer-X: LightPulse Fibre Channel Host Adapter + e200 LightPulse LPe16002 + 1014 03f1 PCIe2 16 Gb 2-port Fibre Channel Adapter (FC EL5B; CCIN 577F) e208 LightPulse 16Gb Fibre Channel Host Adapter (Lancer-VF) e220 OneConnect NIC (Lancer) 17aa 1054 ThinkServer LPm16002B-M6-L AnyFabric @@ -10800,6 +10839,7 @@ f0e5 Zephyr LightPulse Fibre Channel Host Adapter f0f5 Neptune LightPulse Fibre Channel Host Adapter f100 Saturn-X: LightPulse Fibre Channel Host Adapter + 1014 038a 8Gb PCI Express Dual Port FC Adapter for POWER 103c 3282 8Gb Dual-port PCI-e FC HBA f111 Saturn-X LightPulse Fibre Channel Host Adapter f112 Saturn-X LightPulse Fibre Channel Host Adapter @@ -10822,6 +10862,8 @@ fc40 Saturn-X: LightPulse Fibre Channel Host Adapter fc50 Proteus-X: LightPulse IOV Fibre Channel Host Adapter fd00 Helios-X LightPulse Fibre Channel Host Adapter +# Also IBM FC 5759 / FC 1910 for POWER + 10df fd02 LightPulse LP11002 Dual-port 4Gigabit PCI Fibre Channel Adapter fd11 Helios-X LightPulse Fibre Channel Host Adapter fd12 Helios-X LightPulse Fibre Channel Host Adapter fe00 Zephyr-X LightPulse Fibre Channel Host Adapter @@ -10923,6 +10965,7 @@ 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 17aa 224f ThinkPad X1 Carbon 5th Gen 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader 5288 RTS5288 PCI Express Card Reader @@ -11028,6 +11071,7 @@ 1775 11cc CC11/CL11 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter + 8086 2055 NUC Kit DN2820FYKH 8086 d615 Desktop Board D510MO/D525MW 8169 RTL8169 PCI Gigabit Ethernet Controller 1025 0079 Aspire 5024WLMi @@ -14773,7 +14817,7 @@ 12d6 Analogic Corp 12d7 Biotronic SRL 12d8 Pericom Semiconductor - 01a7 PI7C21P100 PCI to PCI Bridge + 01a7 7C21P100 2-port PCI-X to PCI-X Bridge 400a PI7C9X442SL PCI Express Bridge Port 400e PI7C9X442SL USB OHCI Controller 400f PI7C9X442SL USB EHCI Controller @@ -15081,6 +15125,8 @@ 5160 RealSSD P420h 5161 RealSSD P420m 5163 RealSSD P425m + 5180 9100 PRO NVMe SSD + 5181 9100 MAX NVMe SSD 1345 Arescom Inc 1347 Odetics 1349 Sumitomo Electric Industries, Ltd. @@ -16081,6 +16127,7 @@ 509f T540-509F Unified Wire Ethernet Controller 50a0 T540-50A0 Unified Wire Ethernet Controller 50a1 T540-50A1 Unified Wire Ethernet Controller + 50a2 T580-50A2 Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16133,6 +16180,7 @@ 549f T540-509F Unified Wire Ethernet Controller 54a0 T540-50A0 Unified Wire Ethernet Controller 54a1 T540-50A1 Unified Wire Ethernet Controller + 54a2 T580-50A2 Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16185,6 +16233,7 @@ 559f T540-509F Unified Wire Storage Controller 55a0 T540-50A0 Unified Wire Storage Controller 55a1 T540-50A1 Unified Wire Storage Controller + 55a2 T580-50A2 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16237,6 +16286,7 @@ 569f T540-509F Unified Wire Storage Controller 56a0 T540-50A0 Unified Wire Storage Controller 56a1 T540-50A1 Unified Wire Storage Controller + 56a2 T580-50A2 Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16328,6 +16378,7 @@ 589f T540-509F Unified Wire Ethernet Controller [VF] 58a0 T540-50A0 Unified Wire Ethernet Controller [VF] 58a1 T540-50A1 Unified Wire Ethernet Controller [VF] + 58a2 T580-50A2 Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16343,6 +16394,9 @@ 6015 T6201-BT Unified Wire Ethernet Controller 6080 T6225-6080 Unified Wire Ethernet Controller 6081 T62100-6081 Unified Wire Ethernet Controller + 6082 T6225-6082 Unified Wire Ethernet Controller + 6083 T62100-6083 Unified Wire Ethernet Controller + 6084 T64100-6084 Unified Wire Ethernet Controller 6401 T6225-CR Unified Wire Ethernet Controller 6402 T6225-SO-CR Unified Wire Ethernet Controller 6403 T6425-CR Unified Wire Ethernet Controller @@ -16358,6 +16412,9 @@ 6415 T6201-BT Unified Wire Ethernet Controller 6480 T6225-6080 Unified Wire Ethernet Controller 6481 T62100-6081 Unified Wire Ethernet Controller + 6482 T6225-6082 Unified Wire Ethernet Controller + 6483 T62100-6083 Unified Wire Ethernet Controller + 6484 T64100-6084 Unified Wire Ethernet Controller 6501 T6225-CR Unified Wire Storage Controller 6502 T6225-SO-CR Unified Wire Storage Controller 6503 T6425-CR Unified Wire Storage Controller @@ -16373,6 +16430,9 @@ 6515 T6201-BT Unified Wire Storage Controller 6580 T6225-6080 Unified Wire Storage Controller 6581 T62100-6081 Unified Wire Storage Controller + 6582 T6225-6082 Unified Wire Storage Controller + 6583 T62100-6083 Unified Wire Storage Controller + 6584 T64100-6084 Unified Wire Storage Controller 6601 T6225-CR Unified Wire Storage Controller 6602 T6225-SO-CR Unified Wire Storage Controller 6603 T6425-CR Unified Wire Storage Controller @@ -16388,6 +16448,9 @@ 6615 T6201-BT Unified Wire Storage Controller 6680 T6225-6080 Unified Wire Storage Controller 6681 T62100-6081 Unified Wire Storage Controller + 6682 T6225-6082 Unified Wire Storage Controller + 6683 T62100-6083 Unified Wire Storage Controller + 6684 T64100-6084 Unified Wire Storage Controller 6801 T6225-CR Unified Wire Ethernet Controller [VF] 6802 T6225-SO-CR Unified Wire Ethernet Controller [VF] 6803 T6425-CR Unified Wire Ethernet Controller [VF] @@ -16403,6 +16466,9 @@ 6815 T6201-BT Unified Wire Ethernet Controller [VF] 6880 T6225-6080 Unified Wire Ethernet Controller [VF] 6881 T62100-6081 Unified Wire Ethernet Controller [VF] + 6882 T6225-6082 Unified Wire Ethernet Controller [VF] + 6883 T62100-6083 Unified Wire Ethernet Controller [VF] + 6884 T64100-6084 Unified Wire Ethernet Controller [VF] a000 PE10K Unified Wire Ethernet Controller 1426 Storage Technology Corp. 1427 Better On-Line Solutions @@ -17003,6 +17069,7 @@ 1028 1f68 BCM57800 1-Gigabit Ethernet 168d NetXtreme II BCM57840 10/20 Gigabit Ethernet 168e NetXtreme II BCM57810 10 Gigabit Ethernet + 1014 0492 PCIe2 2-port 10 GbE BaseT RJ45 Adapter (FC EN0W; CCIN 2CC4) 103c 1798 Flex-10 10Gb 2-port 530FLB Adapter [Meru] 103c 17a5 Flex-10 10Gb 2-port 530M Adapter 103c 18d3 Ethernet 10Gb 2-port 530T Adapter @@ -17929,7 +17996,8 @@ 0001 SOC-it 101 System Controller 1540 PROVIDEO MULTIMEDIA Co Ltd 1541 MACHONE Communications -1542 Concurrent Computer Corporation +# nee VIVID Technology Inc. +1542 Concurrent Real-Time 9260 RCIM-II Real-Time Clock & Interrupt Module 9271 RCIM-III Real-Time Clock & Interrupt Module (PCIe) 9272 Pulse Width Modulator Card @@ -18133,6 +18201,7 @@ 103c 18d6 InfiniBand FDR/EN 10/40Gb Dual Port 544QSFP Adapter 15b3 0025 ConnectX-3 IB QDR Dual Port Mezzanine Card 15b3 0026 ConnectX-3 IB FDR Dual Port Mezzanine Card + 15b3 0028 ConnectX-3 VPI Dual QSFP+ Port QDR Infiniband 40Gb/s or 10Gb Ethernet 15b3 0059 ConnectX-3 VPI IB FDR/40 GbE Single Port QSFP+ Mezzanine Card 15b3 0065 ConnectX-3 VPI IB FDR/40 GbE Dual Port QSFP+ Adapter 15b3 0066 ConnectX-3 IB FDR10 Dual Port Mezzanine Card @@ -18209,6 +18278,7 @@ 6372 MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe 2.0 2.5GT/s] 6732 MT26418 [ConnectX VPI PCIe 2.0 5GT/s - IB DDR / 10GigE] 673c MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE] + 1014 0487 GX++ 1-port 4X IB QDR Adapter for Power 795 103c 1782 4X QDR InfiniBand Mezzanine HCA for c-Class BladeSystem 15b3 0021 HP InfiniBand 4X QDR CX-2 PCI-e G2 Dual Port HCA 6746 MT26438 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE Virtualization+] @@ -18217,6 +18287,8 @@ 6750 MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] 1014 0461 2-Port 10 GbE RoCE SR LP PCIe2 (rev b0) 15b3 0018 HP 10 GbE PCI-e G2 Dual-Port NIC (rev C1) +# FC EC26 + 15b3 6572 IBM Flex System EN4132 2-port 10Gb RoCE Adapter 675a MT25408 [ConnectX EN 10GigE 10GBaseT, PCIe Gen2 5GT/s] 6764 MT26468 [ConnectX EN 10GigE, PCIe 2.0 5GT/s Virtualization+] 103c 3313 NC542m Dual Port Flex-10 10GbE BLc Adapter @@ -19746,15 +19818,15 @@ 1924 800e SFN7x42Q-R2 Flareon Ultra 7000 Series 10/40G Adapter 1924 800f SFN7xx4F-R1 Flareon Ultra 7000 Series 10G Adapter 0a03 SFC9220 10/40G Ethernet Controller - 1924 8011 SFN8022-R1 Flareon 8000 Series 10G Adapter - 1924 8012 SFN8522-R1 Flareon Ultra 8000 Series 10G Adapter - 1924 8013 SFN8042-R1 Flareon 8000 Series 10/40G Adapter - 1924 8014 SFN8542-R1 Flareon Ultra 8000 Series 10/40G Adapter - 1924 8016 SFN8022-R2 Flareon 8000 Series 10G Adapter - 1924 8017 SFN8522-R2 Flareon Ultra 8000 Series 10G Adapter - 1924 8018 SFN8042-R2 Flareon 8000 Series 10/40G Adapter - 1924 8019 SFN8542-R2 Flareon Ultra 8000 Series 10/40G Adapter - 1924 801a SFN8722-R1 Flareon Ultra 8000 Series OCP 10G Adapter + 1924 8011 SFN8022-R1 8000 Series 10G Adapter + 1924 8012 SFN8522-R1 8000 Series 10G Adapter + 1924 8013 SFN8042-R1 8000 Series 10/40G Adapter + 1924 8014 SFN8542-R1 8000 Series 10/40G Adapter + 1924 8016 SFN8022-R2 8000 Series 10G Adapte + 1924 8017 SFN8522-R2 8000 Series 10G Adapter + 1924 8018 SFN8042-R2 8000 Series 10/40G Adapter + 1924 8019 SFN8542-R2 8000 Series 10/40G Adapter + 1924 801a SFN8722-R1 8000 Series OCP 10G Adapter 1803 SFC9020 10G Ethernet Controller (Virtual Function) 1813 SFL9021 10GBASE-T Ethernet Controller (Virtual Function) 1903 SFC9120 10G Ethernet Controller (Virtual Function) @@ -20008,20 +20080,29 @@ 0212 BladeEngine2 10Gb Gen2 PCIe iSCSI Adapter 0221 BladeEngine3 10Gb Gen2 PCIe Network Adapter 0222 BladeEngine3 10Gb Gen2 PCIe iSCSI Adapter - 0700 OneConnect 10Gb NIC + 0700 OneConnect OCe10100/OCe10102 Series 10 GbE 103c 1747 NC550SFP DualPort 10GbE Server Adapter 103c 1749 NC550SFP Dual Port Server Adapter 103c 174a NC551m Dual Port FlexFabric 10Gb Adapter 103c 174b StorageWorks NC550 DualPort Converged Network Adapter 103c 3314 NC551i Dual Port FlexFabric 10Gb Adapter 0702 OneConnect 10Gb iSCSI Initiator - 0704 OneConnect 10Gb FCoE Initiator + 0704 OneConnect OCe10100/OCe10102 Series 10 GbE CNA + 10df e602 OneConnect OCe10100 10Gb CNA + 10df e630 OneConnect OCe10102-FM-E / OCe10102-FX-E for EMC VNX Symmetrix 0710 OneConnect 10Gb NIC (be3) +# FC 5287 / FC 5284; CCIN 5287 + 1014 03d0 PCIe2 2-port 10GbE SR Adapter for POWER +# FC 5288 / FC 5286; CCIN 5288 + 1014 03d1 PCIe2 2-port 10GbE SFP+ Copper Adapter for POWER + 1014 0409 Integrated Multifunction Card with Dual 10GbE SR Optical + Dual 1GbE for Power 750/760 + 1014 040a Integrated Multifunction Card with Dual 10GbE SR Copper + Dual 1GbE for Power 750/760 103c 3315 NC553i 10Gb 2-port FlexFabric Converged Network Adapter 103c 3340 NC552SFP 2-port 10Gb Server Adapter 103c 3341 NC552m 10Gb 2-port FlexFabric Converged Network Adapter 103c 3345 NC553m 10Gb 2-port FlexFabric Converged Network Adapter 103c 337b NC554FLB 10Gb 2-port FlexFabric Converged Network Adapter + 10df e733 Flex System EN4054 4-port 10Gb Ethernet Mezzanine Adapter 0712 OneConnect 10Gb iSCSI Initiator (be3) 0714 OneConnect 10Gb FCoE Initiator (be3) 103c 3315 NC553i 10Gb 2-port FlexFabric Converged Network Adapter @@ -20297,6 +20378,7 @@ 001e ADQ208 001f DSU 0020 ADQ14 + 0023 ADQ7 2014 TX320 2019 S6000 # now owned by HGST (a Western Digital subsidiary) @@ -20505,6 +20587,7 @@ 0004 ExaNIC X10-GM 0005 ExaNIC X40 0006 ExaNIC X10-HPT + 0007 ExaNIC X40 1cf7 Subspace Dynamics 1d00 Pure Storage 1d18 RME @@ -20549,10 +20632,11 @@ 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d78 DERA 1d7c Aerotech, Inc. -1d87 Rockchip Inc. RK3399 PCI Express Root Port +1d87 Fuzhou Rockchip Electronics Co., Ltd 1d8f Enyx 1d95 Graphcore Ltd 1da1 Teko Telecom S.r.l. +1da2 Sapphire Technology Limited 1de1 Tekram Technology Co.,Ltd. 0391 TRM-S1040 [DC-315 / DC-395 series] 2020 DC-390 @@ -20605,6 +20689,7 @@ 1fc9 3015 Ethernet Adapter 4026 TN9610 10GbE SFP+ Ethernet Adapter 4027 TN9710P 10GBase-T/NBASE-T Ethernet Adapter + 1154 0368 LGY-PCIE-MG 1432 8104 10 Gigabit Ethernet PCI Express Adapter 1fc9 3015 Ethernet Adapter 4527 TN9710Q 5GBase-T/NBASE-T Ethernet Adapter @@ -22513,6 +22598,7 @@ 10ba 80003ES2LAN Gigabit Ethernet Controller (Copper) 10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes) 10bc 82571EB Gigabit Ethernet Controller (Copper) + 1014 0368 4-Port 10/100/1000 Base-TX PCI Express Adapter for POWER 103c 704b NC364T PCI Express Quad Port Gigabit Server Adapter 108e 11bc x4 PCI-Express Quad Gigabit Ethernet UTP Low Profile Adapter 8086 10bc PRO/1000 PT Quad Port LP Server Adapter @@ -23016,6 +23102,7 @@ 1529 82599 10 Gigabit Dual Port Network Connection with FCoE 152a 82599 10 Gigabit Dual Port Backplane Connection with FCoE 152e 82599 Virtual Function + 152f I350 Virtual Function 1530 X540 Virtual Function 1533 I210 Gigabit Network Connection 103c 0003 Ethernet I210-T1 GbE NIC @@ -23074,6 +23161,8 @@ 18d4 0c08 X550 10Gb 2-port RJ45 OCP Mezz Card MOP81-I-10GT2 8086 0001 Ethernet Converged Network Adapter X550-T2 8086 001a Ethernet Converged Network Adapter X550-T2 + 8086 001b Ethernet Server Adapter X550-T2 for OCP + 8086 001d Ethernet 10G 2P X550-t Adapter 8086 0022 Ethernet Converged Network Adapter X550-T2 1564 X550 Virtual Function 1565 X550 Virtual Function @@ -23216,22 +23305,38 @@ 15be Ethernet Connection (6) I219-V 15bf JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] 15c0 JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] + 15c2 Ethernet Connection X553 Backplane + 15c3 Ethernet Connection X553 Backplane + 15c4 Ethernet Connection X553 10 GbE SFP+ 15c5 X553 Virtual Function + 15c6 Ethernet Connection X553 1GbE + 15c7 Ethernet Connection X553 1GbE + 15c8 Ethernet Connection X553/X557-AT 10GBASE-T + 15ce Ethernet Connection X553 10 GbE SFP+ 15d0 Ethernet SDI Adapter FM10420-100GbE-QDA2 15d1 Ethernet Controller 10G X550T 8086 0002 Ethernet Converged Network Adapter X550-T1 + 8086 001b Ethernet Server Adapter X550-T1 for OCP 8086 0021 Ethernet Converged Network Adapter X550-T1 8086 00a2 Ethernet Converged Network Adapter X550-T1 15d2 JHL6540 Thunderbolt 3 NHI (C step) [Alpine Ridge 4C 2016] 15d3 JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] + 15d4 JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] 15d5 Ethernet SDI Adapter FM10420-25GbE-DA2 8086 0001 Intel(R) Ethernet SDI Adapter FM10420-25GbE-DA2 15d6 Ethernet Connection (5) I219-V 15d7 Ethernet Connection (4) I219-LM 15d8 Ethernet Connection (4) I219-V + 17aa 224f ThinkPad X1 Carbon 5th Gen 15d9 JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016] 15da JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] + 15df Ethernet Connection (8) I219-LM + 15e0 Ethernet Connection (8) I219-V + 15e1 Ethernet Connection (9) I219-LM + 15e2 Ethernet Connection (9) I219-V 15e3 Ethernet Connection (5) I219-LM + 15e4 Ethernet Connection X553 1GbE + 15e5 Ethernet Connection X553 1GbE 1600 Broadwell-U Host Bridge -OPI 1601 Broadwell-U PCI Express x16 Controller 1602 Broadwell-U Integrated Graphics @@ -23271,31 +23376,32 @@ 163d Broadwell-U Integrated Graphics 163e Broadwell-U Integrated Graphics 1889 Ethernet Adaptive Virtual Function - 1900 Skylake Host Bridge/DRAM Registers - 1901 Skylake PCIe Controller (x16) + 1900 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1901 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) 1902 HD Graphics 510 - 1903 Skylake Processor Thermal Subsystem - 1904 Skylake Host Bridge/DRAM Registers + 1903 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem + 1904 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1028 06f3 Latitude 3570 17aa 382a B51-80 Laptop - 1905 Skylake PCIe Controller (x8) + 1905 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x8) 1906 HD Graphics 510 17aa 382a B51-80 Laptop - 1908 Skylake Host Bridge/DRAM Registers - 1909 Skylake PCIe Controller (x4) - 190c Skylake Host Bridge/DRAM Registers - 190f Skylake Host Bridge/DRAM Registers - 1910 Skylake Host Bridge/DRAM Registers - 1911 Skylake Gaussian Mixture Model + 1908 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1909 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x4) + 190c Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 190f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1910 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1911 Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model + 17aa 224f ThinkPad X1 Carbon 5th Gen 1912 HD Graphics 530 1916 HD Graphics 520 1028 06f3 Latitude 3570 - 1918 Skylake Host Bridge/DRAM Registers - 1919 Skylake Imaging Unit + 1918 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1919 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit 191b HD Graphics 530 191d HD Graphics P530 191e HD Graphics 515 - 191f Skylake Host Bridge/DRAM Registers + 191f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1921 HD Graphics 520 1926 Iris Graphics 540 1927 Iris Graphics 550 @@ -24531,6 +24637,7 @@ 24fd Wireless 8265 / 8275 # Windstorm Peak 8086 0010 Dual Band Wireless-AC 8265 + 8086 1130 Dual Band Wireless-AC 8265 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -26676,6 +26783,7 @@ 17aa 4021 Intel Ethernet Connection X722 for 10G SFP+ 17aa 4022 Ethernet Connection X722 for 10GbE SFP+ 37d1 Ethernet Connection X722 for 1GbE + 14cd 0010 88E1514 Ethernet OCP 2x1G RJ45 Phy Card [USI-1514-1GbaseT] 1590 0216 Ethernet 1Gb 2-port 368i Adapter 1590 0217 Ethernet 1Gb 2-port 368FLR-MMT Adapter 1590 0247 Ethernet 1Gb 4-port 369i Adapter @@ -27229,9 +27337,13 @@ 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5902 HD Graphics 610 + 5904 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers + 17aa 224f ThinkPad X1 Carbon 5th Gen 590f Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5910 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5912 HD Graphics 630 + 5916 HD Graphics 620 + 17aa 224f ThinkPad X1 Carbon 5th Gen 5a84 Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller 5a88 Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit 5a98 Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster @@ -27908,6 +28020,8 @@ 9d03 Sunrise Point-LP SATA Controller [AHCI mode] 1028 06f3 Latitude 3570 17aa 382a B51-80 Laptop + 9d10 Sunrise Point-LP PCI Express Root Port #1 + 9d12 Sunrise Point-LP PCI Express Root Port #3 9d14 Sunrise Point-LP PCI Express Root Port #5 17aa 382a B51-80 Laptop 9d15 Sunrise Point-LP PCI Express Root Port #6 @@ -27918,9 +28032,11 @@ 17aa 382a B51-80 Laptop 9d21 Sunrise Point-LP PMC 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d23 Sunrise Point-LP SMBus 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d27 Sunrise Point-LP Serial IO UART Controller #0 9d28 Sunrise Point-LP Serial IO UART Controller #1 @@ -27932,14 +28048,18 @@ 17aa 382a B51-80 Laptop 9d31 Sunrise Point-LP Thermal subsystem 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d3a Sunrise Point-LP CSME HECI #1 1028 06f3 Latitude 3570 + 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 382a B51-80 Laptop 9d43 Sunrise Point-LP LPC Controller 17aa 382a B51-80 Laptop 9d48 Sunrise Point-LP LPC Controller 1028 06f3 Latitude 3570 + 9d58 Sunrise Point-LP LPC Controller + 17aa 224f ThinkPad X1 Carbon 5th Gen 9d60 Sunrise Point-LP Serial IO I2C Controller #0 1028 06f3 Latitude 3570 8086 9d60 100 Series PCH/Sunrise Point PCH I2C0 [Skylake/Kaby Lake LPSS I2C] @@ -28520,6 +28640,20 @@ 9005 0552 Series 8 - ASR-8805 - 8 internal 0 external 12G SAS Port/PCIe 3.0 9005 0553 Series 8 - ASR-8085 - 0 internal 8 external 12G SAS Port/PCIe 3.0 9005 0554 Series 8 - ASR-8885 - 8 internal 8 external 12G SAS Port/PCIe 3.0 + 028f Smart Storage PQI 12G SAS/PCIe 3 + 103c 0600 Smart Array P408i-p SR Gen10 + 103c 0601 Smart Array P408e-p SR Gen10 + 103c 0602 Smart Array P408i-a SR Gen10 + 103c 0603 Smart Array P408i-c SR Gen10 + 103c 0650 Smart Array E208i-p SR Gen10 + 103c 0651 Smart Array E208e-p SR Gen10 + 103c 0652 Smart Array E208i-c SR Gen10 + 103c 0654 Smart Array E208i-a SR Gen10 + 103c 0655 Smart Array P408e-m SR Gen10 + 103c 0700 Smart Array P204i-c SR Gen10 + 103c 0701 Smart Array P204i-b SR Gen10 + 103c 1100 Smart Array P816i-a SR Gen10 + 103c 1101 Smart Array P416ie-m SR G10 0410 AIC-9410W SAS (Razor HBA RAID) 9005 0410 ASC-48300(Spirit RAID) 9005 0411 ASC-58300 (Oakmont RAID) From owner-svn-src-stable-10@freebsd.org Mon Jul 17 14:09:40 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2915DD88015; Mon, 17 Jul 2017 14:09:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97812A68; Mon, 17 Jul 2017 14:09:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HE9c7e078401; Mon, 17 Jul 2017 14:09:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HE9ZKR078359; Mon, 17 Jul 2017 14:09:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707171409.v6HE9ZKR078359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Jul 2017 14:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321074 - in stable/10/lib/libc: include stdio X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10/lib/libc: include stdio X-SVN-Commit-Revision: 321074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 14:09:40 -0000 Author: kib Date: Mon Jul 17 14:09:34 2017 New Revision: 321074 URL: https://svnweb.freebsd.org/changeset/base/321074 Log: MFC r320472,r320508,r320509: Make stdio deferred cancel-safe. Requested by: eugen Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/stdio/fclose.c stable/10/lib/libc/stdio/fflush.c stable/10/lib/libc/stdio/fgetc.c stable/10/lib/libc/stdio/fgetln.c stable/10/lib/libc/stdio/fgets.c stable/10/lib/libc/stdio/fgetwc.c stable/10/lib/libc/stdio/fgetwln.c stable/10/lib/libc/stdio/fgetws.c stable/10/lib/libc/stdio/fputc.c stable/10/lib/libc/stdio/fputs.c stable/10/lib/libc/stdio/fputwc.c stable/10/lib/libc/stdio/fputws.c stable/10/lib/libc/stdio/fread.c stable/10/lib/libc/stdio/freopen.c stable/10/lib/libc/stdio/fscanf.c stable/10/lib/libc/stdio/fseek.c stable/10/lib/libc/stdio/fwrite.c stable/10/lib/libc/stdio/getc.c stable/10/lib/libc/stdio/getchar.c stable/10/lib/libc/stdio/getdelim.c stable/10/lib/libc/stdio/gets.c stable/10/lib/libc/stdio/local.h stable/10/lib/libc/stdio/perror.c stable/10/lib/libc/stdio/putc.c stable/10/lib/libc/stdio/putchar.c stable/10/lib/libc/stdio/puts.c stable/10/lib/libc/stdio/putw.c stable/10/lib/libc/stdio/refill.c stable/10/lib/libc/stdio/scanf.c stable/10/lib/libc/stdio/setvbuf.c stable/10/lib/libc/stdio/stdio.c stable/10/lib/libc/stdio/ungetc.c stable/10/lib/libc/stdio/ungetwc.c stable/10/lib/libc/stdio/vfprintf.c stable/10/lib/libc/stdio/vfscanf.c stable/10/lib/libc/stdio/vfwprintf.c stable/10/lib/libc/stdio/vfwscanf.c stable/10/lib/libc/stdio/vscanf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/include/libc_private.h Mon Jul 17 14:09:34 2017 (r321074) @@ -405,4 +405,9 @@ void __libc_map_stacks_exec(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); +struct _pthread_cleanup_info; +void ___pthread_cleanup_push_imp(void (*)(void *), void *, + struct _pthread_cleanup_info *); +void ___pthread_cleanup_pop_imp(int); + #endif /* _LIBC_PRIVATE_H_ */ Modified: stable/10/lib/libc/stdio/fclose.c ============================================================================== --- stable/10/lib/libc/stdio/fclose.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fclose.c Mon Jul 17 14:09:34 2017 (r321074) @@ -97,7 +97,7 @@ fdclose(FILE *fp, int *fdp) return (EOF); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); r = 0; if (fp->_close != __sclose) { r = EOF; @@ -115,7 +115,7 @@ fdclose(FILE *fp, int *fdp) *fdp = fp->_file; r = cleanfile(fp, false); } - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } @@ -130,9 +130,9 @@ fclose(FILE *fp) return (EOF); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); r = cleanfile(fp, true); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/10/lib/libc/stdio/fflush.c ============================================================================== --- stable/10/lib/libc/stdio/fflush.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fflush.c Mon Jul 17 14:09:34 2017 (r321074) @@ -56,7 +56,7 @@ fflush(FILE *fp) if (fp == NULL) return (_fwalk(sflush_locked)); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* * There is disagreement about the correct behaviour of fflush() @@ -76,7 +76,7 @@ fflush(FILE *fp) retval = 0; else retval = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } @@ -143,8 +143,8 @@ sflush_locked(FILE *fp) { int ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/fgetc.c ============================================================================== --- stable/10/lib/libc/stdio/fgetc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -46,10 +46,10 @@ int fgetc(FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(fp, -1); */ retval = __sgetc(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/fgetln.c ============================================================================== --- stable/10/lib/libc/stdio/fgetln.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetln.c Mon Jul 17 14:09:34 2017 (r321074) @@ -85,22 +85,21 @@ char * fgetln(FILE *fp, size_t *lenp) { unsigned char *p; + char *ret; size_t len; size_t off; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* make sure there is input */ if (fp->_r <= 0 && __srefill(fp)) { *lenp = 0; - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } /* look for a newline in the input */ if ((p = memchr((void *)fp->_p, '\n', (size_t)fp->_r)) != NULL) { - char *ret; - /* * Found one. Flag buffer as modified to keep fseek from * `optimising' a backward seek, in case the user stomps on @@ -112,8 +111,7 @@ fgetln(FILE *fp, size_t *lenp) fp->_flags |= __SMOD; fp->_r -= len; fp->_p = p; - FUNLOCKFILE(fp); - return (ret); + goto end; } /* @@ -163,12 +161,14 @@ fgetln(FILE *fp, size_t *lenp) #ifdef notdef fp->_lb._base[len] = '\0'; #endif - FUNLOCKFILE(fp); - return ((char *)fp->_lb._base); + ret = (char *)fp->_lb._base; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: *lenp = 0; /* ??? */ fp->_flags |= __SERR; - FUNLOCKFILE(fp); - return (NULL); /* ??? */ + ret = NULL; + goto end; } Modified: stable/10/lib/libc/stdio/fgets.c ============================================================================== --- stable/10/lib/libc/stdio/fgets.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgets.c Mon Jul 17 14:09:34 2017 (r321074) @@ -53,17 +53,17 @@ char * fgets(char * __restrict buf, int n, FILE * __restrict fp) { size_t len; - char *s; + char *s, *ret; unsigned char *p, *t; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); if (n <= 0) { /* sanity check */ fp->_flags |= __SERR; errno = EINVAL; - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } s = buf; @@ -76,8 +76,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict if (__srefill(fp)) { /* EOF/error: stop with partial or no line */ if (!__sfeof(fp) || s == buf) { - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } break; } @@ -100,8 +100,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict fp->_p = t; (void)memcpy((void *)s, (void *)p, len); s[len] = 0; - FUNLOCKFILE(fp); - return (buf); + ret = buf; + goto end; } fp->_r -= len; fp->_p += len; @@ -110,6 +110,8 @@ fgets(char * __restrict buf, int n, FILE * __restrict n -= len; } *s = 0; - FUNLOCKFILE(fp); - return (buf); + ret = buf; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } Modified: stable/10/lib/libc/stdio/fgetwc.c ============================================================================== --- stable/10/lib/libc/stdio/fgetwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -52,10 +52,10 @@ fgetwc_l(FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __fgetwc(fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/10/lib/libc/stdio/fgetwln.c ============================================================================== --- stable/10/lib/libc/stdio/fgetwln.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetwln.c Mon Jul 17 14:09:34 2017 (r321074) @@ -45,13 +45,14 @@ wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale wchar_t * fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t locale) { + wchar_t *ret; wint_t wc; size_t len; int savserr; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); savserr = fp->_flags & __SERR; @@ -77,14 +78,16 @@ fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t if (len == 0) goto error; - FUNLOCKFILE(fp); *lenp = len; - return ((wchar_t *)fp->_lb._base); + ret = (wchar_t *)fp->_lb._base; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: - FUNLOCKFILE(fp); *lenp = 0; - return (NULL); + ret = NULL; + goto end; } wchar_t * Modified: stable/10/lib/libc/stdio/fgetws.c ============================================================================== --- stable/10/lib/libc/stdio/fgetws.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fgetws.c Mon Jul 17 14:09:34 2017 (r321074) @@ -46,14 +46,14 @@ wchar_t * fgetws_l(wchar_t * __restrict ws, int n, FILE * __restrict fp, locale_t locale) { int sret; - wchar_t *wsp; + wchar_t *wsp, *ret; size_t nconv; const char *src; unsigned char *nl; FIX_LOCALE(locale); struct xlocale_ctype *l = XLOCALE_CTYPE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); if (n <= 0) { @@ -113,12 +113,14 @@ fgetws_l(wchar_t * __restrict ws, int n, FILE * __rest goto error; ok: *wsp = L'\0'; - FUNLOCKFILE(fp); - return (ws); + ret = ws; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); error: - FUNLOCKFILE(fp); - return (NULL); + ret = NULL; + goto end; } wchar_t * Modified: stable/10/lib/libc/stdio/fputc.c ============================================================================== --- stable/10/lib/libc/stdio/fputc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -46,10 +46,10 @@ int fputc(int c, FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(fp, -1); */ retval = __sputc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/fputs.c ============================================================================== --- stable/10/lib/libc/stdio/fputs.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputs.c Mon Jul 17 14:09:34 2017 (r321074) @@ -58,9 +58,9 @@ fputs(const char * __restrict s, FILE * __restrict fp) uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/fputwc.c ============================================================================== --- stable/10/lib/libc/stdio/fputwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -74,10 +74,10 @@ fputwc_l(wchar_t wc, FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __fputwc(wc, fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/10/lib/libc/stdio/fputws.c ============================================================================== --- stable/10/lib/libc/stdio/fputws.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fputws.c Mon Jul 17 14:09:34 2017 (r321074) @@ -53,11 +53,13 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restr const wchar_t *wsp; FIX_LOCALE(locale); struct xlocale_ctype *l = XLOCALE_CTYPE(locale); + int ret; - FLOCKFILE(fp); + ret = -1; + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); if (prepwrite(fp) != 0) - goto error; + goto end; uio.uio_iov = &iov; uio.uio_iovcnt = 1; iov.iov_base = buf; @@ -66,17 +68,15 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restr nbytes = l->__wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1) - goto error; + goto end; uio.uio_resid = iov.iov_len = nbytes; if (__sfvwrite(fp, &uio) != 0) - goto error; + goto end; } while (wsp != NULL); - FUNLOCKFILE(fp); - return (0); - -error: - FUNLOCKFILE(fp); - return (-1); + ret = 0; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } int Modified: stable/10/lib/libc/stdio/fread.c ============================================================================== --- stable/10/lib/libc/stdio/fread.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fread.c Mon Jul 17 14:09:34 2017 (r321074) @@ -54,9 +54,9 @@ fread(void * __restrict buf, size_t size, size_t count { size_t ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __fread(buf, size, count, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/freopen.c ============================================================================== --- stable/10/lib/libc/stdio/freopen.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/freopen.c Mon Jul 17 14:09:34 2017 (r321074) @@ -68,7 +68,7 @@ freopen(const char * __restrict file, const char * __r return (NULL); } - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); if (!__sdidinit) __sinit(); @@ -81,24 +81,24 @@ freopen(const char * __restrict file, const char * __r if (file == NULL) { /* See comment below regarding freopen() of closed files. */ if (fp->_flags == 0) { - FUNLOCKFILE(fp); errno = EINVAL; - return (NULL); + fp = NULL; + goto end; } if ((dflags = _fcntl(fp->_file, F_GETFL)) < 0) { sverrno = errno; fclose(fp); - FUNLOCKFILE(fp); errno = sverrno; - return (NULL); + fp = NULL; + goto end; } /* Work around incorrect O_ACCMODE. */ if ((dflags & O_ACCMODE) != O_RDWR && (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); - FUNLOCKFILE(fp); errno = EBADF; - return (NULL); + fp = NULL; + goto end; } if (fp->_flags & __SWR) (void) __sflush(fp); @@ -108,9 +108,9 @@ freopen(const char * __restrict file, const char * __r if (_fcntl(fp->_file, F_SETFL, dflags) < 0) { sverrno = errno; fclose(fp); - FUNLOCKFILE(fp); errno = sverrno; - return (NULL); + fp = NULL; + goto end; } } if (oflags & O_TRUNC) @@ -193,9 +193,9 @@ finish: if (isopen) (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ - FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ - return (NULL); + fp = NULL; + goto end; } /* @@ -221,9 +221,9 @@ finish: */ if (f > SHRT_MAX) { fp->_flags = 0; /* set it free */ - FUNLOCKFILE(fp); errno = EMFILE; - return (NULL); + fp = NULL; + goto end; } fp->_flags = flags; @@ -245,6 +245,7 @@ finish: fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); } - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (fp); } Modified: stable/10/lib/libc/stdio/fscanf.c ============================================================================== --- stable/10/lib/libc/stdio/fscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -56,10 +56,10 @@ fscanf(FILE * __restrict fp, char const * __restrict f va_list ap; va_start(ap, fmt); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, __get_locale(), fmt, ap); va_end(ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int @@ -70,9 +70,9 @@ fscanf_l(FILE * __restrict fp, locale_t locale, char c FIX_LOCALE(locale); va_start(ap, fmt); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, locale, fmt, ap); va_end(ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/fseek.c ============================================================================== --- stable/10/lib/libc/stdio/fseek.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fseek.c Mon Jul 17 14:09:34 2017 (r321074) @@ -60,9 +60,9 @@ fseek(FILE *fp, long offset, int whence) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = _fseeko(fp, (off_t)offset, whence, 1); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); if (ret == 0) errno = serrno; return (ret); @@ -78,9 +78,9 @@ fseeko(FILE *fp, off_t offset, int whence) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = _fseeko(fp, offset, whence, 0); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); if (ret == 0) errno = serrno; return (ret); Modified: stable/10/lib/libc/stdio/fwrite.c ============================================================================== --- stable/10/lib/libc/stdio/fwrite.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/fwrite.c Mon Jul 17 14:09:34 2017 (r321074) @@ -82,7 +82,7 @@ fwrite(const void * __restrict buf, size_t size, size_ uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); /* * The usual case is success (__sfvwrite returns 0); @@ -91,6 +91,6 @@ fwrite(const void * __restrict buf, size_t size, size_ */ if (__sfvwrite(fp, &uio) != 0) count = (n - uio.uio_resid) / size; - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (count); } Modified: stable/10/lib/libc/stdio/getc.c ============================================================================== --- stable/10/lib/libc/stdio/getc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -49,11 +49,11 @@ int getc(FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(fp, -1); */ retval = __sgetc(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/getchar.c ============================================================================== --- stable/10/lib/libc/stdio/getchar.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getchar.c Mon Jul 17 14:09:34 2017 (r321074) @@ -52,11 +52,11 @@ int getchar(void) { int retval; - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); /* Orientation set by __sgetc() when buffer is empty. */ /* ORIENT(stdin, -1); */ retval = __sgetc(stdin); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/getdelim.c ============================================================================== --- stable/10/lib/libc/stdio/getdelim.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/getdelim.c Mon Jul 17 14:09:34 2017 (r321074) @@ -112,7 +112,7 @@ getdelim(char ** __restrict linep, size_t * __restrict u_char *endp; size_t linelen; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); if (linep == NULL || linecapp == NULL) { @@ -127,9 +127,9 @@ getdelim(char ** __restrict linep, size_t * __restrict /* If fp is at EOF already, we just need space for the NUL. */ if (!__sfeof(fp) || expandtofit(linep, 1, linecapp)) goto error; - FUNLOCKFILE(fp); (*linep)[0] = '\0'; - return (-1); + linelen = -1; + goto end; } linelen = 0; @@ -150,11 +150,12 @@ getdelim(char ** __restrict linep, size_t * __restrict done: /* Invariant: *linep has space for at least linelen+1 bytes. */ (*linep)[linelen] = '\0'; - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (linelen); error: fp->_flags |= __SERR; - FUNLOCKFILE(fp); - return (-1); + linelen = -1; + goto end; } Modified: stable/10/lib/libc/stdio/gets.c ============================================================================== --- stable/10/lib/libc/stdio/gets.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/gets.c Mon Jul 17 14:09:34 2017 (r321074) @@ -50,27 +50,30 @@ char * gets(char *buf) { int c; - char *s; + char *s, *ret; static int warned; static const char w[] = "warning: this program uses gets(), which is unsafe.\n"; - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ORIENT(stdin, -1); if (!warned) { (void) _write(STDERR_FILENO, w, sizeof(w) - 1); warned = 1; } - for (s = buf; (c = __sgetc(stdin)) != '\n';) + for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { if (c == EOF) if (s == buf) { - FUNLOCKFILE(stdin); - return (NULL); + ret = NULL; + goto end; } else break; else *s++ = c; + } *s = 0; - FUNLOCKFILE(stdin); - return (buf); + ret = buf; +end: + FUNLOCKFILE_CANCELSAFE(); + return (ret); } Modified: stable/10/lib/libc/stdio/local.h ============================================================================== --- stable/10/lib/libc/stdio/local.h Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/local.h Mon Jul 17 14:09:34 2017 (r321074) @@ -38,6 +38,9 @@ * $FreeBSD$ */ +#ifndef _STDIO_LOCAL_H +#define _STDIO_LOCAL_H + #include /* for off_t */ #include #include @@ -138,3 +141,26 @@ __fgetwc(FILE *fp, locale_t locale) if ((fp)->_orientation == 0) \ (fp)->_orientation = (o); \ } while (0) + +void __stdio_cancel_cleanup(void *); +#define FLOCKFILE_CANCELSAFE(fp) \ + { \ + struct _pthread_cleanup_info __cleanup_info__; \ + if (__isthreaded) { \ + _FLOCKFILE(fp); \ + ___pthread_cleanup_push_imp( \ + __stdio_cancel_cleanup, (fp), \ + &__cleanup_info__); \ + } else { \ + ___pthread_cleanup_push_imp( \ + __stdio_cancel_cleanup, NULL, \ + &__cleanup_info__); \ + } \ + { +#define FUNLOCKFILE_CANCELSAFE() \ + (void)0; \ + } \ + ___pthread_cleanup_pop_imp(1); \ + } + +#endif /* _STDIO_LOCAL_H */ Modified: stable/10/lib/libc/stdio/perror.c ============================================================================== --- stable/10/lib/libc/stdio/perror.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/perror.c Mon Jul 17 14:09:34 2017 (r321074) @@ -67,9 +67,9 @@ perror(const char *s) v++; v->iov_base = "\n"; v->iov_len = 1; - FLOCKFILE(stderr); + FLOCKFILE_CANCELSAFE(stderr); __sflush(stderr); (void)_writev(stderr->_file, iov, (v - iov) + 1); stderr->_flags &= ~__SOFF; - FUNLOCKFILE(stderr); + FUNLOCKFILE_CANCELSAFE(); } Modified: stable/10/lib/libc/stdio/putc.c ============================================================================== --- stable/10/lib/libc/stdio/putc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -49,11 +49,11 @@ int putc(int c, FILE *fp) { int retval; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(fp, -1); */ retval = __sputc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/putchar.c ============================================================================== --- stable/10/lib/libc/stdio/putchar.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putchar.c Mon Jul 17 14:09:34 2017 (r321074) @@ -54,11 +54,11 @@ putchar(int c) int retval; FILE *so = stdout; - FLOCKFILE(so); + FLOCKFILE_CANCELSAFE(so); /* Orientation set by __sputc() when buffer is full. */ /* ORIENT(so, -1); */ retval = __sputc(c, so); - FUNLOCKFILE(so); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/puts.c ============================================================================== --- stable/10/lib/libc/stdio/puts.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/puts.c Mon Jul 17 14:09:34 2017 (r321074) @@ -62,9 +62,9 @@ puts(char const *s) uio.uio_resid = c + 1; uio.uio_iov = &iov[0]; uio.uio_iovcnt = 2; - FLOCKFILE(stdout); + FLOCKFILE_CANCELSAFE(stdout); ORIENT(stdout, -1); retval = __sfvwrite(stdout, &uio) ? EOF : '\n'; - FUNLOCKFILE(stdout); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/putw.c ============================================================================== --- stable/10/lib/libc/stdio/putw.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/putw.c Mon Jul 17 14:09:34 2017 (r321074) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "fvwrite.h" #include "libc_private.h" +#include "local.h" int putw(int w, FILE *fp) @@ -53,8 +54,8 @@ putw(int w, FILE *fp) uio.uio_resid = iov.iov_len = sizeof(w); uio.uio_iov = &iov; uio.uio_iovcnt = 1; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); retval = __sfvwrite(fp, &uio); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (retval); } Modified: stable/10/lib/libc/stdio/refill.c ============================================================================== --- stable/10/lib/libc/stdio/refill.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/refill.c Mon Jul 17 14:09:34 2017 (r321074) @@ -53,9 +53,9 @@ lflush(FILE *fp) int ret = 0; if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) { - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __sflush(fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); } return (ret); } Modified: stable/10/lib/libc/stdio/scanf.c ============================================================================== --- stable/10/lib/libc/stdio/scanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/scanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -56,9 +56,9 @@ scanf(char const * __restrict fmt, ...) va_list ap; va_start(ap, fmt); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ret = __svfscanf(stdin, __get_locale(), fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); va_end(ap); return (ret); } @@ -70,9 +70,9 @@ scanf_l(locale_t locale, char const * __restrict fmt, FIX_LOCALE(locale); va_start(ap, fmt); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); ret = __svfscanf(stdin, locale, fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); va_end(ap); return (ret); } Modified: stable/10/lib/libc/stdio/setvbuf.c ============================================================================== --- stable/10/lib/libc/stdio/setvbuf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/setvbuf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -63,7 +63,7 @@ setvbuf(FILE * __restrict fp, char * __restrict buf, i if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0) return (EOF); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* * Write current buffer, if any. Discard unread input (including * ungetc data), cancel line buffering, and free old buffer if @@ -115,8 +115,7 @@ nbf: fp->_w = 0; fp->_bf._base = fp->_p = fp->_nbuf; fp->_bf._size = 1; - FUNLOCKFILE(fp); - return (ret); + goto end; } flags |= __SMBF; } @@ -156,6 +155,7 @@ nbf: } __cleanup = _cleanup; - FUNLOCKFILE(fp); +end: + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/stdio.c ============================================================================== --- stable/10/lib/libc/stdio/stdio.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/stdio.c Mon Jul 17 14:09:34 2017 (r321074) @@ -166,3 +166,11 @@ _sseek(FILE *fp, fpos_t offset, int whence) } return (ret); } + +void +__stdio_cancel_cleanup(void * arg) +{ + + if (arg != NULL) + _funlockfile((FILE *)arg); +} Modified: stable/10/lib/libc/stdio/ungetc.c ============================================================================== --- stable/10/lib/libc/stdio/ungetc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/ungetc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -94,10 +94,10 @@ ungetc(int c, FILE *fp) if (!__sdidinit) __sinit(); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, -1); ret = __ungetc(c, fp); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/ungetwc.c ============================================================================== --- stable/10/lib/libc/stdio/ungetwc.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/ungetwc.c Mon Jul 17 14:09:34 2017 (r321074) @@ -76,10 +76,10 @@ ungetwc_l(wint_t wc, FILE *fp, locale_t locale) wint_t r; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); r = __ungetwc(wc, fp, locale); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (r); } Modified: stable/10/lib/libc/stdio/vfprintf.c ============================================================================== --- stable/10/lib/libc/stdio/vfprintf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfprintf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -274,14 +274,14 @@ vfprintf_l(FILE * __restrict fp, locale_t locale, cons int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) ret = __sbprintf(fp, locale, fmt0, ap); else ret = __vfprintf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/10/lib/libc/stdio/vfscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vfscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -443,9 +443,9 @@ __vfscanf(FILE *fp, char const *fmt0, va_list ap) { int ret; - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, __get_locale(), fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int @@ -454,9 +454,9 @@ vfscanf_l(FILE *fp, locale_t locale, char const *fmt0, int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ret = __svfscanf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } Modified: stable/10/lib/libc/stdio/vfwprintf.c ============================================================================== --- stable/10/lib/libc/stdio/vfwprintf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfwprintf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -356,14 +356,14 @@ vfwprintf_l(FILE * __restrict fp, locale_t locale, { int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) ret = __sbprintf(fp, locale, fmt0, ap); else ret = __vfwprintf(fp, locale, fmt0, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/10/lib/libc/stdio/vfwscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vfwscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vfwscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -428,10 +428,10 @@ vfwscanf_l(FILE * __restrict fp, locale_t locale, int ret; FIX_LOCALE(locale); - FLOCKFILE(fp); + FLOCKFILE_CANCELSAFE(fp); ORIENT(fp, 1); ret = __vfwscanf(fp, locale, fmt, ap); - FUNLOCKFILE(fp); + FUNLOCKFILE_CANCELSAFE(); return (ret); } int Modified: stable/10/lib/libc/stdio/vscanf.c ============================================================================== --- stable/10/lib/libc/stdio/vscanf.c Mon Jul 17 09:26:42 2017 (r321073) +++ stable/10/lib/libc/stdio/vscanf.c Mon Jul 17 14:09:34 2017 (r321074) @@ -54,9 +54,9 @@ vscanf_l(locale_t locale, const char * __restrict fmt, int retval; FIX_LOCALE(locale); - FLOCKFILE(stdin); + FLOCKFILE_CANCELSAFE(stdin); retval = __svfscanf(stdin, locale, fmt, ap); - FUNLOCKFILE(stdin); + FUNLOCKFILE_CANCELSAFE(); return (retval); } int From owner-svn-src-stable-10@freebsd.org Mon Jul 17 20:57:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64F6DA07E1; Mon, 17 Jul 2017 20:57:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9220A71198; Mon, 17 Jul 2017 20:57:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HKvcsi049791; Mon, 17 Jul 2017 20:57:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HKvcBh049789; Mon, 17 Jul 2017 20:57:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172057.v6HKvcBh049789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 20:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321084 - in stable/10: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/procstat usr.bin/procstat/tests X-SVN-Commit-Revision: 321084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 20:57:39 -0000 Author: ngie Date: Mon Jul 17 20:57:38 2017 New Revision: 321084 URL: https://svnweb.freebsd.org/changeset/base/321084 Log: MFC r318325: Start writing up some basic feature tests for procstat These tests query a running process for information related to the -b, -c, -e, and -f flags; the -f testcase is largely stubbed out, pending additional work to determine a good, deterministic descriptor. Core file test support is coming soon--it requires a bit more effort due to the fact that: - coredumps can be disabled (kern.coredump=0). - corefiles can be put in different directories than the current directory, or be named something other than `.core` (`kern.corefile`). Added: stable/10/usr.bin/procstat/tests/ - copied from r318325, head/usr.bin/procstat/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/procstat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:54:59 2017 (r321083) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:57:38 2017 (r321084) @@ -616,6 +616,8 @@ .. printf .. + procstat + .. sed regress.multitest.out .. Modified: stable/10/usr.bin/procstat/Makefile ============================================================================== --- stable/10/usr.bin/procstat/Makefile Mon Jul 17 20:54:59 2017 (r321083) +++ stable/10/usr.bin/procstat/Makefile Mon Jul 17 20:57:38 2017 (r321084) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= procstat MAN= procstat.1 SRCS= procstat.c \ @@ -19,5 +21,9 @@ SRCS= procstat.c \ LDADD+= -lutil -lprocstat -lkvm DPADD+= ${LIBUTIL} ${LIBPROCSTAT} ${LIBKVM} + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:01:09 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BBFDDA0A8E; Mon, 17 Jul 2017 21:01:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22FA871433; Mon, 17 Jul 2017 21:01:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HL18id050121; Mon, 17 Jul 2017 21:01:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL173D050116; Mon, 17 Jul 2017 21:01:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172101.v6HL173D050116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321085 - in stable/10: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/stat usr.bin/stat/tests X-SVN-Commit-Revision: 321085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:01:09 -0000 Author: ngie Date: Mon Jul 17 21:01:07 2017 New Revision: 321085 URL: https://svnweb.freebsd.org/changeset/base/321085 Log: MFC r319834,r319841,r320723,r320724: r319834: Write up some basic tests for readlink(1) The tests exercise -f (f_flag), -n (n_flag), and no arguments (basic). r319841: Add initial tests for stat(1) Testcases for -H, -L, and -f haven't been implemented yet, in part due to additional complexity needed to validate the features: * -H and -f will require an external "helper" program to display/modify the state/permissions for a given path. * -L is being covered partially via the -n testcase today. r320723: Use %e instead of %d with x_output_date(..) stat -x doesn't 0-fill days so %d is inappropriate. %e is correct. MFC with: r319841 r320724: :l_flag:: be more aggressive when normalizing whitespace Save output from ls -ldT and stat -l, then normalize all repeating whitespace using sed to single column spaces. This makes the test flexible with single-digit days, etc, similar to r320723. This approach is just a bit more of a hammer approach because of how the columns are ordered/spaced in both ls and stat. MFC with: r319841 Added: stable/10/usr.bin/stat/tests/ - copied from r319834, head/usr.bin/stat/tests/ stable/10/usr.bin/stat/tests/stat_test.sh - copied, changed from r319841, head/usr.bin/stat/tests/stat_test.sh Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/stat/Makefile stable/10/usr.bin/stat/stat.1 stable/10/usr.bin/stat/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:01:07 2017 (r321085) @@ -622,6 +622,8 @@ regress.multitest.out .. .. + stat + .. tail .. tar Modified: stable/10/usr.bin/stat/Makefile ============================================================================== --- stable/10/usr.bin/stat/Makefile Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/usr.bin/stat/Makefile Mon Jul 17 21:01:07 2017 (r321085) @@ -1,8 +1,14 @@ # $FreeBSD$ +.include + PROG= stat LINKS= ${BINDIR}/stat ${BINDIR}/readlink MLINKS= stat.1 readlink.1 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/usr.bin/stat/stat.1 ============================================================================== --- stable/10/usr.bin/stat/stat.1 Mon Jul 17 20:57:38 2017 (r321084) +++ stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:01:07 2017 (r321085) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2012 +.Dd June 22, 2017 .Dt STAT 1 .Os .Sh NAME Modified: stable/10/usr.bin/stat/tests/Makefile ============================================================================== --- head/usr.bin/stat/tests/Makefile Sun Jun 11 21:13:12 2017 (r319834) +++ stable/10/usr.bin/stat/tests/Makefile Mon Jul 17 21:01:07 2017 (r321085) @@ -1,5 +1,6 @@ # $FreeBSD$ ATF_TESTS_SH+= readlink_test +ATF_TESTS_SH+= stat_test .include Copied and modified: stable/10/usr.bin/stat/tests/stat_test.sh (from r319841, head/usr.bin/stat/tests/stat_test.sh) ============================================================================== --- head/usr.bin/stat/tests/stat_test.sh Mon Jun 12 00:21:55 2017 (r319841, copy source) +++ stable/10/usr.bin/stat/tests/stat_test.sh Mon Jul 17 21:01:07 2017 (r321085) @@ -60,14 +60,23 @@ l_flag_body() paths="a b c d" + ls_out=ls.output + stat_out=stat.output + # NOTE: # - Even though stat -l claims to be equivalent to `ls -lT`, the # whitespace is a bit more liberal in the `ls -lT` output. # - `ls -ldT` is used to not recursively list the contents of # directories. for path in $paths; do - atf_check -o inline:"$(ls -ldT $path | sed -e 's, , ,g')\n" \ - stat -l $path + atf_check -o save:$ls_out ls -ldT $path + cat $ls_out + atf_check -o save:$stat_out stat -l $path + cat $stat_out + echo "Comparing normalized whitespace" + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $ls_out + atf_check sed -i '' -E -e 's/[[:space:]]+/ /g' $stat_out + atf_check cmp $ls_out $stat_out done } @@ -165,7 +174,7 @@ t_flag_body() x_output_date() { - local date_format='%a %b %d %H:%M:%S %Y' + local date_format='%a %b %e %H:%M:%S %Y' stat -t "$date_format" "$@" } From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:09:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5BCADA0E1E; Mon, 17 Jul 2017 21:09:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E29A71ECA; Mon, 17 Jul 2017 21:09:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HL9ZMx054532; Mon, 17 Jul 2017 21:09:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HL9ZO5054531; Mon, 17 Jul 2017 21:09:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172109.v6HL9ZO5054531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321090 - stable/10/sys/dev/vt/hw/vga X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 321090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:09:37 -0000 Author: ngie Date: Mon Jul 17 21:09:35 2017 New Revision: 321090 URL: https://svnweb.freebsd.org/changeset/base/321090 Log: MFC r319928: Use nitems(..) when computing `max` instead of the longhand version of the same logic Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:09:31 2017 (r321089) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Mon Jul 17 21:09:35 2017 (r321090) @@ -283,7 +283,7 @@ vga_get_cp437(term_char_t c) int min, mid, max; min = 0; - max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; + max = nitems(cp437table) - 1; if (c < cp437table[0].unicode_base || c > cp437table[max].unicode_base + cp437table[max].length) From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:10:10 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4796BDA0EBA; Mon, 17 Jul 2017 21:10:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1174F72116; Mon, 17 Jul 2017 21:10:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLA9f2054636; Mon, 17 Jul 2017 21:10:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLA91U054635; Mon, 17 Jul 2017 21:10:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172110.v6HLA91U054635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321091 - stable/10/bin/ln X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/bin/ln X-SVN-Commit-Revision: 321091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:10:10 -0000 Author: ngie Date: Mon Jul 17 21:10:08 2017 New Revision: 321091 URL: https://svnweb.freebsd.org/changeset/base/321091 Log: MFC r319857: ln(1): wordsmith -F option description Modified: stable/10/bin/ln/ln.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/ln.1 ============================================================================== --- stable/10/bin/ln/ln.1 Mon Jul 17 21:09:35 2017 (r321090) +++ stable/10/bin/ln/ln.1 Mon Jul 17 21:10:08 2017 (r321091) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd November 2, 2012 +.Dd June 12, 2017 .Dt LN 1 .Os .Sh NAME @@ -87,14 +87,18 @@ option should be used with either or .Fl i options. -If none is specified, +If neither .Fl f +nor +.Fl i +is specified, +.Fl f is implied. The .Fl F option is a no-op unless .Fl s -option is specified. +is specified. .It Fl L When creating a hard link to a symbolic link, create a hard link to the target of the symbolic link. From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:12:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 054BBDA1129; Mon, 17 Jul 2017 21:12:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C02725DC; Mon, 17 Jul 2017 21:12:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLC2vU057798; Mon, 17 Jul 2017 21:12:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLC2In057796; Mon, 17 Jul 2017 21:12:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172112.v6HLC2In057796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: bin/ln bin/ln/tests etc/mtree X-SVN-Commit-Revision: 321093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:12:04 -0000 Author: ngie Date: Mon Jul 17 21:12:02 2017 New Revision: 321093 URL: https://svnweb.freebsd.org/changeset/base/321093 Log: MFC r319857: ln(1): wordsmith -F option description Added: stable/10/bin/ln/tests/ - copied from r319714, head/bin/ln/tests/ Modified: stable/10/bin/ln/Makefile stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/Makefile ============================================================================== --- stable/10/bin/ln/Makefile Mon Jul 17 21:11:21 2017 (r321092) +++ stable/10/bin/ln/Makefile Mon Jul 17 21:12:02 2017 (r321093) @@ -1,10 +1,16 @@ # @(#)Makefile 8.2 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= ln MAN= ln.1 symlink.7 LINKS= ${BINDIR}/ln ${BINDIR}/link MLINKS= ln.1 link.1 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:11:21 2017 (r321092) +++ stable/10/etc/mtree/BSD.tests.dist Mon Jul 17 21:12:02 2017 (r321093) @@ -18,6 +18,8 @@ .. expr .. + ln + .. ls .. mv From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:13:44 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5466DA1220; Mon, 17 Jul 2017 21:13:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACA9B7293A; Mon, 17 Jul 2017 21:13:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLDhno059009; Mon, 17 Jul 2017 21:13:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLDhPE059007; Mon, 17 Jul 2017 21:13:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172113.v6HLDhPE059007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321094 - in stable/10/bin/ln: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/bin/ln: . tests X-SVN-Commit-Revision: 321094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:13:44 -0000 Author: ngie Date: Mon Jul 17 21:13:43 2017 New Revision: 321094 URL: https://svnweb.freebsd.org/changeset/base/321094 Log: MFC r319856,r320172,r320173: r319856: Add a testcase for `ln -sF` The testcase fails today, so mark it with atf_expect_fail: in particular, the target (B) isn't being unlinked and the documentation doesn't suggest special handling for directories. Thus, there's either a doc or an implementation bug in ln(1) that needs to be resolved. MFC with: r319714, r319854, r319855 PR: 219943 r320172: ln(1): fix -F behavior When '-F' option is used, the target directory needs to be unlinked. Currently, the modified target ("target/source") is being unlinked, and since it doesn't yet exist, the original target isn't removed. This is fixed by skipping the block where target is modified to "target/source" when '-F' option is set. Hence, a symbolic link (with the same name as of the original target) to the source_file is produced. Update the test for ln(1) to reflect fix for option '-F' PR: 219943 r320173: Don't expect :sF_flag to fail anymore While here, also add a check to verify that the link target is updated in the testcase MFC with: r320172 PR: 219943 Modified: stable/10/bin/ln/ln.c stable/10/bin/ln/tests/ln_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/ln.c ============================================================================== --- stable/10/bin/ln/ln.c Mon Jul 17 21:12:02 2017 (r321093) +++ stable/10/bin/ln/ln.c Mon Jul 17 21:13:43 2017 (r321094) @@ -245,11 +245,11 @@ linkit(const char *source, const char *target, int isd /* * If the target is a directory (and not a symlink if hflag), - * append the source's name. + * append the source's name, unless Fflag is set. */ - if (isdir || + if (!Fflag && (isdir || (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) || - (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode))) { + (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) { if (strlcpy(bbuf, source, sizeof(bbuf)) >= sizeof(bbuf) || (p = basename(bbuf)) == NULL || snprintf(path, sizeof(path), "%s/%s", target, p) >= Modified: stable/10/bin/ln/tests/ln_test.sh ============================================================================== --- stable/10/bin/ln/tests/ln_test.sh Mon Jul 17 21:12:02 2017 (r321093) +++ stable/10/bin/ln/tests/ln_test.sh Mon Jul 17 21:13:43 2017 (r321094) @@ -145,6 +145,22 @@ snf_flag_dir_body() atf_check -o inline:'C: symbolic link to B\n' file C } +atf_test_case sF_flag +sF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a directory, then '-sF' option removes " \ + "it so that the link may occur" +} + +sF_flag_body() +{ + atf_check mkdir A B + atf_check ln -sF A B + atf_check -o inline:'Symbolic Link\n' stat -f %SHT B + atf_check -o inline:'A\n' readlink B +} + atf_test_case sf_flag sf_flag_head() { @@ -210,6 +226,7 @@ atf_init_test_cases() atf_add_test_case target_exists_symbolic atf_add_test_case shf_flag_dir atf_add_test_case snf_flag_dir + atf_add_test_case sF_flag atf_add_test_case sf_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:18:45 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BD0DA13C4; Mon, 17 Jul 2017 21:18:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDD272C82; Mon, 17 Jul 2017 21:18:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLIiRs059456; Mon, 17 Jul 2017 21:18:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLIiSx059455; Mon, 17 Jul 2017 21:18:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172118.v6HLIiSx059455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321097 - stable/10/usr.bin/du X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/du X-SVN-Commit-Revision: 321097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:18:45 -0000 Author: ngie Date: Mon Jul 17 21:18:44 2017 New Revision: 321097 URL: https://svnweb.freebsd.org/changeset/base/321097 Log: MFC r319846: du(1): trivial whitespace cleanup Modified: stable/10/usr.bin/du/du.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/du/du.c ============================================================================== --- stable/10/usr.bin/du/du.c Mon Jul 17 21:18:40 2017 (r321096) +++ stable/10/usr.bin/du/du.c Mon Jul 17 21:18:44 2017 (r321097) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include #include @@ -517,7 +516,7 @@ static void ignoreclean(void) { struct ignentry *ign; - + while (!SLIST_EMPTY(&ignores)) { ign = SLIST_FIRST(&ignores); SLIST_REMOVE_HEAD(&ignores, next); From owner-svn-src-stable-10@freebsd.org Mon Jul 17 21:19:31 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08420DA14A0; Mon, 17 Jul 2017 21:19:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D8172EEB; Mon, 17 Jul 2017 21:19:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6HLJUkZ059564; Mon, 17 Jul 2017 21:19:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6HLJU5G059563; Mon, 17 Jul 2017 21:19:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707172119.v6HLJU5G059563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 17 Jul 2017 21:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321098 - stable/10/usr.bin/stat X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/stat X-SVN-Commit-Revision: 321098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 21:19:31 -0000 Author: ngie Date: Mon Jul 17 21:19:29 2017 New Revision: 321098 URL: https://svnweb.freebsd.org/changeset/base/321098 Log: MFC r319836: stat(1): sort flags in the DESCRIPTION section -x's description should come after -t's description. Modified: stable/10/usr.bin/stat/stat.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/stat/stat.1 ============================================================================== --- stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:18:44 2017 (r321097) +++ stable/10/usr.bin/stat/stat.1 Mon Jul 17 21:19:29 2017 (r321098) @@ -172,15 +172,15 @@ Display information in .Dq shell output format, suitable for initializing variables. -.It Fl x -Display information in a more verbose way as known from some -.Tn Linux -distributions. .It Fl t Ar timefmt Display timestamps using the specified format. This format is passed directly to .Xr strftime 3 . +.It Fl x +Display information in a more verbose way as known from some +.Tn Linux +distributions. .El .Ss Formats Format strings are similar to From owner-svn-src-stable-10@freebsd.org Tue Jul 18 06:45:43 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DC2AC7DFD2; Tue, 18 Jul 2017 06:45:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07ADB24D6; Tue, 18 Jul 2017 06:45:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I6jg1P090854; Tue, 18 Jul 2017 06:45:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I6jfTR090848; Tue, 18 Jul 2017 06:45:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180645.v6I6jfTR090848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 06:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321108 - in stable/10: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 06:45:43 -0000 Author: ngie Date: Tue Jul 18 06:45:41 2017 New Revision: 321108 URL: https://svnweb.freebsd.org/changeset/base/321108 Log: MFC r307873,r314397,r314399,r314419,r314420,r314533,r316553: r307873 (by marcel): Include instead of when compiled as part of libsbuf. The former is the standard header, and allows us to compile libsbuf on macOS/linux. r314397 (by scottl): Implement sbuf_prf(), which takes an sbuf and outputs it to stdout in the non-kernel case and to the console+log in the kernel case. For the kernel case it hooks the putbuf() machinery underneath printf(9) so that the buffer is written completely atomically and without a copy into another temporary buffer. This is useful for fixing compound console/log messages that become broken and interleaved when multiple threads are competing for the console. r314399 (by scottl): Add prototype for sbuf_putbuf() r314419 (by jkim): Include stdio.h to fix libsbuf build. r314420 (by scottl): Provide a comment on why stdio.h needs to be included. r314533 (by scottl): Expose the sbuf_putbuf() symbol to libsbuf. There are a few other symbols that are present but not exposed, like get/set/clear flags, not sure if they need to be exposed at this point. r316553: sbuf(3): expose sbuf_{clear,get,set}_flags(3) via libsbuf These functions were added to sbuf(9) in r279992, but never exposed to userspace. Expose them now so they can be used/tested. Modified: stable/10/lib/libsbuf/Symbol.map stable/10/lib/libsbuf/Version.def stable/10/share/man/man9/sbuf.9 stable/10/sys/kern/subr_prf.c stable/10/sys/sys/sbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libsbuf/Symbol.map ============================================================================== --- stable/10/lib/libsbuf/Symbol.map Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/lib/libsbuf/Symbol.map Tue Jul 18 06:45:41 2017 (r321108) @@ -21,6 +21,9 @@ FBSD_1.2 { sbuf_len; sbuf_done; sbuf_delete; + sbuf_clear_flags; + sbuf_get_flags; + sbuf_set_flags; }; FBSD_1.3 { @@ -31,3 +34,8 @@ FBSD_1.3 { FBSD_1.4 { sbuf_hexdump; }; + +FBSD_1.5 { + sbuf_putbuf; +}; + Modified: stable/10/lib/libsbuf/Version.def ============================================================================== --- stable/10/lib/libsbuf/Version.def Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/lib/libsbuf/Version.def Tue Jul 18 06:45:41 2017 (r321108) @@ -8,3 +8,6 @@ FBSD_1.3 { FBSD_1.4 { } FBSD_1.3; + +FBSD_1.5 { +} FBSD_1.4; Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 06:45:41 2017 (r321108) @@ -54,7 +54,8 @@ .Nm sbuf_delete , .Nm sbuf_start_section , .Nm sbuf_end_section , -.Nm sbuf_hexdump +.Nm sbuf_hexdump , +.Nm sbuf_putbuf .Nd safe string composition .Sh SYNOPSIS .In sys/types.h @@ -115,6 +116,8 @@ .Fa "const char *hdr" .Fa "int flags" .Fc +.Ft void +.Fn sbuf_putbuf "struct sbuf *s" .In sys/sysctl.h .Ft struct sbuf * .Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" @@ -449,6 +452,12 @@ representation of the bytes if possible. See the .Xr hexdump 3 man page for more details on the interface. +.Pp +The +.Fn sbuf_putbuf +function printfs the sbuf to stdout if in userland, and to the console +and log if in the kernel. +It does not drain the buffer or update any pointers. .Sh NOTES If an operation caused an .Fa sbuf Modified: stable/10/sys/kern/subr_prf.c ============================================================================== --- stable/10/sys/kern/subr_prf.c Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/sys/kern/subr_prf.c Tue Jul 18 06:45:41 2017 (r321108) @@ -72,8 +72,20 @@ __FBSDID("$FreeBSD$"); * Note that stdarg.h and the ANSI style va_start macro is used for both * ANSI and traditional C compilers. */ +#ifdef _KERNEL #include +#else +#include +#endif +/* + * This is needed for sbuf_putbuf() when compiled into userland. Due to the + * shared nature of this file, it's the only place to put it. + */ +#ifndef _KERNEL +#include +#endif + #ifdef _KERNEL #define TOCONS 0x01 @@ -403,6 +415,23 @@ vprintf(const char *fmt, va_list ap) } static void +prf_putbuf(char *bufr, int flags, int pri) +{ + + if (flags & TOLOG) + msglogstr(bufr, pri, /*filter_cr*/1); + + if (flags & TOCONS) { + if ((panicstr == NULL) && (constty != NULL)) + msgbuf_addstr(&consmsgbuf, -1, + bufr, /*filter_cr*/ 0); + + if ((constty == NULL) ||(always_console_output)) + cnputs(bufr); + } +} + +static void putbuf(int c, struct putchar_arg *ap) { /* Check if no console output buffer was provided. */ @@ -423,19 +452,8 @@ putbuf(int c, struct putchar_arg *ap) /* Check if the buffer needs to be flushed. */ if (ap->remain == 2 || c == '\n') { + prf_putbuf(ap->p_bufr, ap->flags, ap->pri); - if (ap->flags & TOLOG) - msglogstr(ap->p_bufr, ap->pri, /*filter_cr*/1); - - if (ap->flags & TOCONS) { - if ((panicstr == NULL) && (constty != NULL)) - msgbuf_addstr(&consmsgbuf, -1, - ap->p_bufr, /*filter_cr*/ 0); - - if ((constty == NULL) ||(always_console_output)) - cnputs(ap->p_bufr); - } - ap->p_next = ap->p_bufr; ap->remain = ap->n_bufr; *ap->p_next = '\0'; @@ -1203,5 +1221,21 @@ counted_warning(unsigned *counter, const char *msg) break; } } +} +#endif + +#ifdef _KERNEL +void +sbuf_putbuf(struct sbuf *sb) +{ + + prf_putbuf(sbuf_data(sb), TOLOG | TOCONS, -1); +} +#else +void +sbuf_putbuf(struct sbuf *sb) +{ + + printf("%s", sbuf_data(sb)); } #endif Modified: stable/10/sys/sys/sbuf.h ============================================================================== --- stable/10/sys/sys/sbuf.h Tue Jul 18 06:45:13 2017 (r321107) +++ stable/10/sys/sys/sbuf.h Tue Jul 18 06:45:41 2017 (r321108) @@ -95,6 +95,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +void sbuf_putbuf(struct sbuf *); #ifdef _KERNEL struct uio; From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:15:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D23C7F84C; Tue, 18 Jul 2017 08:15:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A0D64225; Tue, 18 Jul 2017 08:15:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8F3Fb028002; Tue, 18 Jul 2017 08:15:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8F3cE027998; Tue, 18 Jul 2017 08:15:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180815.v6I8F3cE027998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321112 - in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:15:04 -0000 Author: ngie Date: Tue Jul 18 08:15:02 2017 New Revision: 321112 URL: https://svnweb.freebsd.org/changeset/base/321112 Log: MFC r279992,r280149,r280193,r288223,r288484,r321109: r279992 (by ian): Add a new flag, SBUF_INCLUDENUL, and new get/set/clear functions for flags. The SBUF_INCLUDENUL flag causes the nulterm byte at the end of the string to be counted in the length of the data. If copying the data using the sbuf_data() and sbuf_len() functions, or if writing it automatically with a drain function, the net effect is that the nulterm byte is copied along with the rest of the data. r280149 (by ian): Update an sbuf assertion to allow for the new SBUF_INCLUDENUL flag. If INCLUDENUL is set and sbuf_finish() has been called, the length has been incremented to count the nulterm byte, and in that case current length is allowed to be equal to buffer size, otherwise it must be less than. Add a predicate macro to test for SBUF_INCLUDENUL, and use it in tests, to be consistant with the style in the rest of this file. r280193 (by ian): The minimum sbuf buffer size is 2 bytes (a byte plus a nulterm), assert that. Values smaller than two lead to strange asserts that have nothing to do with the actual problem (in the case of size=0), or to writing beyond the end of the allocated buffer in sbuf_finish() (in the case of size=1). r288223 (by cem): sbuf: Process more than one char at a time Revamp sbuf_put_byte() to sbuf_put_bytes() in the obvious fashion and fixup callers. Add a thin shim around sbuf_put_bytes() with the old ABI to avoid ugly changes to some callers. Obtained from: Dan Sledz r288484 (by phk): Fail the sbuf if vsnprintf(3) fails. r321109: Fix whitespace regression accidentally checked in via ^/head@r280149 Modified: stable/10/share/man/man9/sbuf.9 stable/10/sys/kern/subr_sbuf.c stable/10/sys/sys/sbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:15:02 2017 (r321112) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 11, 2013 +.Dd March 14, 2015 .Dt SBUF 9 .Os .Sh NAME @@ -34,6 +34,9 @@ .Nm sbuf_new_auto , .Nm sbuf_new_for_sysctl , .Nm sbuf_clear , +.Nm sbuf_get_flags , +.Nm sbuf_set_flags , +.Nm sbuf_clear_flags , .Nm sbuf_setpos , .Nm sbuf_bcat , .Nm sbuf_bcopyin , @@ -69,6 +72,12 @@ .Ft void .Fn sbuf_clear "struct sbuf *s" .Ft int +.Fn sbuf_get_flags "struct sbuf *s" +.Ft void +.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Ft void +.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Ft int .Fn sbuf_setpos "struct sbuf *s" "int pos" .Ft int .Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" @@ -171,6 +180,8 @@ Attempting to extend the sbuf beyond this size results .It Dv SBUF_AUTOEXTEND This indicates that the storage buffer may be extended as necessary, so long as resources allow, to hold additional data. +.It Dv SBUF_INCLUDENUL +This causes the final nulterm byte to be counted in the length of the data. .El .Pp Note that if @@ -221,6 +232,18 @@ The function invalidates the contents of the .Fa sbuf and resets its position to zero. +.Pp +The +.Fn sbuf_get_flags +function returns the current user flags. +The +.Fn sbuf_set_flags +and +.Fn sbuf_get_flags +functions set or clear one or more user flags, respectively. +The user flags are described under the +.Fn sbuf_new +function. .Pp The .Fn sbuf_setpos Modified: stable/10/sys/kern/subr_sbuf.c ============================================================================== --- stable/10/sys/kern/subr_sbuf.c Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/sys/kern/subr_sbuf.c Tue Jul 18 08:15:02 2017 (r321112) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ __FBSDID("$FreeBSD$"); #else /* _KERNEL */ #include #include +#include #include #include #include @@ -70,6 +72,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) #define SBUF_ISSECTION(s) ((s)->s_flags & SBUF_INSECTION) +#define SBUF_NULINCLUDED(s) ((s)->s_flags & SBUF_INCLUDENUL) /* * Set / clear flags @@ -77,6 +80,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_SETFLAG(s, f) do { (s)->s_flags |= (f); } while (0) #define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0) +#define SBUF_MINSIZE 2 /* Min is 1 byte + nulterm. */ #define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */ #ifdef PAGE_SIZE @@ -100,9 +104,15 @@ _assert_sbuf_integrity(const char *fun, struct sbuf *s ("%s called with a NULL sbuf pointer", fun)); KASSERT(s->s_buf != NULL, ("%s called with uninitialized or corrupt sbuf", fun)); - KASSERT(s->s_len < s->s_size, - ("wrote past end of sbuf (%jd >= %jd)", - (intmax_t)s->s_len, (intmax_t)s->s_size)); + if (SBUF_ISFINISHED(s) && SBUF_NULINCLUDED(s)) { + KASSERT(s->s_len <= s->s_size, + ("wrote past end of sbuf (%jd >= %jd)", + (intmax_t)s->s_len, (intmax_t)s->s_size)); + } else { + KASSERT(s->s_len < s->s_size, + ("wrote past end of sbuf (%jd >= %jd)", + (intmax_t)s->s_len, (intmax_t)s->s_size)); + } } static void @@ -185,8 +195,9 @@ sbuf_newbuf(struct sbuf *s, char *buf, int length, int s->s_buf = buf; if ((s->s_flags & SBUF_AUTOEXTEND) == 0) { - KASSERT(s->s_size >= 0, - ("attempt to create a too small sbuf")); + KASSERT(s->s_size >= SBUF_MINSIZE, + ("attempt to create an sbuf smaller than %d bytes", + SBUF_MINSIZE)); } if (s->s_buf != NULL) @@ -262,6 +273,28 @@ sbuf_uionew(struct sbuf *s, struct uio *uio, int *erro } #endif +int +sbuf_get_flags(struct sbuf *s) +{ + + return (s->s_flags & SBUF_USRFLAGMSK); +} + +void +sbuf_clear_flags(struct sbuf *s, int flags) +{ + + s->s_flags &= ~(flags & SBUF_USRFLAGMSK); +} + +void +sbuf_set_flags(struct sbuf *s, int flags) +{ + + + s->s_flags |= (flags & SBUF_USRFLAGMSK); +} + /* * Clear an sbuf and reset its position. */ @@ -352,55 +385,63 @@ sbuf_drain(struct sbuf *s) } /* - * Append a byte to an sbuf. This is the core function for appending + * Append bytes to an sbuf. This is the core function for appending * to an sbuf and is the main place that deals with extending the * buffer and marking overflow. */ static void -sbuf_put_byte(struct sbuf *s, int c) +sbuf_put_bytes(struct sbuf *s, const char *buf, size_t len) { + size_t n; assert_sbuf_integrity(s); assert_sbuf_state(s, 0); if (s->s_error != 0) return; - if (SBUF_FREESPACE(s) <= 0) { - /* - * If there is a drain, use it, otherwise extend the - * buffer. - */ - if (s->s_drain_func != NULL) - (void)sbuf_drain(s); - else if (sbuf_extend(s, 1) < 0) - s->s_error = ENOMEM; - if (s->s_error != 0) - return; + while (len > 0) { + if (SBUF_FREESPACE(s) <= 0) { + /* + * If there is a drain, use it, otherwise extend the + * buffer. + */ + if (s->s_drain_func != NULL) + (void)sbuf_drain(s); + else if (sbuf_extend(s, len > INT_MAX ? INT_MAX : len) + < 0) + s->s_error = ENOMEM; + if (s->s_error != 0) + return; + } + n = SBUF_FREESPACE(s); + if (len < n) + n = len; + memcpy(&s->s_buf[s->s_len], buf, n); + s->s_len += n; + if (SBUF_ISSECTION(s)) + s->s_sect_len += n; + len -= n; + buf += n; } - s->s_buf[s->s_len++] = c; - if (SBUF_ISSECTION(s)) - s->s_sect_len++; } +static void +sbuf_put_byte(struct sbuf *s, char c) +{ + + sbuf_put_bytes(s, &c, 1); +} + /* * Append a byte string to an sbuf. */ int sbuf_bcat(struct sbuf *s, const void *buf, size_t len) { - const char *str = buf; - const char *end = str + len; - assert_sbuf_integrity(s); - assert_sbuf_state(s, 0); - + sbuf_put_bytes(s, buf, len); if (s->s_error != 0) return (-1); - for (; str < end; str++) { - sbuf_put_byte(s, *str); - if (s->s_error != 0) - return (-1); - } return (0); } @@ -454,18 +495,12 @@ sbuf_bcpy(struct sbuf *s, const void *buf, size_t len) int sbuf_cat(struct sbuf *s, const char *str) { + size_t n; - assert_sbuf_integrity(s); - assert_sbuf_state(s, 0); - + n = strlen(str); + sbuf_put_bytes(s, str, n); if (s->s_error != 0) return (-1); - - while (*str != '\0') { - sbuf_put_byte(s, *str++); - if (s->s_error != 0) - return (-1); - } return (0); } @@ -588,6 +623,10 @@ sbuf_vprintf(struct sbuf *s, const char *fmt, va_list va_copy(ap_copy, ap); len = vsnprintf(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1, fmt, ap_copy); + if (len < 0) { + s->s_error = errno; + return (-1); + } va_end(ap_copy); if (SBUF_FREESPACE(s) >= len) @@ -697,11 +736,13 @@ sbuf_finish(struct sbuf *s) assert_sbuf_integrity(s); assert_sbuf_state(s, 0); + s->s_buf[s->s_len] = '\0'; + if (SBUF_NULINCLUDED(s)) + s->s_len++; if (s->s_drain_func != NULL) { while (s->s_len > 0 && s->s_error == 0) s->s_error = sbuf_drain(s); } - s->s_buf[s->s_len] = '\0'; SBUF_SETFLAG(s, SBUF_FINISHED); #ifdef _KERNEL return (s->s_error); @@ -743,6 +784,10 @@ sbuf_len(struct sbuf *s) if (s->s_error != 0) return (-1); + + /* If finished, nulterm is already in len, else add one. */ + if (SBUF_NULINCLUDED(s) && !SBUF_ISFINISHED(s)) + return (s->s_len + 1); return (s->s_len); } Modified: stable/10/sys/sys/sbuf.h ============================================================================== --- stable/10/sys/sys/sbuf.h Tue Jul 18 07:41:38 2017 (r321111) +++ stable/10/sys/sys/sbuf.h Tue Jul 18 08:15:02 2017 (r321112) @@ -48,6 +48,7 @@ struct sbuf { ssize_t s_len; /* current length of string */ #define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */ #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ +#define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ @@ -72,6 +73,9 @@ __BEGIN_DECLS struct sbuf *sbuf_new(struct sbuf *, char *, int, int); #define sbuf_new_auto() \ sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND) +int sbuf_get_flags(struct sbuf *); +void sbuf_clear_flags(struct sbuf *, int); +void sbuf_set_flags(struct sbuf *, int); void sbuf_clear(struct sbuf *); int sbuf_setpos(struct sbuf *, ssize_t); int sbuf_bcat(struct sbuf *, const void *, size_t); From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:23:23 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12FB7C7FA43; Tue, 18 Jul 2017 08:23:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55AB64691; Tue, 18 Jul 2017 08:23:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8NMe4031980; Tue, 18 Jul 2017 08:23:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8NL9Y031977; Tue, 18 Jul 2017 08:23:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180823.v6I8NL9Y031977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321113 - in stable/10: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree lib/libsbuf lib/libsbuf/tests X-SVN-Commit-Revision: 321113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:23:23 -0000 Author: ngie Date: Tue Jul 18 08:23:21 2017 New Revision: 321113 URL: https://svnweb.freebsd.org/changeset/base/321113 Log: MFC r316557: sbuf(3): add some basic functional tests for the library Areas not covered still [positive functionality wise] are: - sbuf_{clear,get,set}_flags - sbuf_new (in particular, with fixed buffers, etc). Some basic negative testing has been added, but more will be added in the future. This work was in part to validate work done by cem in r288223, and ian before that. Added: stable/10/lib/libsbuf/tests/ - copied from r316557, head/lib/libsbuf/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libsbuf/Makefile stable/10/lib/libsbuf/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 08:15:02 2017 (r321112) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 08:23:21 2017 (r321113) @@ -324,6 +324,8 @@ .. librt .. + libsbuf + .. libthr dlopen .. Modified: stable/10/lib/libsbuf/Makefile ============================================================================== --- stable/10/lib/libsbuf/Makefile Tue Jul 18 08:15:02 2017 (r321112) +++ stable/10/lib/libsbuf/Makefile Tue Jul 18 08:23:21 2017 (r321113) @@ -9,6 +9,12 @@ SHLIB_MAJOR = 6 SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_DEF= ${.CURDIR}/Version.def +.include + .PATH: ${SRCTOP}/sys/kern + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/lib/libsbuf/tests/Makefile ============================================================================== --- head/lib/libsbuf/tests/Makefile Thu Apr 6 05:29:28 2017 (r316557) +++ stable/10/lib/libsbuf/tests/Makefile Tue Jul 18 08:23:21 2017 (r321113) @@ -4,7 +4,7 @@ ATF_TESTS_C+= sbuf_core_test ATF_TESTS_C+= sbuf_stdio_test ATF_TESTS_C+= sbuf_string_test -LIBADD+= sbuf util +LDADD+= -lsbuf -lutil WARNS?= 6 From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:28:16 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 385C5C7FB91; Tue, 18 Jul 2017 08:28:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13DEE649ED; Tue, 18 Jul 2017 08:28:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8SFud032336; Tue, 18 Jul 2017 08:28:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8SFRQ032334; Tue, 18 Jul 2017 08:28:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180828.v6I8SFRQ032334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321115 - stable/10/share/man/man9 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man9 X-SVN-Commit-Revision: 321115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:28:16 -0000 Author: ngie Date: Tue Jul 18 08:28:14 2017 New Revision: 321115 URL: https://svnweb.freebsd.org/changeset/base/321115 Log: MFC r316549,r316550,r316551,r316554: r316549: Add sys/types.h #include to EXAMPLE to provide a complete functional standalone example program r316550: sbuf(9): convert SYNOPSIS section from .Fn entries to .Fo/.Fa/.Fc entries This shortens the column count on many lines considerably. While here, add "(void)" to sbuf_new_auto(3) for consistency with style(9) recommendations. r316551: sbuf(9): clarify kernel-only APIs - move sbuf_bcopyin(9) and sbuf_copyin(9) near sbuf_new_for_sysctl(9), as all three functions are kernel-only APIs. - add #ifdef _KERNEL around sbuf_*copyin and sbuf_new_for_sysctl(9) to make it visually clear that they are kernel-only APIs. r316554: sbuf(9): add MLINKS for sbuf_{clear,get,set}_flags(9) These functions were added in r279992. Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/sbuf.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Jul 18 08:23:47 2017 (r321114) +++ stable/10/share/man/man9/Makefile Tue Jul 18 08:28:14 2017 (r321115) @@ -1149,6 +1149,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_bcpy.9 \ sbuf.9 sbuf_cat.9 \ sbuf.9 sbuf_clear.9 \ + sbuf.9 sbuf_clear_flags.9 \ sbuf.9 sbuf_copyin.9 \ sbuf.9 sbuf_cpy.9 \ sbuf.9 sbuf_data.9 \ @@ -1156,6 +1157,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_done.9 \ sbuf.9 sbuf_error.9 \ sbuf.9 sbuf_finish.9 \ + sbuf.9 sbuf_get_flags.9 \ sbuf.9 sbuf_hexdump.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ @@ -1163,6 +1165,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ + sbuf.9 sbuf_set_flags.9 \ sbuf.9 sbuf_setpos.9 \ sbuf.9 sbuf_trim.9 \ sbuf.9 sbuf_vprintf.9 Modified: stable/10/share/man/man9/sbuf.9 ============================================================================== --- stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:23:47 2017 (r321114) +++ stable/10/share/man/man9/sbuf.9 Tue Jul 18 08:28:14 2017 (r321115) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2015 +.Dd April 5, 2017 .Dt SBUF 9 .Os .Sh NAME @@ -66,57 +66,123 @@ .Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ; .Pp .Ft struct sbuf * -.Fn sbuf_new "struct sbuf *s" "char *buf" "int length" "int flags" +.Fo sbuf_new +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "int flags" +.Fc .Ft struct sbuf * -.Fn sbuf_new_auto +.Fo sbuf_new_auto +.Fa "void" +.Fc .Ft void -.Fn sbuf_clear "struct sbuf *s" +.Fo sbuf_clear +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_get_flags "struct sbuf *s" +.Fo sbuf_get_flags +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_set_flags "struct sbuf *s" "int flags" +.Fo sbuf_set_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft void -.Fn sbuf_clear_flags "struct sbuf *s" "int flags" +.Fo sbuf_clear_flags +.Fa "struct sbuf *s" +.Fa "int flags" +.Fc .Ft int -.Fn sbuf_setpos "struct sbuf *s" "int pos" +.Fo sbuf_setpos +.Fa "struct sbuf *s" +.Fa "int pos" +.Fc .Ft int -.Fn sbuf_bcat "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_bcat +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcopyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_bcpy +.Fa "struct sbuf *s" +.Fa "const void *buf" +.Fa "size_t len" +.Fc .Ft int -.Fn sbuf_bcpy "struct sbuf *s" "const void *buf" "size_t len" +.Fo sbuf_cat +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_cat "struct sbuf *s" "const char *str" +.Fo sbuf_cpy +.Fa "struct sbuf *s" +.Fa "const char *str" +.Fc .Ft int -.Fn sbuf_copyin "struct sbuf *s" "const void *uaddr" "size_t len" +.Fo sbuf_printf +.Fa "struct sbuf *s" +.Fa "const char *fmt" "..." +.Fc .Ft int -.Fn sbuf_cpy "struct sbuf *s" "const char *str" +.Fo sbuf_vprintf +.Fa "struct sbuf *s" +.Fa "const char *fmt" +.Fa "va_list ap" +.Fc .Ft int -.Fn sbuf_printf "struct sbuf *s" "const char *fmt" "..." -.Ft int -.Fn sbuf_vprintf "struct sbuf *s" "const char *fmt" "va_list ap" -.Ft int -.Fn sbuf_putc "struct sbuf *s" "int c" +.Fo sbuf_putc +.Fa "struct sbuf *s" +.Fa "int c" +.Fc .Ft void -.Fn sbuf_set_drain "struct sbuf *s" "sbuf_drain_func *func" "void *arg" +.Fo sbuf_set_drain +.Fa "struct sbuf *s" +.Fa "sbuf_drain_func *func" +.Fa "void *arg" +.Fc .Ft int -.Fn sbuf_trim "struct sbuf *s" +.Fo sbuf_trim +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_error "struct sbuf *s" +.Fo sbuf_error +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_finish "struct sbuf *s" +.Fo sbuf_finish +.Fa "struct sbuf *s" +.Fc .Ft char * -.Fn sbuf_data "struct sbuf *s" +.Fo sbuf_data +.Fa "struct sbuf *s" +.Fc .Ft ssize_t -.Fn sbuf_len "struct sbuf *s" +.Fo sbuf_len +.Fa "struct sbuf *s" +.Fc .Ft int -.Fn sbuf_done "struct sbuf *s" +.Fo sbuf_done +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_delete "struct sbuf *s" +.Fo sbuf_delete +.Fa "struct sbuf *s" +.Fc .Ft void -.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp" +.Fo sbuf_start_section +.Fa "struct sbuf *s" +.Fa "ssize_t *old_lenp" +.Fc .Ft ssize_t -.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c" +.Fo sbuf_end_section +.Fa "struct sbuf *s" +.Fa "ssize_t old_len" +.Fa "size_t pad" +.Fa "int c" +.Fc .Ft void .Fo sbuf_hexdump .Fa "struct sbuf *sb" @@ -126,10 +192,33 @@ .Fa "int flags" .Fc .Ft void -.Fn sbuf_putbuf "struct sbuf *s" +.Fo sbuf_putbuf +.Fa "struct sbuf *s" +.Fc +.Fd #ifdef _KERNEL +.In sys/types.h +.In sys/sbuf.h +.Ft int +.Fo sbuf_bcopyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc +.Ft int +.Fo sbuf_copyin +.Fa "struct sbuf *s" +.Fa "const void *uaddr" +.Fa "size_t len" +.Fc .In sys/sysctl.h .Ft struct sbuf * -.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" +.Fo sbuf_new_for_sysctl +.Fa "struct sbuf *s" +.Fa "char *buf" +.Fa "int length" +.Fa "struct sysctl_req *req" +.Fc +.Fd #endif /* _KERNEL */ .Sh DESCRIPTION The .Nm @@ -567,6 +656,7 @@ function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES .Bd -literal -compact +#include #include struct sbuf *sb; From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:31:00 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04BACC7FE7C; Tue, 18 Jul 2017 08:31:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04F364D77; Tue, 18 Jul 2017 08:30:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8UwIm032618; Tue, 18 Jul 2017 08:30:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8UwWF032613; Tue, 18 Jul 2017 08:30:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180830.v6I8UwWF032613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321118 - in stable/10/lib: libcam/tests libsbuf/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/lib: libcam/tests libsbuf/tests X-SVN-Commit-Revision: 321118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:31:00 -0000 Author: ngie Date: Tue Jul 18 08:30:58 2017 New Revision: 321118 URL: https://svnweb.freebsd.org/changeset/base/321118 Log: MFC r316558: Use __FBSDID instead of the license agreement to embed the $FreeBSD$ RCS keyword Reminded by a comment made by markj w.r.t. using __FBSDID in .c files ala a past Phabricator review. Modified: stable/10/lib/libcam/tests/libcam_test.c stable/10/lib/libsbuf/tests/sbuf_core_test.c stable/10/lib/libsbuf/tests/sbuf_stdio_test.c stable/10/lib/libsbuf/tests/sbuf_string_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: stable/10/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_core_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: stable/10/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_stdio_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: stable/10/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/10/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:30:51 2017 (r321117) +++ stable/10/lib/libsbuf/tests/sbuf_string_test.c Tue Jul 18 08:30:58 2017 (r321118) @@ -22,9 +22,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:33:31 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 557CACFC11E; Tue, 18 Jul 2017 08:33:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14747652B3; Tue, 18 Jul 2017 08:33:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8XTKM036693; Tue, 18 Jul 2017 08:33:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8XT26036692; Tue, 18 Jul 2017 08:33:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180833.v6I8XT26036692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321120 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/stdio X-SVN-Commit-Revision: 321120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:33:31 -0000 Author: ngie Date: Tue Jul 18 08:33:29 2017 New Revision: 321120 URL: https://svnweb.freebsd.org/changeset/base/321120 Log: MFC r318705: fopen(3): make manlint fixes - Break on new lines. - Use .Dv with NULL. - Rewrap lines as necessary/when possible. Modified: stable/10/lib/libc/stdio/fopen.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/fopen.3 ============================================================================== --- stable/10/lib/libc/stdio/fopen.3 Tue Jul 18 08:33:07 2017 (r321119) +++ stable/10/lib/libc/stdio/fopen.3 Tue Jul 18 08:33:29 2017 (r321120) @@ -230,15 +230,20 @@ argument, .Fn fmemopen allocates .Fa size -bytes of memory. This buffer is automatically freed when the -stream is closed. Buffers can be opened in text-mode (default) or binary-mode +bytes of memory. +This buffer is automatically freed when the stream is closed. +Buffers can be opened in text-mode (default) or binary-mode (if .Dq Li b is present in the second or third position of the .Fa mode -argument). Buffers opened in text-mode make sure that writes are terminated with -a NULL byte, if the last write hasn't filled up the whole buffer. Buffers -opened in binary-mode never append a NULL byte. +argument). +Buffers opened in text-mode make sure that writes are terminated with a +.Dv NULL +byte, if the last write hasn't filled up the whole buffer. +Buffers opened in binary-mode never append a +.Dv NULL +byte. .Sh RETURN VALUES Upon successful completion .Fn fopen , From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:44:39 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB62DCFC499; Tue, 18 Jul 2017 08:44:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8485F6584D; Tue, 18 Jul 2017 08:44:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8ic7d040960; Tue, 18 Jul 2017 08:44:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8ic1O040959; Tue, 18 Jul 2017 08:44:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180844.v6I8ic1O040959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321122 - stable/10/lib/libcam/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libcam/tests X-SVN-Commit-Revision: 321122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:44:39 -0000 Author: ngie Date: Tue Jul 18 08:44:38 2017 New Revision: 321122 URL: https://svnweb.freebsd.org/changeset/base/321122 Log: MFC r319844,r319845: r319844: Add positive and negative testcases for cam_get_device(3) r319845: Remove stdlib.h #include added in r319844 A previous iteration of the tests I added in r319844 involved free(3), but that attempt didn't pan out, so I switched to stack allocated buffers instead of heap allocated ones, making the #include unnecessary. MFC with: r319844 Modified: stable/10/lib/libcam/tests/libcam_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:35:22 2017 (r321121) +++ stable/10/lib/libcam/tests/libcam_test.c Tue Jul 18 08:44:38 2017 (r321122) @@ -58,6 +58,75 @@ cam_has_error(void) return (strlen(cam_errbuf) != 0); } +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_NULL_path); +ATF_TC_BODY(cam_get_device_negative_test_NULL_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device(NULL, parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_bad_path); +ATF_TC_BODY(cam_get_device_negative_test_bad_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("1ada", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_nul_path); +ATF_TC_BODY(cam_get_device_negative_test_nul_path, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_negative_test_root); +ATF_TC_BODY(cam_get_device_negative_test_root, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("/", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == -1, + "cam_get_device succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(cam_get_device_positive_test); +ATF_TC_BODY(cam_get_device_positive_test, tc) +{ + char expected_dev_name[] = "foo"; + char parsed_dev_name[DEV_IDLEN + 1]; + int expected_unit, parsed_unit; + + expected_unit = 1; + + ATF_REQUIRE_MSG(cam_get_device("/dev/foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); + + strcpy(parsed_dev_name, ""); + parsed_unit = -1; + + ATF_REQUIRE_MSG(cam_get_device("foo1", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, expected_dev_name); + ATF_REQUIRE(parsed_unit == expected_unit); +} + ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { @@ -206,6 +275,11 @@ ATF_TC_BODY(cam_freeccb_negative_test_NULL, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_NULL_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_bad_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); + ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); + ATF_TP_ADD_TC(tp, cam_get_device_positive_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:50:37 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5049CFC62C; Tue, 18 Jul 2017 08:50:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 828BC65BAE; Tue, 18 Jul 2017 08:50:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8oaLL041371; Tue, 18 Jul 2017 08:50:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8oaOs041370; Tue, 18 Jul 2017 08:50:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180850.v6I8oaOs041370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321124 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:50:37 -0000 Author: ngie Date: Tue Jul 18 08:50:36 2017 New Revision: 321124 URL: https://svnweb.freebsd.org/changeset/base/321124 Log: MFC r318695: err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0` This is being done to aid humans and static analysis checkers. Modified: stable/10/lib/libc/gen/err.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/err.c ============================================================================== --- stable/10/lib/libc/gen/err.c Tue Jul 18 08:44:48 2017 (r321123) +++ stable/10/lib/libc/gen/err.c Tue Jul 18 08:50:36 2017 (r321124) @@ -100,7 +100,7 @@ void verrc(int eval, int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -125,7 +125,7 @@ void verrx(int eval, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); @@ -165,7 +165,7 @@ void vwarnc(int code, const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { vfprintf(err_file, fmt, ap); @@ -187,7 +187,7 @@ void vwarnx(const char *fmt, va_list ap) { if (err_file == NULL) - err_set_file((FILE *)0); + err_set_file(NULL); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) vfprintf(err_file, fmt, ap); From owner-svn-src-stable-10@freebsd.org Tue Jul 18 08:54:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35225CFCA6C; Tue, 18 Jul 2017 08:54:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 047B8663B5; Tue, 18 Jul 2017 08:54:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6I8sZtl045251; Tue, 18 Jul 2017 08:54:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6I8sZYE045250; Tue, 18 Jul 2017 08:54:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707180854.v6I8sZYE045250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 08:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321127 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 08:54:36 -0000 Author: ngie Date: Tue Jul 18 08:54:35 2017 New Revision: 321127 URL: https://svnweb.freebsd.org/changeset/base/321127 Log: MFC r319842: getbsize(3): clarify that underflow/overflow warnings in regard to $BLOCKSIZE gets output via warnx(3) This helps set expectations for how one might deal with those messages, i.e., mute output from /dev/stderr today, since that's where vwarn(3) outputs messages to today. Modified: stable/10/lib/libc/gen/getbsize.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getbsize.3 ============================================================================== --- stable/10/lib/libc/gen/getbsize.3 Tue Jul 18 08:53:54 2017 (r321126) +++ stable/10/lib/libc/gen/getbsize.3 Tue Jul 18 08:54:35 2017 (r321127) @@ -28,7 +28,7 @@ .\" @(#)getbsize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 16, 2012 +.Dd June 11, 2017 .Dt GETBSIZE 3 .Os .Sh NAME @@ -67,7 +67,8 @@ Sizes less than 512 bytes are rounded up to 512 bytes, greater than 1 GB are rounded down to 1 GB. In each case .Fn getbsize -produces a warning message. +produces a warning message via +.Xr warnx 3 . .Pp The .Fn getbsize From owner-svn-src-stable-10@freebsd.org Tue Jul 18 16:27:11 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2590D96D8A; Tue, 18 Jul 2017 16:27:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD4973B3B; Tue, 18 Jul 2017 16:27:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IGRAl1028065; Tue, 18 Jul 2017 16:27:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGRAm4028058; Tue, 18 Jul 2017 16:27:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181627.v6IGRAm4028058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321130 - in stable/10: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown usr.sbin/chown/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: . bin/chmod bin/chmod/tests etc/mtree tools/build/mk usr.sbin/chown usr.sbin/chown/tests X-SVN-Commit-Revision: 321130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 16:27:12 -0000 Author: ngie Date: Tue Jul 18 16:27:10 2017 New Revision: 321130 URL: https://svnweb.freebsd.org/changeset/base/321130 Log: MFC r268030,r268793,r303212,r319642,r319830: r268030 (by eadler): chown: add a test Add a test for the chown utility. This sets up chown(8) to be capable of being tested. As such, only add one test for now as an example. r268793 (by eadler): chown: Fix chown test number r303212 (by bdrewery): Move chown tests to proper path r319642: Add some basic tests for chmod(1) r319830: Add more simple positive tests for chown(1) The tests are largely symmetric with the tests for chmod(1)--added in r319642. Remove chown-f_test (added in r268030) since the test coverage is now being provided by `chown_test`. Added: stable/10/bin/chmod/tests/ - copied from r319642, head/bin/chmod/tests/ stable/10/usr.sbin/chown/tests/ - copied from r268030, head/usr.sbin/chown/tests/ stable/10/usr.sbin/chown/tests/chown_test.sh - copied unchanged from r319830, head/usr.sbin/chown/tests/chown_test.sh Deleted: stable/10/usr.sbin/chown/tests/chown-f_test.sh Modified: stable/10/ObsoleteFiles.inc stable/10/bin/chmod/Makefile stable/10/etc/mtree/BSD.tests.dist stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/chown/Makefile stable/10/usr.sbin/chown/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/ObsoleteFiles.inc Tue Jul 18 16:27:10 2017 (r321130) @@ -40,6 +40,8 @@ # 20170620: remove stale manpage OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz +# 20170610: chown-f_test replaced by chown_test +OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170322: rename to _test to match the FreeBSD test suite name scheme OLD_FILES+=usr/tests/usr.bin/col/col OLD_FILES+=usr/tests/usr.sbin/pw/pw_config Modified: stable/10/bin/chmod/Makefile ============================================================================== --- stable/10/bin/chmod/Makefile Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/bin/chmod/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= chmod + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:27:10 2017 (r321130) @@ -8,7 +8,7 @@ bin cat .. - chown + chmod .. date .. @@ -652,6 +652,8 @@ .. .. usr.sbin + chown + .. etcupdate .. extattr Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jul 18 16:27:10 2017 (r321130) @@ -4820,6 +4820,9 @@ OLD_FILES+=usr/share/aclocal/atf-c.m4 OLD_FILES+=usr/share/aclocal/atf-common.m4 OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal +OLD_DIRS+=usr/tests/bin/chown +OLD_FILES+=usr/tests/bin/chown/Kyuafile +OLD_FILES+=usr/tests/bin/chown/chown-f_test OLD_FILES+=usr/tests/bin/date/legacy_test OLD_FILES+=usr/tests/bin/sh/legacy_test OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test Modified: stable/10/usr.sbin/chown/Makefile ============================================================================== --- stable/10/usr.sbin/chown/Makefile Tue Jul 18 16:03:39 2017 (r321129) +++ stable/10/usr.sbin/chown/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= chown LINKS= ${BINDIR}/chown /usr/bin/chgrp MAN= chgrp.1 chown.8 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/usr.sbin/chown/tests/Makefile ============================================================================== --- head/usr.sbin/chown/tests/Makefile Mon Jun 30 05:33:52 2014 (r268030) +++ stable/10/usr.sbin/chown/tests/Makefile Tue Jul 18 16:27:10 2017 (r321130) @@ -1,9 +1,5 @@ # $FreeBSD$ -.include - -TESTSDIR= ${TESTSBASE}/bin/chown - -TAP_TESTS_SH= chown-f_test +ATF_TESTS_SH+= chown_test .include Copied: stable/10/usr.sbin/chown/tests/chown_test.sh (from r319830, head/usr.sbin/chown/tests/chown_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/chown/tests/chown_test.sh Tue Jul 18 16:27:10 2017 (r321130, copy of r319830, head/usr.sbin/chown/tests/chown_test.sh) @@ -0,0 +1,206 @@ +# +# Copyright (c) 2017 Dell EMC +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. +# +# $FreeBSD$ + +atf_test_case RH_flag +RH_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -H " \ + "is specified" + atf_set "require.user" "root" +} +RH_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RH 126:126 A/C + atf_check -o inline:'84:84\n126:126\n84:84\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RL_flag +RL_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R doesn't " \ + "affect symlinks specified via the arguments when -L " \ + "is specified" + atf_set "require.user" "root" +} +RL_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 84:84 A + atf_check -o inline:'84:84\n84:84\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RL 126:126 A/C + atf_check -o inline:'84:84\n126:126\n42:42\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case RP_flag +RP_flag_head() +{ + atf_set "descr" "Verify that setting ownership recursively via -R " \ + "doesn't affect symlinks specified via the arguments " \ + "when -P is specified" + atf_set "require.user" "root" +} +RP_flag_body() +{ + atf_check mkdir -p A/B + atf_check ln -s B A/C + atf_check chown -h 42:42 A/C + atf_check -o inline:'0:0\n0:0\n42:42\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 84:84 A + atf_check -o inline:'84:84\n84:84\n84:84\n' stat -f '%u:%g' A A/B A/C + atf_check chown -RP 126:126 A/C + atf_check -o inline:'84:84\n84:84\n126:126\n' stat -f '%u:%g' A A/B A/C +} + +atf_test_case f_flag cleanup +f_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +f_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo bar + atf_check chflags uchg foo + atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check -s exit:0 chown -f 84:84 foo bar + atf_check -o inline:'0:0\n84:84\n' stat -f '%u:%g' foo bar +} + +f_flag_cleanup() +{ + atf_check chflags 0 foo +} + +atf_test_case h_flag +h_flag_head() +{ + atf_set "descr" "Verify that setting a mode for a file with -f " \ + "doesn't emit an error message/exit with a non-zero " \ + "code" + atf_set "require.user" "root" +} + +h_flag_body() +{ + atf_check truncate -s 0 foo + atf_check -o inline:'0:0\n' stat -f '%u:%g' foo + atf_check ln -s foo bar + atf_check -o inline:'0:0\n0:0\n' stat -f '%u:%g' foo bar + atf_check chown -h 42:42 bar + atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar + atf_check chown 84:84 bar + atf_check -o inline:'84:84\n42:42\n' stat -f '%u:%g' foo bar +} + +atf_test_case v_flag +v_flag_head() +{ + atf_set "descr" "Verify that setting ownership with -v emits the " \ + "file doesn't emit an error message/exit with a " \ + "non-zero code" + atf_set "require.user" "root" +} +v_flag_body() +{ + atf_check truncate -s 0 foo bar + atf_check chown 0:0 foo + atf_check chown 42:42 bar + atf_check -o 'inline:bar\n' chown -v 0:0 foo bar + atf_check chown -v 0:0 foo bar + for f in foo bar; do + echo "$f: 0:0 -> 84:84"; + done > output.txt + atf_check -o file:output.txt chown -vv 84:84 foo bar + atf_check chown -vv 84:84 foo bar +} + +md_file="md.out" +atf_test_case x_flag cleanup +x_flag_head() +{ + atf_set "descr" "Verify that setting a mode with -x doesn't set " \ + "ownership across mountpoints" + atf_set "require.user" "root" +} +x_flag_body() +{ + atf_check -o save:$md_file mdconfig -a -t malloc -s 20m + if ! md_device=$(cat $md_file); then + atf_fail "cat $md_file failed" + fi + atf_check -o not-empty newfs /dev/$md_device + atf_check mkdir mnt + atf_check mount /dev/$md_device mnt + atf_check truncate -s 0 foo bar mnt/bazbaz + atf_check ln -s bar mnt/barbaz + atf_check ln -s ../foo mnt/foobaz + cd mnt + test_files="../foo ../bar barbaz bazbaz foobaz" + atf_check -o inline:'0:0\n0:0\n0:0\n0:0\n0:0\n' \ + stat -f '%u:%g' $test_files + atf_check chown -Rx 42:42 . + atf_check -o inline:'0:0\n0:0\n42:42\n42:42\n42:42\n' \ + stat -f '%u:%g' $test_files + atf_check chown -R 84:84 . + atf_check -o inline:'0:0\n0:0\n84:84\n84:84\n84:84\n' \ + stat -f '%u:%g' $test_files +} +x_flag_cleanup() +{ + if ! md_device=$(cat $md_file) || [ -z "$md_device" ]; then + echo "Couldn't get device from $md_file" + exit 0 + fi + umount mnt + mdconfig -d -u $md_device +} + +atf_init_test_cases() +{ + atf_add_test_case RH_flag + atf_add_test_case RL_flag + atf_add_test_case RP_flag + atf_add_test_case f_flag + atf_add_test_case h_flag + atf_add_test_case v_flag + atf_add_test_case x_flag +} From owner-svn-src-stable-10@freebsd.org Tue Jul 18 16:49:25 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA48AD99B01; Tue, 18 Jul 2017 16:49:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B86C674A32; Tue, 18 Jul 2017 16:49:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IGnOf4036794; Tue, 18 Jul 2017 16:49:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGnONS036792; Tue, 18 Jul 2017 16:49:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181649.v6IGnONS036792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321133 - in stable/10: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.bin/du usr.bin/du/tests X-SVN-Commit-Revision: 321133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 16:49:26 -0000 Author: ngie Date: Tue Jul 18 16:49:24 2017 New Revision: 321133 URL: https://svnweb.freebsd.org/changeset/base/321133 Log: MFC r319850: Add some initial basic tests for du(1) Tests that exercise the following flags are added in this commit: - -A - -H - -I - -g - -h - -k - -m Additional tests will be added soon. Added: stable/10/usr.bin/du/tests/ - copied from r319850, head/usr.bin/du/tests/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/usr.bin/du/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:48:36 2017 (r321132) +++ stable/10/etc/mtree/BSD.tests.dist Tue Jul 18 16:49:24 2017 (r321133) @@ -594,6 +594,8 @@ .. dirname .. + du + .. file2c .. getconf Modified: stable/10/usr.bin/du/Makefile ============================================================================== --- stable/10/usr.bin/du/Makefile Tue Jul 18 16:48:36 2017 (r321132) +++ stable/10/usr.bin/du/Makefile Tue Jul 18 16:49:24 2017 (r321133) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= du DPADD= ${LIBUTIL} LDADD= -lutil + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include From owner-svn-src-stable-10@freebsd.org Tue Jul 18 16:58:53 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1B74D99FCC; Tue, 18 Jul 2017 16:58:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDDFB7509E; Tue, 18 Jul 2017 16:58:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IGwqdD041089; Tue, 18 Jul 2017 16:58:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IGwqoh041085; Tue, 18 Jul 2017 16:58:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181658.v6IGwqoh041085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 16:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321134 - in stable/10/sys: netinet netinet6 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/sys: netinet netinet6 X-SVN-Commit-Revision: 321134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 16:58:54 -0000 Author: ngie Date: Tue Jul 18 16:58:52 2017 New Revision: 321134 URL: https://svnweb.freebsd.org/changeset/base/321134 Log: MFC r318255: Add missing braces around MCAST_EXCLUDE check when KTR support is compiled into the kernel This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly decremented for MLD-layer source datagrams when inspecting im*s_st[1] (the second state in the structure). PR: 217509 [1] Modified: stable/10/sys/netinet/in_mcast.c stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/in_mcast.c ============================================================================== --- stable/10/sys/netinet/in_mcast.c Tue Jul 18 16:49:24 2017 (r321133) +++ stable/10/sys/netinet/in_mcast.c Tue Jul 18 16:58:52 2017 (r321134) @@ -1014,9 +1014,10 @@ inm_merge(struct in_multi *inm, /*const*/ struct in_mf /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->imf_st[1] != MCAST_EXCLUDE) || - (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__); --inm->inm_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Tue Jul 18 16:49:24 2017 (r321133) +++ stable/10/sys/netinet6/in6_mcast.c Tue Jul 18 16:58:52 2017 (r321134) @@ -1000,9 +1000,10 @@ in6m_merge(struct in6_multi *inm, /*const*/ struct in6 /* Decrement ASM listener count on transition out of ASM mode. */ if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) { if ((imf->im6f_st[1] != MCAST_EXCLUDE) || - (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) + (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) { CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__); --inm->in6m_st[1].iss_asm; + } } /* Increment ASM listener count on transition to ASM mode. */ From owner-svn-src-stable-10@freebsd.org Tue Jul 18 17:16:59 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDEDAD9A6AD; Tue, 18 Jul 2017 17:16:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95AA675B9E; Tue, 18 Jul 2017 17:16:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IHGwaw049555; Tue, 18 Jul 2017 17:16:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHGwvx049553; Tue, 18 Jul 2017 17:16:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181716.v6IHGwvx049553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321137 - stable/10/tools/regression/geom_gpt X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/tools/regression/geom_gpt X-SVN-Commit-Revision: 321137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 17:16:59 -0000 Author: ngie Date: Tue Jul 18 17:16:58 2017 New Revision: 321137 URL: https://svnweb.freebsd.org/changeset/base/321137 Log: MFC r319800,r319806: r319800: Don't explicitly get the class to PART in gctl_test_helper.c This will allow the tool to be used with arbitrary geom(4) classes, like GEOM. Specify class=PART explicitly in the tester to keep existing behavior. r319806: Improve handling with system state - Always unlink $cmd after exit via END block. - The tests don't function well if kern.geom.debugflags != 0. Save debugflags, then restore them at the end of the test. Modified: stable/10/tools/regression/geom_gpt/gctl_test.t stable/10/tools/regression/geom_gpt/gctl_test_helper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- stable/10/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 17:16:55 2017 (r321136) +++ stable/10/tools/regression/geom_gpt/gctl_test.t Tue Jul 18 17:16:58 2017 (r321137) @@ -35,48 +35,48 @@ my $disk = "/tmp/disk-$$"; my $mntpt_prefix = "/tmp/mount-$$"; my %steps = ( - "000" => "gctl", - "001" => "gctl verb=bogus", - "010" => "gctl verb=create", - "011" => "gctl verb=create provider=bogus", + "000" => "gctl class=PART", + "001" => "gctl class=PART verb=bogus", + "010" => "gctl class=PART verb=create", + "011" => "gctl class=PART verb=create provider=bogus", "020" => "mdcfg create pristine", - "021" => "gctl verb=create provider=%dev% entries=-1", - "022" => "gctl verb=create provider=%dev% entries=128", - "023" => "gctl verb=create provider=%dev%", - "024" => "gctl verb=modify geom=%dev%", + "021" => "gctl class=PART verb=create provider=%dev% entries=-1", + "022" => "gctl class=PART verb=create provider=%dev% entries=128", + "023" => "gctl class=PART verb=create provider=%dev%", + "024" => "gctl class=PART verb=modify geom=%dev%", "025" => "conf", - "030" => "gctl verb=add", - "031" => "gctl verb=add geom=bogus", - "032" => "gctl verb=add geom=%dev%", - "033" => "gctl verb=add geom=%dev% type=bogus", - "034" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", - "035" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", - "036" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", - "037" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", - "038" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", - "039" => "gctl verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", - "040" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", - "041" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", - "042" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", - "043" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", - "044" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", - "045" => "gctl verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", - "046" => "gctl verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", + "030" => "gctl class=PART verb=add", + "031" => "gctl class=PART verb=add geom=bogus", + "032" => "gctl class=PART verb=add geom=%dev%", + "033" => "gctl class=PART verb=add geom=%dev% type=bogus", + "034" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace", + "035" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=1", + "036" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34", + "037" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=34 end=12345678", + "038" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry=129", + "039" => "gctl class=PART verb=add geom=%dev% type=ed0101b0-2a71-11da-ba81-003048416ace start=162 end=417 entry:8=5", + "040" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry=5", + "041" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=546", + "042" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=162 end=417", + "043" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=100 end=300", + "044" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=300 end=500", + "045" => "gctl class=PART verb=add geom=%dev% type=83d34ed5-c4ff-11da-b65b-000347c5d7f3 start=34 end=161 entry:8", + "046" => "gctl class=PART verb=add geom=%dev% type=d2bd4509-c4ff-11da-b4cc-00306e39b62f start=418 end=546 entry:8", "047" => "conf", - "050" => "gctl verb=remove geom=%dev% entry=5", - "051" => "gctl verb=remove geom=%dev% entry=2", - "052" => "gctl verb=remove geom=%dev% entry=1", - "053" => "gctl verb=remove geom=%dev% entry=1", + "050" => "gctl class=PART verb=remove geom=%dev% entry=5", + "051" => "gctl class=PART verb=remove geom=%dev% entry=2", + "052" => "gctl class=PART verb=remove geom=%dev% entry=1", + "053" => "gctl class=PART verb=remove geom=%dev% entry=1", "054" => "conf", - "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", + "060" => "gctl class=PART verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", "061" => "mount %dev%p1", - "062" => "gctl verb=delete geom=%dev% entry=1", + "062" => "gctl class=PART verb=delete geom=%dev% entry=1", "063" => "umount %dev%p1", - "064" => "gctl verb=delete geom=%dev% entry=1", + "064" => "gctl class=PART verb=delete geom=%dev% entry=1", "065" => "conf", "100" => "mdcfg destroy", "110" => "mdcfg create corrupted", - "111" => "gctl verb=add geom=%dev%", + "111" => "gctl class=PART verb=add geom=%dev%", "120" => "mdcfg destroy", ); @@ -144,10 +144,20 @@ my $out = basename($cmd) . ".out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { print "1..0 # SKIP insufficient permissions\n"; - unlink $cmd; exit 0; } +my $debugflags_oid = 'kern.geom.debugflags'; +chomp(my $old_geom_debugflags = `sysctl -n $debugflags_oid`); +if ($? != 0) { + print "1..0 # SKIP could not query $debugflags_oid\n"; + exit 0; +} +if (system("sysctl $debugflags_oid=0") != 0) { + print "1..0 # SKIP could not set $debugflags_oid=0\n"; + exit 0; +} + my $count = keys (%steps); print "1..$count\n"; @@ -227,4 +237,7 @@ foreach my $key (sort keys %steps) { } $nr += 1; } -exit 0; +END { + system("sysctl $debugflags_oid=$old_geom_debugflags"); + unlink($cmd); +} Modified: stable/10/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 17:16:55 2017 (r321136) +++ stable/10/tools/regression/geom_gpt/gctl_test_helper.c Tue Jul 18 17:16:58 2017 (r321137) @@ -117,7 +117,6 @@ main(int argc, char *argv[]) req = gctl_get_handle(); assert(req != NULL); - gctl_ro_param(req, "class", -1, "PART"); while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { From owner-svn-src-stable-10@freebsd.org Tue Jul 18 17:36:26 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE30CD9AED7; Tue, 18 Jul 2017 17:36:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C87F47697B; Tue, 18 Jul 2017 17:36:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IHaP2U058214; Tue, 18 Jul 2017 17:36:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHaPGQ058210; Tue, 18 Jul 2017 17:36:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181736.v6IHaPGQ058210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321140 - in stable/10/bin/dd: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/bin/dd: . tests X-SVN-Commit-Revision: 321140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 17:36:27 -0000 Author: ngie Date: Tue Jul 18 17:36:25 2017 New Revision: 321140 URL: https://svnweb.freebsd.org/changeset/base/321140 Log: MFC r302500,r319339,r319543,r319544,r319551,r321138: r302500 (by cem): dd(1): Enable access to SIZE_T_MAX character devices On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking character devices to negative off_t values. This enables dd(1) to interact with kernel KVA in /dev/kmem on amd64, for example. r319339 (by asomers): Fix integer overflow detection in dd dd(1) tried to detect whether the seek offset would overflow, but it failed to account for the case where the provided argument was negative and the file was a regular file (negative seeks are allowed for character devices). I fixed it, and added a regression test. CID: 1368659 r319543: Stylistic tweaks Move opening braces of functions from the last column to column 0. MFC with: r319339 r319544: Mark :seek_overflow as an expected failure MFC with: r319339 PR: 219757 r319551 (by asomers): Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large. PR: 219757 r321138: Remove unnecessary make logic added in r319339 This makes the change cleaner and easier to backport to ^/stable/10. Added: stable/10/bin/dd/tests/dd2_test.sh - copied, changed from r319339, head/bin/dd/tests/dd2_test.sh Modified: stable/10/bin/dd/args.c stable/10/bin/dd/position.c stable/10/bin/dd/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/dd/args.c ============================================================================== --- stable/10/bin/dd/args.c Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/args.c Tue Jul 18 17:36:25 2017 (r321140) @@ -165,14 +165,6 @@ jcl(char **argv) errx(1, "cbs meaningless if not doing record operations"); } else cfunc = def; - - /* - * Bail out if the calculation of a file offset would overflow. - */ - if (in.offset > OFF_MAX / (ssize_t)in.dbsz || - out.offset > OFF_MAX / (ssize_t)out.dbsz) - errx(1, "seek offsets cannot be larger than %jd", - (intmax_t)OFF_MAX); } static int Modified: stable/10/bin/dd/position.c ============================================================================== --- stable/10/bin/dd/position.c Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/position.c Tue Jul 18 17:36:25 2017 (r321140) @@ -45,12 +45,41 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "dd.h" #include "extern.h" +static off_t +seek_offset(IO *io) +{ + off_t n; + size_t sz; + + n = io->offset; + sz = io->dbsz; + + _Static_assert(sizeof(io->offset) == sizeof(int64_t), "64-bit off_t"); + + /* + * If the lseek offset will be negative, verify that this is a special + * device file. Some such files (e.g. /dev/kmem) permit "negative" + * offsets. + * + * Bail out if the calculation of a file offset would overflow. + */ + if ((io->flags & ISCHR) == 0 && (n < 0 || n > OFF_MAX / (ssize_t)sz)) + errx(1, "seek offsets cannot be larger than %jd", + (intmax_t)OFF_MAX); + else if ((io->flags & ISCHR) != 0 && (uint64_t)n > UINT64_MAX / sz) + errx(1, "seek offsets cannot be larger than %ju", + (uintmax_t)UINT64_MAX); + + return ((off_t)( (uint64_t)n * sz )); +} + /* * Position input/output data streams before starting the copy. Device type * dependent. Seekable devices use lseek, and the rest position by reading. @@ -68,7 +97,7 @@ pos_in(void) /* If known to be seekable, try to seek on it. */ if (in.flags & ISSEEK) { errno = 0; - if (lseek(in.fd, in.offset * in.dbsz, SEEK_CUR) == -1 && + if (lseek(in.fd, seek_offset(&in), SEEK_CUR) == -1 && errno != 0) err(1, "%s", in.name); return; @@ -136,7 +165,7 @@ pos_out(void) */ if (out.flags & (ISSEEK | ISPIPE)) { errno = 0; - if (lseek(out.fd, out.offset * out.dbsz, SEEK_CUR) == -1 && + if (lseek(out.fd, seek_offset(&out), SEEK_CUR) == -1 && errno != 0) err(1, "%s", out.name); return; Modified: stable/10/bin/dd/tests/Makefile ============================================================================== --- stable/10/bin/dd/tests/Makefile Tue Jul 18 17:35:29 2017 (r321139) +++ stable/10/bin/dd/tests/Makefile Tue Jul 18 17:36:25 2017 (r321140) @@ -1,10 +1,6 @@ # $FreeBSD$ -OBJTOP= ${.OBJDIR:H:H:H} -SRCTOP= ${.CURDIR:H:H:H} -TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/dd -TESTSDIR= ${TESTSBASE}/bin/dd - +ATF_TESTS_SH= dd2_test NETBSD_ATF_TESTS_SH= dd_test .include Copied and modified: stable/10/bin/dd/tests/dd2_test.sh (from r319339, head/bin/dd/tests/dd2_test.sh) ============================================================================== --- head/bin/dd/tests/dd2_test.sh Wed May 31 16:07:32 2017 (r319339, copy source) +++ stable/10/bin/dd/tests/dd2_test.sh Tue Jul 18 17:36:25 2017 (r321140) @@ -26,17 +26,35 @@ # $FreeBSD$ -atf_test_case seek_overflow -seek_overflow_head() { - atf_set "descr" "dd(1) should reject too-large seek values" +atf_test_case max_seek +max_seek_head() +{ + atf_set "descr" "dd(1) can seek by the maximum amount" } -seek_overflow_body() { +max_seek_body() +{ + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") + atf_skip "UFS's maximum file size is too small";; + "zfs") ;; # ZFS is fine + "tmpfs") + atf_skip "tmpfs can't create arbitrarily large spare files";; + *) atf_skip "Unknown file system";; + esac + touch f.in - # Positive tests seek=`echo "2^63 / 4096 - 1" | bc` atf_check -s exit:0 -e ignore dd if=f.in of=f.out bs=4096 seek=$seek +} - # Negative tests +atf_test_case seek_overflow +seek_overflow_head() +{ + atf_set "descr" "dd(1) should reject too-large seek values" +} +seek_overflow_body() +{ + touch f.in seek=`echo "2^63 / 4096" | bc` atf_check -s not-exit:0 -e match:"seek offsets cannot be larger than" \ dd if=f.in of=f.out bs=4096 seek=$seek @@ -46,5 +64,6 @@ seek_overflow_body() { atf_init_test_cases() { - atf_add_test_case seek_overflow + atf_add_test_case max_seek + atf_add_test_case seek_overflow } From owner-svn-src-stable-10@freebsd.org Tue Jul 18 17:51:34 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B664D9B624; Tue, 18 Jul 2017 17:51:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 665E8772C1; Tue, 18 Jul 2017 17:51:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IHpXO9064248; Tue, 18 Jul 2017 17:51:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IHpX2X064246; Tue, 18 Jul 2017 17:51:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181751.v6IHpX2X064246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 17:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321141 - in stable/10: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: contrib/atf/atf-c libexec/atf/atf-sh X-SVN-Commit-Revision: 321141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 17:51:34 -0000 Author: ngie Date: Tue Jul 18 17:51:33 2017 New Revision: 321141 URL: https://svnweb.freebsd.org/changeset/base/321141 Log: MFC r316552,r319662: r316552: atf-c: fix documentation description for atf_utils_wait(3) atf_utils_wait(3) should be used in combination with atf_utils_fork(3), not itself (atf_utils_wait(3)). r319662: Add MLINKS for atf-sh(3) to each of the functions it implements This hopefully will make atf-sh(3) easier to understand for newcomers, without having to go through the atf-sh(3) level of indirection. Modified: stable/10/contrib/atf/atf-c/atf-c.3 stable/10/libexec/atf/atf-sh/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-c/atf-c.3 ============================================================================== --- stable/10/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:36:25 2017 (r321140) +++ stable/10/contrib/atf/atf-c/atf-c.3 Tue Jul 18 17:51:33 2017 (r321141) @@ -22,7 +22,7 @@ .\" 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. -.Dd March 6, 2017 +.Dd April 5, 2017 .Dt ATF-C 3 .Os .Sh NAME @@ -680,7 +680,7 @@ those spawned by .Fc .Bd -ragged -offset indent Waits and validates the result of a subprocess spawned with -.Fn atf_utils_wait . +.Fn atf_utils_fork . The validation involves checking that the subprocess exited cleanly and returned the code specified in .Fa expected_exit_status Modified: stable/10/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/10/libexec/atf/atf-sh/Makefile Tue Jul 18 17:36:25 2017 (r321140) +++ stable/10/libexec/atf/atf-sh/Makefile Tue Jul 18 17:51:33 2017 (r321141) @@ -33,7 +33,29 @@ ATF= ${SRCTOP}/contrib/atf PROG_CXX= atf-sh SRCS= atf-sh.cpp MAN= atf-sh.1 atf-sh.3 -MLINKS+= atf-sh.3 atf-sh-api.3 # Backwards compatibility. +# Backwards compatibility. +MLINKS+= atf-sh.3 atf-sh-api.3 + +MLINKS+= \ + atf-sh.3 atf_add_test_case.3 \ + atf-sh.3 atf_check.3 \ + atf-sh.3 atf_check_equal.3 \ + atf-sh.3 atf_config_get.3 \ + atf-sh.3 atf_config_has.3 \ + atf-sh.3 atf_expect_death.3 \ + atf-sh.3 atf_expect_exit.3 \ + atf-sh.3 atf_expect_fail.3 \ + atf-sh.3 atf_expect_pass.3 \ + atf-sh.3 atf_expect_signal.3 \ + atf-sh.3 atf_expect_timeout.3 \ + atf-sh.3 atf_fail.3 \ + atf-sh.3 atf_get.3 \ + atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_pass.3 \ + atf-sh.3 atf_require_prog.3 \ + atf-sh.3 atf_set.3 \ + atf-sh.3 atf_skip.3 \ + atf-sh.3 atf_test_case.3 CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -DATF_LIBEXECDIR='"${LIBEXECDIR}"' From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:09:27 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB6E2D9C028; Tue, 18 Jul 2017 18:09:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA887CDDE; Tue, 18 Jul 2017 18:09:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6II9QT3073254; Tue, 18 Jul 2017 18:09:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6II9Q5e073251; Tue, 18 Jul 2017 18:09:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181809.v6II9Q5e073251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321144 - stable/10/lib/libc/tests/nss X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/tests/nss X-SVN-Commit-Revision: 321144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:09:27 -0000 Author: ngie Date: Tue Jul 18 18:09:26 2017 New Revision: 321144 URL: https://svnweb.freebsd.org/changeset/base/321144 Log: MFC r319048,r319049,r319051,r319054: r319048: Push `snapshot_file` copying down into run_tests function, and mark snapshot_file const char *. This fixes a bogus set of errors from gcc about strdup not being allowed a NULL argument. r319049: Bump WARNS from 1 to 3 after recent commits to fix warnings in the directory. Tested with: clang 4.0, gcc 4.2.1, gcc 6.3.0 r319051: hostent_test_getnameinfo_eq(..): initialize found_a_host to false CID: 1368943 r319054: hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done This plugs a leak of memory allocated via getaddrinfo. CID: 1346866 Modified: stable/10/lib/libc/tests/nss/Makefile stable/10/lib/libc/tests/nss/getaddrinfo_test.c stable/10/lib/libc/tests/nss/gethostby_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/nss/Makefile ============================================================================== --- stable/10/lib/libc/tests/nss/Makefile Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/Makefile Tue Jul 18 18:09:26 2017 (r321144) @@ -18,7 +18,7 @@ ATF_TESTS_C+= getusershell_test FILES+= mach -WARNS?= 1 +WARNS?= 3 CFLAGS+= -I${SRCTOP}/tests Modified: stable/10/lib/libc/tests/nss/getaddrinfo_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/getaddrinfo_test.c Tue Jul 18 18:09:26 2017 (r321144) @@ -410,11 +410,19 @@ addrinfo_read_hostlist_func(struct addrinfo *ai, char } static void -run_tests(char *hostlist_file, char *snapshot_file, int ai_family) +run_tests(char *hostlist_file, const char *snapshot_file, int ai_family) { struct addrinfo_test_data td, td_snap; + char *snapshot_file_copy; int rv; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = ai_family; hints.ai_flags = AI_CANONNAME; @@ -477,24 +485,17 @@ fin: TEST_DATA_DESTROY(addrinfo, &td_snap); TEST_DATA_DESTROY(addrinfo, &td); - free(hostlist_file); - free(snapshot_file); + free(snapshot_file_copy); } #define HOSTLIST_FILE "mach" #define RUN_TESTS(tc, snapshot_file, ai_family) do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - run_tests(_hostlist_file, _snapshot_file, ai_family); \ -} while(0) + run_tests(_hostlist_file, snapshot_file, ai_family); \ + free(_hostlist_file); \ +} while (0) ATF_TC_WITHOUT_HEAD(pf_unspec); ATF_TC_BODY(pf_unspec, tc) Modified: stable/10/lib/libc/tests/nss/gethostby_test.c ============================================================================== --- stable/10/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 18:09:16 2017 (r321143) +++ stable/10/lib/libc/tests/nss/gethostby_test.c Tue Jul 18 18:09:26 2017 (r321144) @@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void * rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv == 0) { printf("not ok - shouldn't have been resolved\n"); - return (-1); - } + rv = -1; + } else + rv = 0; } else { rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv != 0) { printf("not ok - should have been resolved\n"); - return (-1); + rv = -1; + goto done; } - rv = is_hostent_equal(he, ai); if (rv != 0) { printf("not ok - addrinfo and hostent are not equal\n"); - return (-1); + rv = -1; } - } - - return (0); +done: + if (ai != NULL) + freeaddrinfo(ai); + return (rv); } static int @@ -884,7 +886,7 @@ hostent_test_getnameinfo_eq(struct hostent *he, void * * An address might reverse resolve to hostname alias or the * official hostname, e.g. moon.vub.ac.be. */ - bool found_a_match; + bool found_a_match = false; if (strcmp(result->h_name, buffer) == 0) { found_a_match = true; @@ -924,10 +926,19 @@ static int run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type, enum test_methods method, bool use_ipv6_mapping) { + char *snapshot_file_copy; struct hostent_test_data td, td_addr, td_snap; res_state statp; int rv = -2; + if (snapshot_file == NULL) + snapshot_file_copy = NULL; + else { + snapshot_file_copy = strdup(snapshot_file); + ATF_REQUIRE(snapshot_file_copy != NULL); + } + snapshot_file = snapshot_file_copy; + switch (_af_type) { case AF_INET: ATF_REQUIRE_FEATURE("inet"); @@ -946,8 +957,8 @@ run_tests(const char *hostlist_file, const char *snaps if (statp == NULL || ((statp->options & RES_INIT) == 0 && res_ninit(statp) == -1)) { printf("error: can't init res_state\n"); - - return (-1); + rv = -1; + goto fin2; } if (use_ipv6_mapping) @@ -1051,6 +1062,9 @@ fin: TEST_DATA_DESTROY(hostent, &td_addr); TEST_DATA_DESTROY(hostent, &td); +fin2: + free(snapshot_file_copy); + return (rv); } @@ -1059,30 +1073,24 @@ fin: #define _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ char *_hostlist_file; \ - char *_snapshot_file; \ ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s", \ atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE)); \ - if (snapshot_file == NULL) \ - _snapshot_file = NULL; \ - else { \ - _snapshot_file = strdup(snapshot_file); \ - ATF_REQUIRE(_snapshot_file != NULL); \ - } \ - ATF_REQUIRE(run_tests(_hostlist_file, _snapshot_file, af_type, \ + ATF_REQUIRE(run_tests(_hostlist_file, snapshot_file, af_type, \ method, use_ipv6_mapping) == 0); \ -} while(0) + free(_hostlist_file); \ +} while (0) #define RUN_HOST_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = false; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) #define RUN_IPNODE_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping) \ do { \ use_ipnode_functions = true; \ _RUN_TESTS(tc, snapshot_file, af_type, method, use_ipv6_mapping); \ -} while(0) +} while (0) ATF_TC_WITHOUT_HEAD(gethostbyaddr_ipv4); ATF_TC_BODY(gethostbyaddr_ipv4, tc) From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:15:47 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C3B1D9C2D3; Tue, 18 Jul 2017 18:15:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A0B7D3B8; Tue, 18 Jul 2017 18:15:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIFkWA077784; Tue, 18 Jul 2017 18:15:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIFjjo077780; Tue, 18 Jul 2017 18:15:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181815.v6IIFjjo077780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321146 - stable/10/lib/libc/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/sys X-SVN-Commit-Revision: 321146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:15:47 -0000 Author: ngie Date: Tue Jul 18 18:15:45 2017 New Revision: 321146 URL: https://svnweb.freebsd.org/changeset/base/321146 Log: MFC r318718,r318719,r318720,r318721: r318718: rctl_add_rule(2): fix manlint warnings - Fix commas (either missing or misused) after .Nm entries in SYNOPSIS r318719: open(2): fix manlint warnings - Sort SEE ALSO .Xr entries. - Sort sections (HISTORY comes after STANDARDS). r318720: ptrace(2): clean up trailing whitespace r318721: kill(2): add missing section for sysctl(9) Modified: stable/10/lib/libc/sys/kill.2 stable/10/lib/libc/sys/open.2 stable/10/lib/libc/sys/ptrace.2 stable/10/lib/libc/sys/rctl_add_rule.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kill.2 ============================================================================== --- stable/10/lib/libc/sys/kill.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/kill.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -71,7 +71,7 @@ A single exception is the signal SIGCONT, which may al to any process with the same session ID as the sender. In addition, if the .Va security.bsd.conservative_signals -.Xr sysctl +.Xr sysctl 9 is set to 1, the user is not a super-user, and the receiver is set-uid, then only job control and terminal control signals may Modified: stable/10/lib/libc/sys/open.2 ============================================================================== --- stable/10/lib/libc/sys/open.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/open.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -461,16 +461,8 @@ is specified and the file is not a directory. .Xr read 2 , .Xr umask 2 , .Xr write 2 , -.Xr fopen 3 -.Sh HISTORY -The -.Fn open -function appeared in -.At v6 . -The -.Fn openat -function was introduced in -.Fx 8.0 . +.Xr fopen 3 , +.Xr capsicum 4 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -487,6 +479,15 @@ when is set in flags and the final component of pathname is a symbolic link to distinguish it from the case of too many symbolic link traversals in one of its non-final components. +.Sh HISTORY +The +.Fn open +function appeared in +.At v6 . +The +.Fn openat +function was introduced in +.Fx 8.0 . .Sh BUGS The Open Group Extended API Set 2 specification requires that the test for whether Modified: stable/10/lib/libc/sys/ptrace.2 ============================================================================== --- stable/10/lib/libc/sys/ptrace.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/ptrace.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -166,7 +166,7 @@ new child processes will execute without tracing enabl This event flag controls tracing of LWP .Pq kernel thread creation and destruction. -When this event is enabled, +When this event is enabled, new LWPs will stop and report an event with .Dv PL_FLAG_BORN set before executing their first instruction, @@ -215,7 +215,7 @@ or includes only .Dv PTRACE_EXEC events. -All other event flags are disabled. +All other event flags are disabled. .Pp The .Fa request Modified: stable/10/lib/libc/sys/rctl_add_rule.2 ============================================================================== --- stable/10/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:15:28 2017 (r321145) +++ stable/10/lib/libc/sys/rctl_add_rule.2 Tue Jul 18 18:15:45 2017 (r321146) @@ -28,10 +28,10 @@ .Dt RCTL_ADD_RULE 2 .Os .Sh NAME -.Nm rctl_add_rule, -.Nm rctl_get_limits -.Nm rctl_get_racct, -.Nm rctl_get_rules, +.Nm rctl_add_rule , +.Nm rctl_get_limits , +.Nm rctl_get_racct , +.Nm rctl_get_rules , .Nm rctl_remove_rule .Nd manipulate and query the resource limits database .Sh LIBRARY From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:21:01 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6996D9C3E1; Tue, 18 Jul 2017 18:21:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B12A07D5DF; Tue, 18 Jul 2017 18:21:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIL0Y3080315; Tue, 18 Jul 2017 18:21:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIL0iG080314; Tue, 18 Jul 2017 18:21:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181821.v6IIL0iG080314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321148 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/stdlib X-SVN-Commit-Revision: 321148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:21:02 -0000 Author: ngie Date: Tue Jul 18 18:21:00 2017 New Revision: 321148 URL: https://svnweb.freebsd.org/changeset/base/321148 Log: MFC r318710: quick_exit(3): delete trailing whitespace in licensing tort Modified: stable/10/lib/libc/stdlib/quick_exit.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/quick_exit.3 ============================================================================== --- stable/10/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:20:56 2017 (r321147) +++ stable/10/lib/libc/stdlib/quick_exit.3 Tue Jul 18 18:21:00 2017 (r321148) @@ -1,6 +1,6 @@ .\" Copyright (c) 2011 David Chisnall .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -9,7 +9,7 @@ .\" 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 AUTHOR 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 @@ -21,7 +21,7 @@ .\" 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. -.\" +.\" .\" $FreeBSD$ .\" .Dd December 13, 2014 From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:23:55 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A09ED9C648; Tue, 18 Jul 2017 18:23:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40D8C7DA53; Tue, 18 Jul 2017 18:23:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IINsxw081943; Tue, 18 Jul 2017 18:23:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IINsFw081939; Tue, 18 Jul 2017 18:23:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181823.v6IINsFw081939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321149 - stable/10/lib/libc/posix1e X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/posix1e X-SVN-Commit-Revision: 321149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:23:55 -0000 Author: ngie Date: Tue Jul 18 18:23:54 2017 New Revision: 321149 URL: https://svnweb.freebsd.org/changeset/base/321149 Log: MFC r318704,r318708,r318709: r318704: posix1e(3): reference using the section (3) when referencing libbsm with .Xr r318708: acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS r318709: acl_to_text(3): start sentences on new lines Modified: stable/10/lib/libc/posix1e/acl_create_entry.3 stable/10/lib/libc/posix1e/acl_to_text.3 stable/10/lib/libc/posix1e/posix1e.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/posix1e/acl_create_entry.3 ============================================================================== --- stable/10/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/acl_create_entry.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -29,7 +29,7 @@ .Dt ACL_CREATE_ENTRY 3 .Os .Sh NAME -.Nm acl_create_entry +.Nm acl_create_entry , .Nm acl_create_entry_np .Nd create a new ACL entry .Sh LIBRARY Modified: stable/10/lib/libc/posix1e/acl_to_text.3 ============================================================================== --- stable/10/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/acl_to_text.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -58,8 +58,9 @@ including the NULL terminator) in the location pointed .Va len_p . If the ACL is POSIX.1e, the format of the text string returned by .Fn acl_to_text -shall be the POSIX.1e long ACL form. If the ACL is NFSv4, the format -of the text string shall be the compact form, unless the +shall be the POSIX.1e long ACL form. +If the ACL is NFSv4, the format of the text string shall be the compact form, unless +the .Va ACL_TEXT_VERBOSE flag is given. .Pp Modified: stable/10/lib/libc/posix1e/posix1e.3 ============================================================================== --- stable/10/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:21:00 2017 (r321148) +++ stable/10/lib/libc/posix1e/posix1e.3 Tue Jul 18 18:23:54 2017 (r321149) @@ -63,7 +63,7 @@ flow label APIs. However, .Fx does implement the -.Xr libbsm +.Xr libbsm 3 audit API. It also provides .Xr capsicum 4 , From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:33:06 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5FDD9CA0E; Tue, 18 Jul 2017 18:33:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3157DF80; Tue, 18 Jul 2017 18:33:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIX5r8085898; Tue, 18 Jul 2017 18:33:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIX59D085897; Tue, 18 Jul 2017 18:33:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181833.v6IIX59D085897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321151 - stable/10/usr.bin/getconf X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/getconf X-SVN-Commit-Revision: 321151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:33:06 -0000 Author: ngie Date: Tue Jul 18 18:33:05 2017 New Revision: 321151 URL: https://svnweb.freebsd.org/changeset/base/321151 Log: MFC r318280: getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro Modified: stable/10/usr.bin/getconf/fake-gperf.awk Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/getconf/fake-gperf.awk ============================================================================== --- stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:23:56 2017 (r321150) +++ stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:05 2017 (r321151) @@ -36,7 +36,8 @@ state == 1 { print; next; } state = 3; print "\t{ NULL, 0, 0 }"; print "};"; - print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)"; + print "#include "; + print "#define\tNWORDS\t(nitems(wordlist) - 1)"; print "static const struct map *"; print "in_word_set(const char *word)"; print "{"; From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:34:17 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 992B8D9CB3E; Tue, 18 Jul 2017 18:34:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 665907E214; Tue, 18 Jul 2017 18:34:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIYGRt086126; Tue, 18 Jul 2017 18:34:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIYGrH086125; Tue, 18 Jul 2017 18:34:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181834.v6IIYGrH086125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321154 - stable/10/lib/libc/net X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/net X-SVN-Commit-Revision: 321154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:34:17 -0000 Author: ngie Date: Tue Jul 18 18:34:16 2017 New Revision: 321154 URL: https://svnweb.freebsd.org/changeset/base/321154 Log: MFC r318707: sctp_send(3): start sentences on new lines Modified: stable/10/lib/libc/net/sctp_send.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_send.3 ============================================================================== --- stable/10/lib/libc/net/sctp_send.3 Tue Jul 18 18:34:09 2017 (r321153) +++ stable/10/lib/libc/net/sctp_send.3 Tue Jul 18 18:34:16 2017 (r321154) @@ -105,8 +105,8 @@ struct sctp_sndrcvinfo { The .Fa sinfo->sinfo_ppid argument is an opaque 32 bit value that is passed transparently -through the stack to the peer endpoint. It will be available on -reception of a message (see +through the stack to the peer endpoint. +It will be available on reception of a message (see .Xr sctp_recvmsg 3 ) . Note that the stack passes this value without regard to byte order. From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:35:42 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEC9AD9CC05; Tue, 18 Jul 2017 18:35:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABE197E460; Tue, 18 Jul 2017 18:35:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIZfr8086290; Tue, 18 Jul 2017 18:35:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIZfHI086289; Tue, 18 Jul 2017 18:35:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181835.v6IIZfHI086289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321155 - stable/10/lib/libc/iconv X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/iconv X-SVN-Commit-Revision: 321155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:35:43 -0000 Author: ngie Date: Tue Jul 18 18:35:41 2017 New Revision: 321155 URL: https://svnweb.freebsd.org/changeset/base/321155 Log: MFC r318703: __iconv_get_list: separate .Nm entries with commas Modified: stable/10/lib/libc/iconv/__iconv_get_list.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/iconv/__iconv_get_list.3 ============================================================================== --- stable/10/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:34:16 2017 (r321154) +++ stable/10/lib/libc/iconv/__iconv_get_list.3 Tue Jul 18 18:35:41 2017 (r321155) @@ -38,7 +38,7 @@ .Dt __ICONV_GET_LIST 3 .Os .Sh NAME -.Nm __iconv_get_list +.Nm __iconv_get_list , .Nm __iconv_free_list .Nd retrieving a list of character encodings supported by .Xr iconv 3 From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:36:42 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 438E8D9CCFD; Tue, 18 Jul 2017 18:36:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1112A7E6C1; Tue, 18 Jul 2017 18:36:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIafBi086474; Tue, 18 Jul 2017 18:36:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIaftv086473; Tue, 18 Jul 2017 18:36:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181836.v6IIaftv086473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321157 - stable/10/lib/libc/xdr X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/xdr X-SVN-Commit-Revision: 321157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:36:42 -0000 Author: ngie Date: Tue Jul 18 18:36:40 2017 New Revision: 321157 URL: https://svnweb.freebsd.org/changeset/base/321157 Log: MFC r318712: xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS This unbreaks the .Nm declaration Modified: stable/10/lib/libc/xdr/xdr.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/xdr/xdr.3 ============================================================================== --- stable/10/lib/libc/xdr/xdr.3 Tue Jul 18 18:35:46 2017 (r321156) +++ stable/10/lib/libc/xdr/xdr.3 Tue Jul 18 18:36:40 2017 (r321157) @@ -31,7 +31,7 @@ .Nm xdr_reference , .Nm xdr_setpos , .Nm xdr_short , -.Nm xdr_sizeof, +.Nm xdr_sizeof , .Nm xdrstdio_create , .Nm xdr_string , .Nm xdr_u_char , From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:37:58 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A1DD9CE45; Tue, 18 Jul 2017 18:37:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4CC57E95E; Tue, 18 Jul 2017 18:37:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIbuIN086711; Tue, 18 Jul 2017 18:37:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIbuHl086710; Tue, 18 Jul 2017 18:37:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181837.v6IIbuHl086710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321160 - stable/10/lib/libc/locale X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/locale X-SVN-Commit-Revision: 321160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:37:58 -0000 Author: ngie Date: Tue Jul 18 18:37:56 2017 New Revision: 321160 URL: https://svnweb.freebsd.org/changeset/base/321160 Log: MFC r318706: localeconv(3): start sentences on new lines Modified: stable/10/lib/libc/locale/localeconv.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/localeconv.3 ============================================================================== --- stable/10/lib/libc/locale/localeconv.3 Tue Jul 18 18:37:50 2017 (r321159) +++ stable/10/lib/libc/locale/localeconv.3 Tue Jul 18 18:37:56 2017 (r321160) @@ -202,7 +202,8 @@ result similarly denotes an unavailable value. .Pp The .Fn localeconv_l -function takes an explicit locale parameter. For more information, see +function takes an explicit locale parameter. +For more information, see .Xr xlocale 3 . .Sh RETURN VALUES The From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:39:53 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3739DD9CF05; Tue, 18 Jul 2017 18:39:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03D1D7EBA7; Tue, 18 Jul 2017 18:39:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIdqeq086876; Tue, 18 Jul 2017 18:39:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIdqZj086875; Tue, 18 Jul 2017 18:39:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181839.v6IIdqZj086875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321161 - stable/10/contrib/libc-vis X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/contrib/libc-vis X-SVN-Commit-Revision: 321161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:39:53 -0000 Author: ngie Date: Tue Jul 18 18:39:51 2017 New Revision: 321161 URL: https://svnweb.freebsd.org/changeset/base/321161 Log: MFC r318702: vis(3): delete spurious .Pp macro Modified: stable/10/contrib/libc-vis/vis.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libc-vis/vis.3 ============================================================================== --- stable/10/contrib/libc-vis/vis.3 Tue Jul 18 18:37:56 2017 (r321160) +++ stable/10/contrib/libc-vis/vis.3 Tue Jul 18 18:39:51 2017 (r321161) @@ -347,7 +347,6 @@ space. .It Dv \e240 Represents Meta-space. .El -.Pp .It Dv VIS_CSTYLE Use C-style backslash sequences to represent standard non-printable characters. From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:48:26 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F21D9D28A; Tue, 18 Jul 2017 18:48:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B40E37F263; Tue, 18 Jul 2017 18:48:26 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IImPGf090926; Tue, 18 Jul 2017 18:48:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IImPj3090923; Tue, 18 Jul 2017 18:48:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181848.v6IImPj3090923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321163 - stable/10/usr.sbin/pw/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/pw/tests X-SVN-Commit-Revision: 321163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:48:27 -0000 Author: ngie Date: Tue Jul 18 18:48:25 2017 New Revision: 321163 URL: https://svnweb.freebsd.org/changeset/base/321163 Log: MFC r319026: pw: add some basic testcases for groupshow and usershow - groupshow: test out -a/-g/-n . - usershow: test out -a/-n/-u . Added: stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh stable/10/usr.sbin/pw/tests/pw_usershow_test.sh - copied unchanged from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh Modified: stable/10/usr.sbin/pw/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- stable/10/usr.sbin/pw/tests/Makefile Tue Jul 18 18:39:54 2017 (r321162) +++ stable/10/usr.sbin/pw/tests/Makefile Tue Jul 18 18:48:25 2017 (r321163) @@ -12,10 +12,12 @@ ATF_TESTS_SH= pw_etcdir_test \ pw_groupadd_test \ pw_groupdel_test \ pw_groupmod_test \ + pw_groupshow_test \ pw_useradd_test \ pw_userdel_test \ pw_usermod_test \ - pw_usernext_test + pw_usernext_test \ + pw_usershow_test .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Copied: stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_groupshow_test.sh Tue Jul 18 18:48:25 2017 (r321163, copy of r319026, head/usr.sbin/pw/tests/pw_groupshow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case group_show_all +group_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -a +} + +atf_test_case group_show_gid +group_show_gid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow -g 0 +} + +atf_test_case group_show_name +group_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} groupshow wheel +} + +atf_test_case group_show_nonexistent_gid +group_show_nonexistent_gid_body() { + populate_etc_skel + + nonexistent_gid=4242 + no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_gid + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -g $nonexistent_gid +} + +atf_test_case group_show_nonexistent_name +group_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_name=bogus + no_such_name_msg="pw: unknown group \`$nonexistent_name'\n" + + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + $nonexistent_name + atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \ + -n $nonexistent_name +} + +atf_init_test_cases() { + atf_add_test_case group_show_all + atf_add_test_case group_show_gid + atf_add_test_case group_show_name + atf_add_test_case group_show_nonexistent_gid + atf_add_test_case group_show_nonexistent_name +} Copied: stable/10/usr.sbin/pw/tests/pw_usershow_test.sh (from r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/pw/tests/pw_usershow_test.sh Tue Jul 18 18:48:25 2017 (r321163, copy of r319026, head/usr.sbin/pw/tests/pw_usershow_test.sh) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +atf_test_case user_show_all +user_show_all_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -a +} + +atf_test_case user_show_name +user_show_name_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow root +} + +atf_test_case user_show_nonexistent_name +user_show_nonexistent_name_body() { + populate_etc_skel + + nonexistent_user=bogus + no_such_user_msg="pw: no such user \`$nonexistent_user'\n" + + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + $nonexistent_user + atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \ + -n $nonexistent_user +} + +atf_test_case user_show_nonexistent_uid +user_show_nonexistent_uid_body() { + populate_etc_skel + + nonexistent_uid=4242 + no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n" + + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + $nonexistent_uid + atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \ + -u $nonexistent_uid +} + +atf_test_case user_show_uid +user_show_uid_body() { + populate_etc_skel + atf_check -o not-empty ${PW} usershow -u 0 +} + +atf_init_test_cases() { + atf_add_test_case user_show_all + atf_add_test_case user_show_name + atf_add_test_case user_show_nonexistent_name + atf_add_test_case user_show_nonexistent_uid + atf_add_test_case user_show_uid +} From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:54:48 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FB7D9D622; Tue, 18 Jul 2017 18:54:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 743A17F9BD; Tue, 18 Jul 2017 18:54:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIslLt095354; Tue, 18 Jul 2017 18:54:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIslDL095353; Tue, 18 Jul 2017 18:54:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181854.v6IIslDL095353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321166 - stable/10/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:54:48 -0000 Author: ngie Date: Tue Jul 18 18:54:47 2017 New Revision: 321166 URL: https://svnweb.freebsd.org/changeset/base/321166 Log: MFC r318693,r318694: r318693: Some minor style(9) fixes - Wrap at <80 columns. - Sort by type r318694: style(9): sort headers MFC with: r318693 Modified: stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:51:34 2017 (r321165) +++ stable/10/usr.sbin/bsdinstall/partedit/part_wizard.c Tue Jul 18 18:54:47 2017 (r321166) @@ -27,11 +27,10 @@ */ #include +#include #include -#include #include - -#include +#include #include #include @@ -47,11 +46,12 @@ static char *boot_disk(struct gmesh *mesh); static char *wizard_partition(struct gmesh *mesh, const char *disk); int -part_wizard(const char *fsreq) { - int error; - struct gmesh mesh; +part_wizard(const char *fsreq) +{ char *disk, *schemeroot; const char *fstype; + struct gmesh mesh; + int error; if (fsreq != NULL) fstype = fsreq; @@ -199,9 +199,9 @@ wizard_partition(struct gmesh *mesh, const char *disk) struct gclass *classp; struct ggeom *gpart = NULL; struct gconfig *gc; - char message[512]; - const char *scheme = NULL; char *retval = NULL; + const char *scheme = NULL; + char message[512]; int choice; LIST_FOREACH(classp, &mesh->lg_class, lg_class) @@ -295,15 +295,17 @@ query: } int -wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int interactive) +wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, + int interactive) { - struct gmesh submesh; struct gclass *classp; struct ggeom *gp; struct gprovider *pp; - intmax_t swapsize, available; - char swapsizestr[10], rootsizestr[10], *fsname; char *fsnames[] = {"freebsd-ufs", "freebsd-zfs"}; + char *fsname; + struct gmesh submesh; + char swapsizestr[10], rootsizestr[10]; + intmax_t swapsize, available; int retval; if (strcmp(fstype, "zfs") == 0) { @@ -362,4 +364,3 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, return (0); } - From owner-svn-src-stable-10@freebsd.org Tue Jul 18 18:56:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26E8BD9D7A1; Tue, 18 Jul 2017 18:56:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86667FD5F; Tue, 18 Jul 2017 18:56:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IIu7ow095621; Tue, 18 Jul 2017 18:56:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IIu7Vl095620; Tue, 18 Jul 2017 18:56:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707181856.v6IIu7Vl095620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 18 Jul 2017 18:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321169 - stable/10/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 321169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:56:08 -0000 Author: ngie Date: Tue Jul 18 18:56:06 2017 New Revision: 321169 URL: https://svnweb.freebsd.org/changeset/base/321169 Log: MFC r318722: sade(8): start new sentence on new line Modified: stable/10/usr.sbin/bsdinstall/partedit/sade.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/sade.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:55:48 2017 (r321168) +++ stable/10/usr.sbin/bsdinstall/partedit/sade.8 Tue Jul 18 18:56:06 2017 (r321169) @@ -59,7 +59,8 @@ first appeared in .Fx 6.3 as a utility encapsulating features from the .Xr sysinstall 8 -installer. It was replaced in +installer. +It was replaced in .Fx 10.0 with the equivalent part of .Xr bsdinstall 8 . From owner-svn-src-stable-10@freebsd.org Tue Jul 18 20:46:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4413D9FE24; Tue, 18 Jul 2017 20:46:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8292A83401; Tue, 18 Jul 2017 20:46:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IKkTsr040460; Tue, 18 Jul 2017 20:46:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IKkTfx040459; Tue, 18 Jul 2017 20:46:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201707182046.v6IKkTfx040459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 18 Jul 2017 20:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321175 - stable/10/usr.sbin/nfsuserd X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/usr.sbin/nfsuserd X-SVN-Commit-Revision: 321175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 20:46:30 -0000 Author: rmacklem Date: Tue Jul 18 20:46:29 2017 New Revision: 321175 URL: https://svnweb.freebsd.org/changeset/base/321175 Log: MFC: r320659 Add a Bugs section that indicates that the nfsuserd doesn't work when jails are being used on the system. It is hoped that the patches in PR#205193 will someday get tested/debugged so that they can be MFC'd to fix this. This is a content change. Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:40:36 2017 (r321174) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.8 Tue Jul 18 20:46:29 2017 (r321175) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2017 +.Dd July 4, 2017 .Dt NFSUSERD 8 .Os .Sh NAME @@ -126,3 +126,9 @@ those requests fail and the library functions don't re and .Xr passwd 5 for more information on how the databases are accessed. +.Pp +Since the kernel communicates with the +.Nm +daemon via an upcall that uses the IP address 127.0.0.1, it does not work correctly when +.Xr jail 8 +are used and can crash the system. From owner-svn-src-stable-10@freebsd.org Wed Jul 19 02:50:08 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CF62DA5F8C; Wed, 19 Jul 2017 02:50:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD2E467A6C; Wed, 19 Jul 2017 02:50:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6J2o7YP085771; Wed, 19 Jul 2017 02:50:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6J2o72A085770; Wed, 19 Jul 2017 02:50:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707190250.v6J2o72A085770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 02:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321181 - stable/10/usr.sbin/bsdinstall X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/bsdinstall X-SVN-Commit-Revision: 321181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 02:50:08 -0000 Author: ngie Date: Wed Jul 19 02:50:06 2017 New Revision: 321181 URL: https://svnweb.freebsd.org/changeset/base/321181 Log: MFC r318723: bsdinstall(8): fix manpage issues - Start new sentences on new lines. - Separate e.g. (more of an igor thing) with commas, and rewrite some examples not to be enclosed in parentheses. Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:49:07 2017 (r321180) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Wed Jul 19 02:50:06 2017 (r321181) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2014 +.Dd May 23, 2017 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -39,17 +39,18 @@ .Sh DESCRIPTION .Nm is used for installation of new systems, both for system setup from -installation media (e.g. CD-ROMs) and for use on live systems to prepare +installation media, e.g., CD-ROMs, and for use on live systems to prepare VM images and jails. .Pp Much like .Xr make 1 , Nm -takes a target and possible parameters of the target as arguments. If -invoked with no arguments, it will invoke the +takes a target and possible parameters of the target as arguments. +If invoked with no arguments, it will invoke the .Cm auto target, which provides a standard interactive installation, invoking the -others in sequence. To perform a scripted installation, these subtargets -can be invoked separately by an installation script. +others in sequence. +To perform a scripted installation, +these subtargets can be invoked separately by an installation script. .Sh OPTIONS .Nm supports the following options, global to all targets: @@ -115,7 +116,8 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Defaults to UFS. +installations. +Defaults to UFS. .It Cm zfsboot Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single @@ -135,8 +137,8 @@ to encrypt the disk. Provides the installer's interactive manual disk partitioner with an interface identical to .Xr sade 8 . -Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS -is set up with one pool and dataset per partition. +Supports multiple disks as well as UFS, ZFS, and FAT file systems. +ZFS is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -150,14 +152,16 @@ Each disk setup is specified by a three-part argument: .Op Ar scheme .Op Ar {partitions} .Pp -Multiple disk setups are separated by semicolons. The +Multiple disk setups are separated by semicolons. +The .Ar disk argument specifies the disk on which to operate (which will be erased), while the .Ar scheme argument specifies the .Xr gpart 8 -partition scheme to apply to the disk. If +partition scheme to apply to the disk. +If .Ar scheme is unspecified, .Cm scriptedpart @@ -167,7 +171,8 @@ The argument is also optional and specifies how to partition .Ar disk . It consists of a comma-separated list of partitions to create enclosed in -curly braces. Each partition declaration takes the form +curly braces. +Each partition declaration takes the form .Pp .Ar size .Ar type @@ -178,15 +183,17 @@ specifies the partition size to create in bytes (K, M, can be appended to specify kilobytes, megabytes, and gigabytes respectively), while the .Em auto -keyword causes the partition to take all the remaining space on the disk. The +keyword causes the partition to take all the remaining space on the disk. +The .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). +filesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap. The optional .Ar mount point argument sets where the created partition is to be mounted in the installed -system. As an example, a typical invocation looks like: +system. +As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } .Pp @@ -238,37 +245,43 @@ Reads a small amount of data from .Pa /dev/random and stores it in a file in the new system's root directory. .It Cm config -Installs the configuration files destined for the new system (e.g. rc.conf +Installs the configuration files destined for the new system, e.g., +.Xr rc.conf 5 fragments generated by .Cm netconfig , etc.) onto the new system. .El .Sh ENVIRONMENT VARIABLES The following environment variables control various aspects of the installation -process. Many are used internally during installation and have reasonable -default values for most installation scenarios. Others are set by various -interactive user prompts, and can be usefully overridden when making scripted -or customized installers. +process. +Many are used internally during installation and have reasonable default values +for most installation scenarios. +Others are set by various interactive user prompts, and can be usefully +overridden when making scripted or customized installers. .Bl -tag -width ".Ev BSDINSTALL_DISTSITE" .It Ev DISTRIBUTIONS -The set of distributions to install (e.g. "base kernel ports"). Default: none +The set of distributions to install, e.g., "base kernel ports". +Default: none .It Ev BSDINSTALL_DISTDIR The directory in which the distribution files can be found (or to which they -should be downloaded). Default: +should be downloaded). +Default: .Pa /usr/freebsd-dist .It Ev BSDINSTALL_DISTSITE URL from which the distribution files should be downloaded if they are not already present in the directory defined by .Ev BSDINSTALL_DISTDIR . This should be a full path to the files, including architecture and release -names. Most targets (e.g. +names. +Most targets, e.g., .Cm auto and -.Cm jail ) +.Cm jail , that prompt for a .Fx mirror will skip that step if this variable is already defined in the -environment. Example: +environment. +Example: .Pa ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc64/9.1-RELEASE .It Ev BSDINSTALL_CHROOT The directory into which the distribution files should be unpacked and the @@ -276,23 +289,26 @@ directory at which the root file system of the new sys Default: .Pa /mnt .It Ev BSDINSTALL_LOG -Path to a log file for the installation. Default: +Path to a log file for the installation. +Default: .Pa /tmp/bsdinstall_log .It Ev BSDINSTALL_TMPETC Directory where files destined for the new system's .Pa /etc will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_etc .It Ev BSDINSTALL_TMPBOOT Directory where files destined for the new system's .Pa /boot will be stored until the .Cm config -target is executed. If this directory does not already exist, it will be -created. Default: +target is executed. +If this directory does not already exist, it will be created. +Default: .Pa /tmp/bsdinstall_boot .El .Sh SCRIPTING @@ -307,8 +323,9 @@ a shell script run under .Xr chroot 8 in the newly installed system before .Nm -exits. The two parts are separated by the usual script header (#!), which -also sets the interpreter for the setup script. +exits. +The two parts are separated by the usual script header (#!), which also sets +the interpreter for the setup script. .Pp A typical bsdinstall script looks like this: .Bd -literal -offset indent @@ -326,19 +343,21 @@ On release media, such a script placed at .Pa /etc/installerconfig will be run at boot time and the system will be rebooted automatically after -the installation has completed. This can be used for unattended network -installation of new systems; see +the installation has completed. +This can be used for unattended network installation of new systems; see .Xr diskless 8 for details. .Ss PREAMBLE -The preamble consists of installer settings. These control global installation -parameters (see +The preamble consists of installer settings. +These control global installation parameters (see .Sx ENVIRONMENT VARIABLES ) -as well as disk partitioning. The preamble is interpreted as a +as well as disk partitioning. +The preamble is interpreted as a .Xr sh 1 -script run at the very beginning of the install. If more complicated behavior -than setting these variables is desired, arbitrary commands can be run here -to extend the installer. In addition to the variables in +script run at the very beginning of the install. +If more complicated behavior than setting these variables is desired, +arbitrary commands can be run here to extend the installer. +In addition to the variables in .Sx ENVIRONMENT VARIABLES , in particular .Ev DISTRIBUTIONS , @@ -358,13 +377,14 @@ instead of .Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! -declaration. This script will be run at the end of the installation process -inside a +declaration. +This script will be run at the end of the installation process inside a .Xr chroot 8 environment in the newly installed system and can be used to set up -configuration files, install packages, etc. Note that newly configured -system services (e.g. networking) have not been started in the installed -system at this time and only installation host services are available. +configuration files, install packages, etc. +Note that newly configured system services, e.g., networking have not +been started in the installed system at this time and only installation +host services are available. .Sh HISTORY This version of .Nm From owner-svn-src-stable-10@freebsd.org Wed Jul 19 13:11:37 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A21C7CFDF; Wed, 19 Jul 2017 13:11:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113327EA18; Wed, 19 Jul 2017 13:11:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JDBal4037896; Wed, 19 Jul 2017 13:11:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JDBZo3037892; Wed, 19 Jul 2017 13:11:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191311.v6JDBZo3037892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 13:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321198 - in stable/10: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/dev/vt sys/dev/vt/hw/fb X-SVN-Commit-Revision: 321198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 13:11:37 -0000 Author: emaste Date: Wed Jul 19 13:11:35 2017 New Revision: 321198 URL: https://svnweb.freebsd.org/changeset/base/321198 Log: MFC r303043: Increase vt(4) framebuffer maximum size PR: 210382 Relnotes: Yes Modified: stable/10/share/man/man4/vt.4 stable/10/sys/dev/vt/hw/fb/vt_fb.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/vt.4 ============================================================================== --- stable/10/share/man/man4/vt.4 Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/share/man/man4/vt.4 Wed Jul 19 13:11:35 2017 (r321198) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2016 +.Dd July 19, 2017 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -36,8 +36,8 @@ .Cd "options VT_MAXWINDOWS=N" .Cd "options VT_ALT_TO_ESC_HACK=1" .Cd "options VT_TWOBUTTON_MOUSE" -.Cd "options VT_FB_DEFAULT_WIDTH=X" -.Cd "options VT_FB_DEFAULT_HEIGHT=Y" +.Cd "options VT_FB_MAX_WIDTH=X" +.Cd "options VT_FB_MAX_HEIGHT=Y" .Cd "options SC_NO_CUTPASTE" .Cd "device vt" .Pp Modified: stable/10/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- stable/10/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 19 13:11:35 2017 (r321198) @@ -402,10 +402,10 @@ vt_fb_init(struct vt_device *vd) int err; info = vd->vd_softc; - vd->vd_height = MIN(VT_FB_DEFAULT_HEIGHT, info->fb_height); + vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height); margin = (info->fb_height - vd->vd_height) >> 1; vd->vd_transpose = margin * info->fb_stride; - vd->vd_width = MIN(VT_FB_DEFAULT_WIDTH, info->fb_width); + vd->vd_width = MIN(VT_FB_MAX_WIDTH, info->fb_width); margin = (info->fb_width - vd->vd_width) >> 1; vd->vd_transpose += margin * (info->fb_bpp / NBBY); Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/vt.h Wed Jul 19 13:11:35 2017 (r321198) @@ -365,11 +365,11 @@ void vt_upgrade(struct vt_device *vd); #define PIXEL_WIDTH(w) ((w) / 8) #define PIXEL_HEIGHT(h) ((h) / 16) -#ifndef VT_FB_DEFAULT_WIDTH -#define VT_FB_DEFAULT_WIDTH 2048 +#ifndef VT_FB_MAX_WIDTH +#define VT_FB_MAX_WIDTH 4096 #endif -#ifndef VT_FB_DEFAULT_HEIGHT -#define VT_FB_DEFAULT_HEIGHT 1200 +#ifndef VT_FB_MAX_HEIGHT +#define VT_FB_MAX_HEIGHT 2400 #endif /* name argument is not used yet. */ Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Wed Jul 19 12:27:40 2017 (r321197) +++ stable/10/sys/dev/vt/vt_core.c Wed Jul 19 13:11:35 2017 (r321198) @@ -172,8 +172,8 @@ static void vt_resume_handler(void *priv); SET_DECLARE(vt_drv_set, struct vt_driver); -#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) -#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_MAX_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_MAX_WIDTH)) static struct terminal vt_consterm; static struct vt_window vt_conswindow; From owner-svn-src-stable-10@freebsd.org Wed Jul 19 13:32:09 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4834FC7D7ED; Wed, 19 Jul 2017 13:32:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212037F759; Wed, 19 Jul 2017 13:32:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JDW8kG047500; Wed, 19 Jul 2017 13:32:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JDW8eK047499; Wed, 19 Jul 2017 13:32:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191332.v6JDW8eK047499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 13:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321200 - stable/10/sys/dev/vt X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/sys/dev/vt X-SVN-Commit-Revision: 321200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 13:32:09 -0000 Author: emaste Date: Wed Jul 19 13:32:08 2017 New Revision: 321200 URL: https://svnweb.freebsd.org/changeset/base/321200 Log: MFC r313547, r313777: fix mouse selection when vt(4) scrolls r313547 (ray, submitted by hselasky): o Reset mouse selection when new lines reach selection lines. o Fix how selection handled on display. r313777 (rpokala): Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. PR: 211922 Relnotes: Yes Modified: stable/10/sys/dev/vt/vt_buf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Wed Jul 19 13:28:25 2017 (r321199) +++ stable/10/sys/dev/vt/vt_buf.c Wed Jul 19 13:32:08 2017 (r321200) @@ -54,6 +54,11 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "vt buffer"); (d).tp_row = (s).tp_row; \ } while (0) +#ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); +static int vtbuf_wth(const struct vt_buf *vb, int row); +static int vtbuf_in_this_range(int begin, int test, int end, int sz); +#endif /* * line4 @@ -122,6 +127,9 @@ vthistory_seek(struct vt_buf *vb, int offset, int when void vthistory_addlines(struct vt_buf *vb, int offset) { +#ifndef SC_NO_CUTPASTE + int cur, sz; +#endif vb->vb_curroffset += offset; if (vb->vb_curroffset < 0) @@ -132,6 +140,17 @@ vthistory_addlines(struct vt_buf *vb, int offset) if ((vb->vb_flags & VBF_SCROLL) == 0) { vb->vb_roffset = vb->vb_curroffset; } + +#ifndef SC_NO_CUTPASTE + sz = vb->vb_history_size; + cur = vb->vb_roffset + vb->vb_scr_size.tp_row + sz - 1; + if (vtbuf_in_this_range(cur, vb->vb_mark_start.tp_row, cur + offset, sz) || + vtbuf_in_this_range(cur, vb->vb_mark_end.tp_row, cur + offset, sz)) { + /* clear screen selection */ + vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row; + vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col; + } +#endif } void @@ -142,15 +161,6 @@ vthistory_getpos(const struct vt_buf *vb, unsigned int } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ -/* Translate current view row number to history row. */ -static int -vtbuf_wth(struct vt_buf *vb, int row) -{ - - return ((vb->vb_roffset + row) % vb->vb_history_size); -} -#endif - /* Translate history row to current view row number. */ static int vtbuf_htw(const struct vt_buf *vb, int row) @@ -166,36 +176,78 @@ vtbuf_htw(const struct vt_buf *vb, int row) vb->vb_history_size); } +/* Translate current view row number to history row. */ +static int +vtbuf_wth(const struct vt_buf *vb, int row) +{ + + return ((vb->vb_roffset + row) % vb->vb_history_size); +} + +/* + * Test if an index in a circular buffer is within a range. + * + * begin - start index + * end - end index + * test - test index + * sz - size of circular buffer when it turns over + */ +static int +vtbuf_in_this_range(int begin, int test, int end, int sz) +{ + + begin %= sz; + end %= sz; + + /* check for inversion */ + if (begin > end) + return (test >= begin || test < end); + else + return (test >= begin && test < end); +} +#endif + int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) { - int sc, sr, ec, er, tmp; +#ifndef SC_NO_CUTPASTE + int sc, sr, sz, ec, er, tmp; +#endif if ((vb->vb_flags & (VBF_CURSOR|VBF_SCROLL)) == VBF_CURSOR && (vb->vb_cursor.tp_row == row) && (vb->vb_cursor.tp_col == col)) return (1); +#ifndef SC_NO_CUTPASTE /* Mark cut/paste region. */ + if (vb->vb_mark_start.tp_col == vb->vb_mark_end.tp_col && + vb->vb_mark_start.tp_row == vb->vb_mark_end.tp_row) + return (0); - /* - * Luckily screen view is not like circular buffer, so we will - * calculate in screen coordinates. Translate first. - */ sc = vb->vb_mark_start.tp_col; - sr = vtbuf_htw(vb, vb->vb_mark_start.tp_row); + sr = vb->vb_mark_start.tp_row; ec = vb->vb_mark_end.tp_col; - er = vtbuf_htw(vb, vb->vb_mark_end.tp_row); + er = vb->vb_mark_end.tp_row; + /* + * Information about if the selection was made bottom-top or + * top-bottom is lost due to modulo arithmetics and needs to + * be recovered: + */ + sz = vb->vb_history_size; + tmp = (sz + er - sr) % sz; + row = vtbuf_wth(vb, row); - /* Swap start and end if start > end. */ - if (POS_INDEX(sc, sr) > POS_INDEX(ec, er)) { + /* Swap start and end if start > end */ + if ((2 * tmp) > sz || (tmp == 0 && sc > ec)) { tmp = sc; sc = ec; ec = tmp; tmp = sr; sr = er; er = tmp; } - if ((POS_INDEX(sc, sr) <= POS_INDEX(col, row)) && - (POS_INDEX(col, row) < POS_INDEX(ec, er))) + if (vtbuf_in_this_range(POS_INDEX(sc, sr), POS_INDEX(col, row), + POS_INDEX(ec, er), POS_INDEX(0, sz))) return (1); +#endif return (0); } @@ -627,8 +679,8 @@ vtbuf_flush_mark(struct vt_buf *vb) int s, e; /* Notify renderer to update marked region. */ - if (vb->vb_mark_start.tp_col || vb->vb_mark_end.tp_col || - vb->vb_mark_start.tp_row || vb->vb_mark_end.tp_row) { + if ((vb->vb_mark_start.tp_col != vb->vb_mark_end.tp_col) || + (vb->vb_mark_start.tp_row != vb->vb_mark_end.tp_row)) { s = vtbuf_htw(vb, vb->vb_mark_start.tp_row); e = vtbuf_htw(vb, vb->vb_mark_end.tp_row); From owner-svn-src-stable-10@freebsd.org Wed Jul 19 14:15:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A84C7E683; Wed, 19 Jul 2017 14:15:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54B6C80FA9; Wed, 19 Jul 2017 14:15:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JEFnXK065208; Wed, 19 Jul 2017 14:15:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JEFnku065206; Wed, 19 Jul 2017 14:15:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707191415.v6JEFnku065206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Jul 2017 14:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321202 - in stable/10/usr.sbin/bsdinstall: partedit scripts X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/10/usr.sbin/bsdinstall: partedit scripts X-SVN-Commit-Revision: 321202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 14:15:50 -0000 Author: emaste Date: Wed Jul 19 14:15:49 2017 New Revision: 321202 URL: https://svnweb.freebsd.org/changeset/base/321202 Log: MFC r302145: bsdinstall: increase EFI partition size to 200MB A larger EFI file system size will facilitate multi-boot configurations and the installation other EFI applications like firmware update tools. 200MB matches OS X. Note that this changes only the partition size, not the file system that bsdinstall places there. We need to do both, but as the partition size is difficult to adjust later make this change for now so that at least systems installed with FreeBSD 11.0 have a partition layout with room to grow. Also merge part of r320007: - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86 - increase ZFS EFI partition to 200M PR: 201898 Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Jul 19 14:07:38 2017 (r321201) +++ stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c Wed Jul 19 14:15:49 2017 (r321202) @@ -32,6 +32,10 @@ #include "partedit.h" +/* EFI partition size in bytes */ +#define EFI_BOOTPART_SIZE (200 * 1024 * 1024) +#define EFI_BOOTPART_PATH "/boot/boot1.efifat" + static const char * x86_bootmethod(void) { @@ -96,7 +100,7 @@ bootpart_size(const char *scheme) if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else - return (800*1024); + return (EFI_BOOTPART_SIZE); return (0); } @@ -134,7 +138,7 @@ partcode_path(const char *part_type, const char *fs_ty if (strcmp(part_type, "GPT") == 0) { if (strcmp(x86_bootmethod(), "UEFI") == 0) - return ("/boot/boot1.efifat"); + return (EFI_BOOTPART_PATH); else if (strcmp(fs_type, "zfs") == 0) return ("/boot/gptzfsboot"); else Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jul 19 14:07:38 2017 (r321201) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Wed Jul 19 14:15:49 2017 (r321202) @@ -816,7 +816,7 @@ zfs_create_diskpart() if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" ]; then f_eval_catch $funcname gpart \ "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \ - "$align_small" efiboot$index efi 800k $disk || + "$align_small" efiboot$index efi 200M $disk || return $FAILURE f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" \ /boot/boot1.efifat 1 $disk || From owner-svn-src-stable-10@freebsd.org Wed Jul 19 15:59:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04A3CFC6F8; Wed, 19 Jul 2017 15:59:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCB2E; Wed, 19 Jul 2017 15:59:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JFxpJo007003; Wed, 19 Jul 2017 15:59:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JFxpNL007001; Wed, 19 Jul 2017 15:59:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191559.v6JFxpNL007001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 15:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321209 - stable/10/usr.bin/sed/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.bin/sed/tests X-SVN-Commit-Revision: 321209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 15:59:52 -0000 Author: ngie Date: Wed Jul 19 15:59:51 2017 New Revision: 321209 URL: https://svnweb.freebsd.org/changeset/base/321209 Log: MFC r312521,r313397: r312521: Add testcases for -i with hardlinks and symlinks The symlink testcase is expected to fail, post-r312519 (the revert of r312404); mark it so. r313397: Don't expect :inplace_symlink_src to fail anymore (post-r313277) The S_ISREG check was restored, such that the code will again fail with in-place replacements on symlinks Added: stable/10/usr.bin/sed/tests/sed2_test.sh - copied, changed from r312521, head/usr.bin/sed/tests/sed2_test.sh Modified: stable/10/usr.bin/sed/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/tests/Makefile ============================================================================== --- stable/10/usr.bin/sed/tests/Makefile Wed Jul 19 15:58:27 2017 (r321208) +++ stable/10/usr.bin/sed/tests/Makefile Wed Jul 19 15:59:51 2017 (r321209) @@ -1,5 +1,6 @@ # $FreeBSD$ +ATF_TESTS_SH+= sed2_test NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test Copied and modified: stable/10/usr.bin/sed/tests/sed2_test.sh (from r312521, head/usr.bin/sed/tests/sed2_test.sh) ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Fri Jan 20 07:11:21 2017 (r312521, copy source) +++ stable/10/usr.bin/sed/tests/sed2_test.sh Wed Jul 19 15:59:51 2017 (r321209) @@ -47,8 +47,6 @@ inplace_symlink_src_head() } inplace_symlink_src_body() { - atf_expect_fail "Check for S_IFREG reverted in r312404" - echo foo > a atf_check ln -s a b atf_check -e not-empty -s not-exit:0 sed -i '' -e 's,foo,bar,g' b From owner-svn-src-stable-10@freebsd.org Wed Jul 19 16:38:56 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF4BCFD091; Wed, 19 Jul 2017 16:38:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D82A1EA0; Wed, 19 Jul 2017 16:38:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JGctXt023789; Wed, 19 Jul 2017 16:38:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGctBu023788; Wed, 19 Jul 2017 16:38:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191638.v6JGctBu023788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321212 - stable/10/sbin/savecore X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sbin/savecore X-SVN-Commit-Revision: 321212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 16:38:56 -0000 Author: ngie Date: Wed Jul 19 16:38:55 2017 New Revision: 321212 URL: https://svnweb.freebsd.org/changeset/base/321212 Log: Relnotes: yes (subtle output/behavior change) MFC r316938,r316953: r316938: savecore: fix space calculation with respect to `minfree` in check_space(..) - Use strtoll(3) instead of atoi(3), because atoi(3) limits the representable data to INT_MAX. Check the values received from strtoll(3), trimming trailing whitespace off the end to maintain POLA. - Use `KiB` instead of `kB` when describing free space, total space, etc. I am now fully aware of `KiB` being the IEC standard for 1024 bytes and `kB` being the IEC standard for 1000 bytes. - Store available number of KiB in `available` so it can be more easily queried and compared to ensure that there are enough KiB to store the dump image on disk. - Print out the reserved space on disk, per `minfree`, so end-users can troubleshoot why check_space(..) is reporting that there isn't enough free space. Tested with: positive/negative cases (see review); make tinderbox r316953: Switch back to non-IEC units for 1024 bytes I was swayed a little too quickly when I saw the wiki page discussing kB vs KiB. Switch back as none of the code in base openly uses IEC units via humanize_number(3) (which was my next step), and there's a large degree of dislike with IEC vs more SI-like units. Modified: stable/10/sbin/savecore/savecore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/savecore/savecore.c ============================================================================== --- stable/10/sbin/savecore/savecore.c Wed Jul 19 16:23:02 2017 (r321211) +++ stable/10/sbin/savecore/savecore.c Wed Jul 19 16:38:55 2017 (r321212) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ static int check_space(const char *savedir, off_t dumpsize, int bounds) { FILE *fp; - off_t minfree, spacefree, totfree, needed; + off_t available, minfree, spacefree, totfree, needed; struct statfs fsbuf; char buf[100]; @@ -268,19 +269,37 @@ check_space(const char *savedir, off_t dumpsize, int b else { if (fgets(buf, sizeof(buf), fp) == NULL) minfree = 0; - else - minfree = atoi(buf); + else { + char *endp; + + errno = 0; + minfree = strtoll(buf, &endp, 10); + if (minfree == 0 && errno != 0) + minfree = -1; + else { + while (*endp != '\0' && isspace(*endp)) + endp++; + if (*endp != '\0' || minfree < 0) + minfree = -1; + } + if (minfree < 0) + syslog(LOG_WARNING, + "`minfree` didn't contain a valid size " + "(`%s`). Defaulting to 0", buf); + } (void)fclose(fp); } + available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ needed -= saved_dump_size(bounds); - if ((minfree > 0 ? spacefree : totfree) - needed < minfree) { + if (available < needed) { syslog(LOG_WARNING, - "no dump: not enough free space on device (%lldkB " - "available; need at least %lldkB)", - (long long)(minfree > 0 ? spacefree : totfree), - (long long)needed); + "no dump: not enough free space on device (need at least " + "%jdkB for dump; %jdkB available; %jdkB reserved)", + (intmax_t)needed, + (intmax_t)available + minfree, + (intmax_t)minfree); return (0); } if (spacefree - needed < 0) From owner-svn-src-stable-10@freebsd.org Wed Jul 19 16:54:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 755D2CFD4C6; Wed, 19 Jul 2017 16:54:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2596E29B3; Wed, 19 Jul 2017 16:54:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JGsZ7a031608; Wed, 19 Jul 2017 16:54:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JGsZgw031607; Wed, 19 Jul 2017 16:54:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191654.v6JGsZgw031607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 16:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321216 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 321216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 16:54:36 -0000 Author: ngie Date: Wed Jul 19 16:54:34 2017 New Revision: 321216 URL: https://svnweb.freebsd.org/changeset/base/321216 Log: Record merges for r319659 and r319660. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Wed Jul 19 18:19:12 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B44ECFED83; Wed, 19 Jul 2017 18:19:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54F9264DD8; Wed, 19 Jul 2017 18:19:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JIJBUO066310; Wed, 19 Jul 2017 18:19:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIJBiu066309; Wed, 19 Jul 2017 18:19:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191819.v6JIJBiu066309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321220 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 18:19:12 -0000 Author: ngie Date: Wed Jul 19 18:19:11 2017 New Revision: 321220 URL: https://svnweb.freebsd.org/changeset/base/321220 Log: MFC r316602: pmc_read(3): fix manlint error Remove spurious trailing comma from last .Nm entry in NAME section. Modified: stable/10/lib/libpmc/pmc_read.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc_read.3 ============================================================================== --- stable/10/lib/libpmc/pmc_read.3 Wed Jul 19 18:19:03 2017 (r321219) +++ stable/10/lib/libpmc/pmc_read.3 Wed Jul 19 18:19:11 2017 (r321220) @@ -29,7 +29,7 @@ .Sh NAME .Nm pmc_read , .Nm pmc_rw , -.Nm pmc_write , +.Nm pmc_write .Nd read and write hardware performance counters .Sh LIBRARY .Lb libpmc From owner-svn-src-stable-10@freebsd.org Wed Jul 19 18:22:33 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79371CFF008; Wed, 19 Jul 2017 18:22:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549C465389; Wed, 19 Jul 2017 18:22:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JIMW4p070267; Wed, 19 Jul 2017 18:22:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIMWZn070264; Wed, 19 Jul 2017 18:22:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707191822.v6JIMWZn070264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Jul 2017 18:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321222 - in stable/10: contrib/libc++/include contrib/libc++/src sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/10: contrib/libc++/include contrib/libc++/src sys/sys X-SVN-Commit-Revision: 321222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 18:22:33 -0000 Author: dim Date: Wed Jul 19 18:22:32 2017 New Revision: 321222 URL: https://svnweb.freebsd.org/changeset/base/321222 Log: Pull in r229281 from upstream libc++ (by Larisse Voufo): Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241. This allows ports which use C++14's sized deallocation functions, such as cad/openvsp, to build on stable/10. Bump __FreeBSD_version to allow detection from ports. Direct commit, since stable/11 and head already have newer versions of libc++ which include this change. PR: 219484 Modified: stable/10/contrib/libc++/include/new stable/10/contrib/libc++/src/new.cpp stable/10/sys/sys/param.h Modified: stable/10/contrib/libc++/include/new ============================================================================== --- stable/10/contrib/libc++/include/new Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/contrib/libc++/include/new Wed Jul 19 18:22:32 2017 (r321222) @@ -50,12 +50,18 @@ new_handler get_new_handler() noexcept; void* operator new(std::size_t size); // replaceable void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable void operator delete(void* ptr) noexcept; // replaceable +void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable +void operator delete(void* ptr, std::size_t size, + const std::nothrow_t&) noexcept; // replaceable, C++14 void* operator new[](std::size_t size); // replaceable void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable void operator delete[](void* ptr) noexcept; // replaceable +void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14 void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable +void operator delete[](void* ptr, std::size_t size, + const std::nothrow_t&) noexcept; // replaceable, C++14 void* operator new (std::size_t size, void* ptr) noexcept; void* operator new[](std::size_t size, void* ptr) noexcept; @@ -131,7 +137,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t ; _LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_NEW_DELETE_VIS void operator delete(void* __p) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz) #if !__has_feature(cxx_noexcept) @@ -140,7 +148,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_ ; _LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT; _LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;} inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;} Modified: stable/10/contrib/libc++/src/new.cpp ============================================================================== --- stable/10/contrib/libc++/src/new.cpp Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/contrib/libc++/src/new.cpp Wed Jul 19 18:22:32 2017 (r321222) @@ -126,6 +126,13 @@ operator delete(void* ptr) _NOEXCEPT _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete(void* ptr, size_t) _NOEXCEPT +{ + ::operator delete(ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT { ::operator delete(ptr); @@ -133,14 +140,35 @@ operator delete(void* ptr, const std::nothrow_t&) _NOE _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete(void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT +{ + ::operator delete(ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete[] (void* ptr) _NOEXCEPT { - ::operator delete (ptr); + ::operator delete(ptr); } _LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS void +operator delete[] (void* ptr, size_t) _NOEXCEPT +{ + ::operator delete[](ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT +{ + ::operator delete[](ptr); +} + +_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS +void +operator delete[] (void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT { ::operator delete[](ptr); } Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Wed Jul 19 18:19:51 2017 (r321221) +++ stable/10/sys/sys/param.h Wed Jul 19 18:22:32 2017 (r321222) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003514 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003515 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Wed Jul 19 18:22:57 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F253CFF0AF; Wed, 19 Jul 2017 18:22:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E003B6550B; Wed, 19 Jul 2017 18:22:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JIMtY6070347; Wed, 19 Jul 2017 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JIMtjk070346; Wed, 19 Jul 2017 18:22:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191822.v6JIMtjk070346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321223 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 18:22:57 -0000 Author: ngie Date: Wed Jul 19 18:22:55 2017 New Revision: 321223 URL: https://svnweb.freebsd.org/changeset/base/321223 Log: MFC r316600: pmc(3): add additional references for libpmc functions in the SEE ALSO section These functions are already referenced throughout the manpage -- this makes their presence more apparent. Modified: stable/10/lib/libpmc/pmc.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc.3 ============================================================================== --- stable/10/lib/libpmc/pmc.3 Wed Jul 19 18:22:32 2017 (r321222) +++ stable/10/lib/libpmc/pmc.3 Wed Jul 19 18:22:55 2017 (r321223) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2008 +.Dd April 6, 2017 .Dt PMC 3 .Os .Sh NAME @@ -534,6 +534,19 @@ API is .Xr pmc.p6 3 , .Xr pmc.soft 3 , .Xr pmc.tsc 3 , +.Xr pmc_allocate 3 , +.Xr pmc_attach 3 , +.Xr pmc_capabilities 3 , +.Xr pmc_configure_logfile 3 , +.Xr pmc_disable 3 , +.Xr pmc_event_names_of_class 3 , +.Xr pmc_get_driver_stats 3 , +.Xr pmc_get_msr 3 , +.Xr pmc_init 3 , +.Xr pmc_name_of_capability 3 , +.Xr pmc_read 3 , +.Xr pmc_set 3 , +.Xr pmc_start 3 , .Xr pmclog 3 , .Xr hwpmc 4 , .Xr pmccontrol 8 , From owner-svn-src-stable-10@freebsd.org Wed Jul 19 18:23:50 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AE4CFF242; Wed, 19 Jul 2017 18:23:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991BA65902; Wed, 19 Jul 2017 18:23:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JINnL4070507; Wed, 19 Jul 2017 18:23:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JINnWB070506; Wed, 19 Jul 2017 18:23:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191823.v6JINnWB070506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 18:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321225 - stable/10/lib/libpmc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libpmc X-SVN-Commit-Revision: 321225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 18:23:51 -0000 Author: ngie Date: Wed Jul 19 18:23:49 2017 New Revision: 321225 URL: https://svnweb.freebsd.org/changeset/base/321225 Log: MFC r316601: pmc.atomsilvermont(3): fix manlint warnings Start new sentences on new lines. Sentences affected by the change are wrapped at <80 columns. Other potentially offending lines have been left alone to reduce churn. Modified: stable/10/lib/libpmc/pmc.atomsilvermont.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libpmc/pmc.atomsilvermont.3 ============================================================================== --- stable/10/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:23:26 2017 (r321224) +++ stable/10/lib/libpmc/pmc.atomsilvermont.3 Wed Jul 19 18:23:49 2017 (r321225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd April 6, 2017 .Dt PMC.ATOMSILVERMONT 3 .Os .Sh NAME @@ -262,7 +262,8 @@ The number of store uops reissued from Rehabq. .It Li MEM_UOPS_RETIRED.L1_MISS_LOADS .Pq Event 04H , Umask 01H The number of load ops retired that miss in L1 -Data cache. Note that prefetch misses will not be counted. +Data cache. +Note that prefetch misses will not be counted. .It Li MEM_UOPS_RETIRED.L2_HIT_LOADS .Pq Event 04H , Umask 02H The number of load micro-ops retired that hit L2. @@ -287,26 +288,27 @@ The number of load ops retired. The number of store ops retired. .It Li PAGE_WALKS.D_SIDE_CYCLES .Pq Event 05H , Umask 01H -Every cycle when a D-side (walks due to a load) page walk -is in progress. Page walk duration divided by -number of page walks is the average duration of page-walks. -Edge trigger bit must be cleared. Set Edge to count the number -of page walks. +Every cycle when a D-side (walks due to a load) page walk is in progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. +Edge trigger bit must be cleared. +Set Edge to count the number of page walks. .It Li PAGE_WALKS.I_SIDE_CYCLES .Pq Event 05H , Umask 02H -Every cycle when a I-side (walks due to an instruction fetch) -page walk is in progress. Page walk duration divided by number -of page walks is the average duration of page-walks. +Every cycle when a I-side (walks due to an instruction fetch) page walk is in +progress. +Page walk duration divided by number of page walks is the average duration of +page-walks. .It Li PAGE_WALKS.WALKS .Pq Event 05H , Umask 03H -The number of times a data (D) page walk or an instruction (I) -page walk is completed or started. Since a page walk implies a -TLB miss, the number of TLB misses can be counted by counting -the number of pagewalks. +The number of times a data (D) page walk or an instruction (I) page walk is +completed or started. +Since a page walk implies a TLB miss, the number of TLB misses can be counted +by counting the number of pagewalks. .It Li LONGEST_LAT_CACHE.MISS .Pq Event 2EH , Umask 41H -the total number of L2 cache references and -The number of L2 cache misses respectively. +the total number of L2 cache references and the number of L2 cache misses +respectively. L3 is not supported in Silvermont microarchitecture. .It Li LONGEST_LAT_CACHE.REFERENCE .Pq Event 2EH , Umask 4FH @@ -323,39 +325,39 @@ requests), BBS (L2 misses) and WOB (L2 write-back vict .It Li CORE_REJECT_L2Q.ALL .Pq Event 31H , Umask 00H The number of demand and L1 prefetcher -requests rejected by the L2Q due to a full or nearly full -condition which likely indicates back pressure from L2Q. -It also counts requests that would have gone directly to -the XQ, but are rejected due to a full or nearly full condition, -indicating back pressure from the IDI link. The L2Q may also -reject transactions from a core to insure fairness between -cores, or to delay a core's dirty eviction when the address -conflicts incoming external snoops. (Note that L2 prefetcher -requests that are dropped are not counted by this event.). +requests rejected by the L2Q due to a full or nearly full condition which +likely indicates back pressure from L2Q. +It also counts requests that would have gone directly to the XQ, but are +rejected due to a full or nearly full condition, indicating back pressure from +the IDI link. +The L2Q may also reject transactions from a core to insure fairness between +cores, or to delay a core's dirty eviction when the address conflicts incoming +external snoops. +(Note that L2 prefetcher requests that are dropped are not counted by this +event). .It Li CPU_CLK_UNHALTED.CORE_P .Pq Event 3CH , Umask 00H -The number of core cycles while the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. In mobile systems the core frequency -may change from time to time. For this reason this event -may have a changing ratio with regards to time. +The number of core cycles while the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. +In mobile systems the core frequency may change from time to time. +For this reason this event may have a changing ratio with regards to time. .It Li CPU_CLK_UNHALTED.REF_P .Pq Event 3CH , Umask 01H -The number of reference cycles that the core is not in a halt -state. The core enters the halt state when it is running -the HLT instruction. +The number of reference cycles that the core is not in a halt state. +The core enters the halt state when it is running the HLT instruction. In mobile systems the core frequency may change from time. -This event is not affected by core frequency changes but counts -as if the core is running at the maximum frequency all the time. +This event is not affected by core frequency changes but counts as if the core +is running at the maximum frequency all the time. .It Li ICACHE.HIT .Pq Event 80H , Umask 01H The number of instruction fetches from the instruction cache. .It Li ICACHE.MISSES .Pq Event 80H , Umask 02H -The number of instruction fetches that miss the -Instruction cache or produce memory requests. This includes -uncacheable fetches. An instruction fetch miss is counted only -once and not once for every cycle it is outstanding. +The number of instruction fetches that miss the Instruction cache or produce +memory requests. +This includes uncacheable fetches. +An instruction fetch miss is counted only once and not once for every cycle +it is outstanding. .It Li ICACHE.ACCESSES .Pq Event 80H , Umask 03H The number of instruction fetches, including uncacheable fetches. @@ -372,10 +374,10 @@ Requires MSR_OFFCORE_RESP0 to specify request type and Requires MSR_OFFCORE_RESP to specify request type and response. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 00H -The number of instructions that retire execution. For instructions -that consist of multiple micro-ops, this event counts the -retirement of the last micro-op of the instruction. The counter -continues counting during hardware interrupts, traps, and inside +The number of instructions that retire execution. +For instructions that consist of multiple micro-ops, this event counts the +retirement of the last micro-op of the instruction. +The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. .It Li UOPS_RETIRED.MS .Pq Event C2H , Umask 01H From owner-svn-src-stable-10@freebsd.org Wed Jul 19 19:30:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0E2D7C8E2; Wed, 19 Jul 2017 19:30:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86018687FD; Wed, 19 Jul 2017 19:30:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JJUD30096304; Wed, 19 Jul 2017 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJUD0K096299; Wed, 19 Jul 2017 19:30:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191930.v6JJUD0K096299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321234 - in stable/10: etc etc/mtree usr.sbin/syslogd X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc etc/mtree usr.sbin/syslogd X-SVN-Commit-Revision: 321234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 19:30:14 -0000 Author: ngie Date: Wed Jul 19 19:30:13 2017 New Revision: 321234 URL: https://svnweb.freebsd.org/changeset/base/321234 Log: MFC r308160,r309194,r309216: r308160 (by bapt): syslogd(8): add an 'include' keyword All the '.conf' files not beginning with a '.' contained int he directory following the keyword will be included. This keyword can only be used in the first level configuration files. Modify the default syslogd.conf to 'include' /etc/syslog.d and /usr/local/etc/syslog.d It simplify a lot handling of syslog from automation tools. Relnotes: yes r309194 (by bapt): initialize *nextp which could be left uninitialized in case the configuration file cannot be open/read CID: 1365665 r309216 (by bapt): Properly initialize nextp Modified: stable/10/etc/mtree/BSD.root.dist stable/10/etc/syslog.conf stable/10/usr.sbin/syslogd/syslog.conf.5 stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/etc/mtree/BSD.root.dist Wed Jul 19 19:30:13 2017 (r321234) @@ -72,6 +72,8 @@ .. ssl .. + syslog.d + .. zfs .. .. Modified: stable/10/etc/syslog.conf ============================================================================== --- stable/10/etc/syslog.conf Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/etc/syslog.conf Wed Jul 19 19:30:13 2017 (r321234) @@ -34,3 +34,5 @@ cron.* /var/log/cron !ppp *.* /var/log/ppp.log !* +include /etc/syslog.d +include /usr/local/etc/syslog.d Modified: stable/10/usr.sbin/syslogd/syslog.conf.5 ============================================================================== --- stable/10/usr.sbin/syslogd/syslog.conf.5 Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/usr.sbin/syslogd/syslog.conf.5 Wed Jul 19 19:30:13 2017 (r321234) @@ -28,7 +28,7 @@ .\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 12, 2012 +.Dd November 1, 2016 .Dt SYSLOG.CONF 5 .Os .Sh NAME @@ -61,6 +61,12 @@ The field is separated from the .Em action field by one or more tab characters or spaces. +.Pp +A special +.Em include +keyword can be used to include all files with names ending in '.conf' and not +beginning with a '.' contained in the directory following the keyword. +This keyword can only be used in the first level configuration file. .Pp Note that if you use spaces as separators, your .Nm Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Wed Jul 19 19:08:37 2017 (r321233) +++ stable/10/usr.sbin/syslogd/syslogd.c Wed Jul 19 19:30:13 2017 (r321234) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -120,6 +121,8 @@ __FBSDID("$FreeBSD$"); const char *ConfFile = _PATH_LOGCONF; const char *PidFile = _PATH_LOGPID; const char ctty[] = _PATH_CONSOLE; +static const char include_str[] = "include"; +static const char include_ext[] = ".conf"; #define dprintf if (Debug) printf @@ -1553,93 +1556,46 @@ die(int signo) exit(1); } -/* - * INIT -- Initialize syslogd from configuration table - */ -static void -init(int signo) +static int +configfiles(const struct dirent *dp) { - int i; - FILE *cf; - struct filed *f, *next, **nextp; - char *p; - char cline[LINE_MAX]; - char prog[LINE_MAX]; - char host[MAXHOSTNAMELEN]; - char oldLocalHostName[MAXHOSTNAMELEN]; - char hostMsg[2*MAXHOSTNAMELEN+40]; - char bootfileMsg[LINE_MAX]; + const char *p; + size_t ext_len; - dprintf("init\n"); + if (dp->d_name[0] == '.') + return (0); - /* - * Load hostname (may have changed). - */ - if (signo != 0) - (void)strlcpy(oldLocalHostName, LocalHostName, - sizeof(oldLocalHostName)); - if (gethostname(LocalHostName, sizeof(LocalHostName))) - err(EX_OSERR, "gethostname() failed"); - if ((p = strchr(LocalHostName, '.')) != NULL) { - *p++ = '\0'; - LocalDomain = p; - } else { - LocalDomain = ""; - } + ext_len = sizeof(include_ext) -1; - /* - * Close all open log files. - */ - Initialized = 0; - for (f = Files; f != NULL; f = next) { - /* flush any pending output */ - if (f->f_prevcount) - fprintlog(f, 0, (char *)NULL); + if (dp->d_namlen <= ext_len) + return (0); - switch (f->f_type) { - case F_FILE: - case F_FORW: - case F_CONSOLE: - case F_TTY: - close_filed(f); - break; - case F_PIPE: - close_filed(f); - deadq_enter(f->f_un.f_pipe.f_pid, - f->f_un.f_pipe.f_pname); - break; - } - next = f->f_next; - if (f->f_program) free(f->f_program); - if (f->f_host) free(f->f_host); - free((char *)f); - } - Files = NULL; - nextp = &Files; + p = &dp->d_name[dp->d_namlen - ext_len]; + if (strcmp(p, include_ext) != 0) + return (0); - /* open the configuration file */ - if ((cf = fopen(ConfFile, "r")) == NULL) { - dprintf("cannot open %s\n", ConfFile); - *nextp = (struct filed *)calloc(1, sizeof(*f)); - if (*nextp == NULL) { - logerror("calloc"); - exit(1); - } - cfline("*.ERR\t/dev/console", *nextp, "*", "*"); - (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); - if ((*nextp)->f_next == NULL) { - logerror("calloc"); - exit(1); - } - cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); - Initialized = 1; - return; - } + return (1); +} +static void +readconfigfile(FILE *cf, struct filed **nextp, int allow_includes) +{ + FILE *cf2; + struct filed *f; + struct dirent **ent; + char cline[LINE_MAX]; + char host[MAXHOSTNAMELEN]; + char prog[LINE_MAX]; + char file[MAXPATHLEN]; + char *p, *tmp; + int i, nents; + size_t include_len; + /* * Foreach line in the conf table, open that file. */ f = NULL; + include_len = sizeof(include_str) -1; (void)strlcpy(host, "*", sizeof(host)); (void)strlcpy(prog, "*", sizeof(prog)); while (fgets(cline, sizeof(cline), cf) != NULL) { @@ -1652,6 +1608,42 @@ init(int signo) continue; if (*p == 0) continue; + if (allow_includes && + strncmp(p, include_str, include_len) == 0 && + isspace(p[include_len])) { + p += include_len; + while (isspace(*p)) + p++; + tmp = p; + while (*tmp != '\0' && !isspace(*tmp)) + tmp++; + *tmp = '\0'; + dprintf("Trying to include files in '%s'\n", p); + nents = scandir(p, &ent, configfiles, alphasort); + if (nents == -1) { + dprintf("Unable to open '%s': %s\n", p, + strerror(errno)); + continue; + } + for (i = 0; i < nents; i++) { + if (snprintf(file, sizeof(file), "%s/%s", p, + ent[i]->d_name) >= (int)sizeof(file)) { + dprintf("ignoring path too long: " + "'%s/%s'\n", p, ent[i]->d_name); + free(ent[i]); + continue; + } + free(ent[i]); + cf2 = fopen(file, "r"); + if (cf2 == NULL) + continue; + dprintf("reading %s\n", file); + readconfigfile(cf2, nextp, 0); + fclose(cf2); + } + free(ent); + continue; + } if (*p == '#') { p++; if (*p != '!' && *p != '+' && *p != '-') @@ -1713,6 +1705,89 @@ init(int signo) nextp = &f->f_next; cfline(cline, f, prog, host); } +} + +/* + * INIT -- Initialize syslogd from configuration table + */ +static void +init(int signo) +{ + int i; + FILE *cf; + struct filed *f, *next, **nextp; + char *p; + char oldLocalHostName[MAXHOSTNAMELEN]; + char hostMsg[2*MAXHOSTNAMELEN+40]; + char bootfileMsg[LINE_MAX]; + + dprintf("init\n"); + + /* + * Load hostname (may have changed). + */ + if (signo != 0) + (void)strlcpy(oldLocalHostName, LocalHostName, + sizeof(oldLocalHostName)); + if (gethostname(LocalHostName, sizeof(LocalHostName))) + err(EX_OSERR, "gethostname() failed"); + if ((p = strchr(LocalHostName, '.')) != NULL) { + *p++ = '\0'; + LocalDomain = p; + } else { + LocalDomain = ""; + } + + /* + * Close all open log files. + */ + Initialized = 0; + for (f = Files; f != NULL; f = next) { + /* flush any pending output */ + if (f->f_prevcount) + fprintlog(f, 0, (char *)NULL); + + switch (f->f_type) { + case F_FILE: + case F_FORW: + case F_CONSOLE: + case F_TTY: + close_filed(f); + break; + case F_PIPE: + close_filed(f); + deadq_enter(f->f_un.f_pipe.f_pid, + f->f_un.f_pipe.f_pname); + break; + } + next = f->f_next; + if (f->f_program) free(f->f_program); + if (f->f_host) free(f->f_host); + free((char *)f); + } + Files = NULL; + nextp = &Files; + + /* open the configuration file */ + if ((cf = fopen(ConfFile, "r")) == NULL) { + dprintf("cannot open %s\n", ConfFile); + *nextp = (struct filed *)calloc(1, sizeof(*f)); + if (*nextp == NULL) { + logerror("calloc"); + exit(1); + } + cfline("*.ERR\t/dev/console", *nextp, "*", "*"); + (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); + if ((*nextp)->f_next == NULL) { + logerror("calloc"); + exit(1); + } + cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); + Initialized = 1; + return; + } + + readconfigfile(cf, &Files, 1); /* close the configuration file */ (void)fclose(cf); From owner-svn-src-stable-10@freebsd.org Wed Jul 19 19:41:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5633FD7CEC7; Wed, 19 Jul 2017 19:41:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30DA6692C0; Wed, 19 Jul 2017 19:41:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JJfDYS000995; Wed, 19 Jul 2017 19:41:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JJfDX3000992; Wed, 19 Jul 2017 19:41:13 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707191941.v6JJfDX3000992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 19:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321237 - stable/10/usr.sbin/cron/cron X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/cron X-SVN-Commit-Revision: 321237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 19:41:14 -0000 Author: ngie Date: Wed Jul 19 19:41:13 2017 New Revision: 321237 URL: https://svnweb.freebsd.org/changeset/base/321237 Log: MFC r304570,r321235: r304570 (by trasz): Add the "-n" flag to cron(8), to prevent it from daemonizing. This makes it possible to use it with external supervisors. The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD. r321235: Fix trivial whitespace bug introduced in usage message changes for -n support (r304570). Modified: stable/10/usr.sbin/cron/cron/cron.8 stable/10/usr.sbin/cron/cron/cron.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/cron.8 ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:39:26 2017 (r321236) +++ stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 19:41:13 2017 (r321237) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29, 2008 +.Dd August 21, 2016 .Dt CRON 8 .Os .Sh NAME @@ -28,6 +28,7 @@ .Op Fl j Ar jitter .Op Fl J Ar rootjitter .Op Fl m Ar mailto +.Op Fl n .Op Fl s .Op Fl o .Op Fl x Ar debugflag Ns Op , Ns Ar ... @@ -132,6 +133,8 @@ set to a null string, usually specified in a shell as .Li '' or .Li \*q\*q . +.It Fl n +Don't daemonize, run in foreground instead. .It Fl s Enable special handling of situations when the GMT offset of the local timezone changes, such as the switches between the standard time and Modified: stable/10/usr.sbin/cron/cron/cron.c ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.c Wed Jul 19 19:39:26 2017 (r321236) +++ stable/10/usr.sbin/cron/cron/cron.c Wed Jul 19 19:41:13 2017 (r321237) @@ -49,6 +49,7 @@ static int run_at_secres(cron_db *); static time_t last_time = 0; static int dst_enabled = 0; +static int dont_daemonize = 0; struct pidfh *pfh; static void @@ -58,7 +59,7 @@ usage() { #endif fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] " - "[-m mailto] [-s] [-o] [-x debugflag[,...]]\n"); + "[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n"); #if DEBUGGING fprintf(stderr, "\ndebugflags: "); @@ -136,7 +137,7 @@ main(argc, argv) if (0) { # endif (void) fprintf(stderr, "[%d] cron started\n", getpid()); - } else { + } else if (dont_daemonize == 0) { if (daemon(1, 0) == -1) { pidfile_remove(pfh); log_it("CRON",getpid(),"DEATH","can't become daemon"); @@ -512,7 +513,7 @@ parse_args(argc, argv) int argch; char *endp; - while ((argch = getopt(argc, argv, "j:J:m:osx:")) != -1) { + while ((argch = getopt(argc, argv, "j:J:m:nosx:")) != -1) { switch (argch) { case 'j': Jitter = strtoul(optarg, &endp, 10); @@ -528,6 +529,9 @@ parse_args(argc, argv) break; case 'm': defmailto = optarg; + break; + case 'n': + dont_daemonize = 1; break; case 'o': dst_enabled = 0; From owner-svn-src-stable-10@freebsd.org Wed Jul 19 20:24:40 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D741D7D86F; Wed, 19 Jul 2017 20:24:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478BD6AA4D; Wed, 19 Jul 2017 20:24:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JKOd78021568; Wed, 19 Jul 2017 20:24:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKOchu021562; Wed, 19 Jul 2017 20:24:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192024.v6JKOchu021562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321242 - in stable/10: etc/mtree usr.sbin/cron/cron usr.sbin/cron/lib X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree usr.sbin/cron/cron usr.sbin/cron/lib X-SVN-Commit-Revision: 321242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 20:24:40 -0000 Author: ngie Date: Wed Jul 19 20:24:38 2017 New Revision: 321242 URL: https://svnweb.freebsd.org/changeset/base/321242 Log: MFC r308139,r308157,r308158: r308139 (by bapt): cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d For automation tools it is way easier to maintain files in directories rather than modifying /etc/crontab. The files in those directories are in the same format as /etc/crontab Relnotes: yes r308157 (by bapt): Fix typo in cron(8) date r308158 (by bapt): Allow symlinks to be followed in cron.d directories and fix detection of regular files on NFS Modified: stable/10/etc/mtree/BSD.root.dist stable/10/usr.sbin/cron/cron/cron.8 stable/10/usr.sbin/cron/cron/cron.h stable/10/usr.sbin/cron/cron/database.c stable/10/usr.sbin/cron/cron/pathnames.h stable/10/usr.sbin/cron/lib/misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.root.dist ============================================================================== --- stable/10/etc/mtree/BSD.root.dist Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/etc/mtree/BSD.root.dist Wed Jul 19 20:24:38 2017 (r321242) @@ -30,6 +30,8 @@ .. bluetooth .. + cron.d + .. defaults .. devd Modified: stable/10/usr.sbin/cron/cron/cron.8 ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/cron.8 Wed Jul 19 20:24:38 2017 (r321242) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2016 +.Dd October 31, 2016 .Dt CRON 8 .Os .Sh NAME @@ -53,7 +53,11 @@ The .Nm utility also searches for .Pa /etc/crontab -which is in a different format (see +and files in +.Pa /etc/cron.d +and +.Pa /usr/local/etc/cron.d +which are in a different format (see .Xr crontab 5 ) . .Pp The Modified: stable/10/usr.sbin/cron/cron/cron.h ============================================================================== --- stable/10/usr.sbin/cron/cron/cron.h Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/cron.h Wed Jul 19 20:24:38 2017 (r321242) @@ -218,7 +218,7 @@ void set_cron_uid(void), unget_char(int, FILE *), free_entry(entry *), skip_comments(FILE *), - log_it(char *, int, char *, char *), + log_it(char *, int, char *, const char *), log_close(void); int job_runqueue(void), Modified: stable/10/usr.sbin/cron/cron/database.c ============================================================================== --- stable/10/usr.sbin/cron/cron/database.c Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/database.c Wed Jul 19 20:24:38 2017 (r321242) @@ -44,10 +44,19 @@ load_database(old_db) { DIR *dir; struct stat statbuf; - struct stat syscron_stat; + struct stat syscron_stat, st; + time_t maxmtime; DIR_T *dp; cron_db new_db; user *u, *nu; + struct { + const char *name; + struct stat st; + } syscrontabs [] = { + { SYSCRONTABS }, + { LOCALSYSCRONTABS } + }; + int i; Debug(DLOAD, ("[%d] load_database()\n", getpid())) @@ -65,6 +74,16 @@ load_database(old_db) if (stat(SYSCRONTAB, &syscron_stat) < OK) syscron_stat.st_mtime = 0; + maxmtime = TMAX(statbuf.st_mtime, syscron_stat.st_mtime); + + for (i = 0; i < nitems(syscrontabs); i++) { + if (stat(syscrontabs[i].name, &syscrontabs[i].st) != -1) { + maxmtime = TMAX(syscrontabs[i].st.st_mtime, maxmtime); + } else { + syscrontabs[i].st.st_mtime = 0; + } + } + /* if spooldir's mtime has not changed, we don't need to fiddle with * the database. * @@ -72,7 +91,7 @@ load_database(old_db) * so is guaranteed to be different than the stat() mtime the first * time this function is called. */ - if (old_db->mtime == TMAX(statbuf.st_mtime, syscron_stat.st_mtime)) { + if (old_db->mtime == maxmtime) { Debug(DLOAD, ("[%d] spool dir mtime unch, no load needed.\n", getpid())) return; @@ -83,13 +102,37 @@ load_database(old_db) * actually changed. Whatever is left in the old database when * we're done is chaff -- crontabs that disappeared. */ - new_db.mtime = TMAX(statbuf.st_mtime, syscron_stat.st_mtime); + new_db.mtime = maxmtime; new_db.head = new_db.tail = NULL; if (syscron_stat.st_mtime) { process_crontab("root", SYS_NAME, SYSCRONTAB, &syscron_stat, &new_db, old_db); + } + + for (i = 0; i < nitems(syscrontabs); i++) { + char tabname[MAXPATHLEN]; + if (syscrontabs[i].st.st_mtime == 0) + continue; + if (!(dir = opendir(syscrontabs[i].name))) { + log_it("CRON", getpid(), "OPENDIR FAILED", + syscrontabs[i].name); + (void) exit(ERROR_EXIT); + } + + while (NULL != (dp = readdir(dir))) { + if (dp->d_name[0] == '.') + continue; + if (fstatat(dirfd(dir), dp->d_name, &st, 0) == 0 && + !S_ISREG(st.st_mode)) + continue; + snprintf(tabname, sizeof(tabname), "%s/%s", + syscrontabs[i].name, dp->d_name); + process_crontab("root", SYS_NAME, tabname, + &syscrontabs[i].st, &new_db, old_db); + } + closedir(dir); } /* we used to keep this dir open all the time, for the sake of Modified: stable/10/usr.sbin/cron/cron/pathnames.h ============================================================================== --- stable/10/usr.sbin/cron/cron/pathnames.h Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/cron/pathnames.h Wed Jul 19 20:24:38 2017 (r321242) @@ -62,6 +62,8 @@ /* 4.3BSD-style crontab */ #define SYSCRONTAB "/etc/crontab" +#define SYSCRONTABS "/etc/cron.d" +#define LOCALSYSCRONTABS "/usr/local/etc/cron.d" /* what editor to use if no EDITOR or VISUAL * environment variable specified. Modified: stable/10/usr.sbin/cron/lib/misc.c ============================================================================== --- stable/10/usr.sbin/cron/lib/misc.c Wed Jul 19 20:22:16 2017 (r321241) +++ stable/10/usr.sbin/cron/lib/misc.c Wed Jul 19 20:24:38 2017 (r321242) @@ -385,11 +385,7 @@ out: if (allow) void -log_it(username, xpid, event, detail) - char *username; - int xpid; - char *event; - char *detail; +log_it(char *username, int xpid, char *event, const char *detail) { #if defined(LOG_FILE) || DEBUGGING PID_T pid = xpid; From owner-svn-src-stable-10@freebsd.org Wed Jul 19 20:26:36 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2B2D7D92A; Wed, 19 Jul 2017 20:26:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566656ABB0; Wed, 19 Jul 2017 20:26:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JKQZpd021717; Wed, 19 Jul 2017 20:26:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKQZ1m021715; Wed, 19 Jul 2017 20:26:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192026.v6JKQZ1m021715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321243 - stable/10/usr.sbin/cron/crontab X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/crontab X-SVN-Commit-Revision: 321243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 20:26:36 -0000 Author: ngie Date: Wed Jul 19 20:26:35 2017 New Revision: 321243 URL: https://svnweb.freebsd.org/changeset/base/321243 Log: MFC r310329: r310329 (by cem): Add a 'force' option for non-interactive crontab removal Add a '-f' option to force crontab '-r' to be non-interactive. Modified: stable/10/usr.sbin/cron/crontab/crontab.1 stable/10/usr.sbin/cron/crontab/crontab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/crontab/crontab.1 ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 20:24:38 2017 (r321242) +++ stable/10/usr.sbin/cron/crontab/crontab.1 Wed Jul 19 20:26:35 2017 (r321243) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd December 20, 2016 .Dt CRONTAB 1 .Os .Sh NAME @@ -31,7 +31,8 @@ .Op Fl u Ar user { .Fl l | -.Fl r | +.Fl r Op Fl f +| .Fl e } .Sh DESCRIPTION @@ -97,6 +98,11 @@ option for safety's sake. Display the current crontab on standard output. .It Fl r Remove the current crontab. +By default the +.Fl r +option prompts for confirmation, adding the +.Fl f +option will attempt to remove the current crontab without confirmation. .It Fl e Edit the current crontab using the editor specified by the Modified: stable/10/usr.sbin/cron/crontab/crontab.c ============================================================================== --- stable/10/usr.sbin/cron/crontab/crontab.c Wed Jul 19 20:24:38 2017 (r321242) +++ stable/10/usr.sbin/cron/crontab/crontab.c Wed Jul 19 20:26:35 2017 (r321243) @@ -63,6 +63,7 @@ static char Filename[MAX_FNAME]; static FILE *NewCrontab; static int CheckErrorCount; static enum opt_t Option; +static int fflag; static struct passwd *pw; static void list_cmd(void), delete_cmd(void), @@ -79,7 +80,7 @@ usage(char *msg) fprintf(stderr, "crontab: usage error: %s\n", msg); fprintf(stderr, "%s\n%s\n", "usage: crontab [-u user] file", - " crontab [-u user] { -e | -l | -r }"); + " crontab [-u user] { -l | -r [-f] | -e }"); exit(ERROR_EXIT); } @@ -142,7 +143,7 @@ parse_args(argc, argv) strcpy(RealUser, User); Filename[0] = '\0'; Option = opt_unknown; - while ((argch = getopt(argc, argv, "u:lerx:")) != -1) { + while ((argch = getopt(argc, argv, "u:lerx:f")) != -1) { switch (argch) { case 'x': if (!set_debug_flags(optarg)) @@ -172,6 +173,9 @@ parse_args(argc, argv) usage("only one operation permitted"); Option = opt_edit; break; + case 'f': + fflag = 1; + break; default: usage("unrecognized option"); } @@ -282,7 +286,7 @@ delete_cmd() { char n[MAX_FNAME]; int ch, first; - if (isatty(STDIN_FILENO)) { + if (!fflag && isatty(STDIN_FILENO)) { (void)fprintf(stderr, "remove crontab for %s? ", User); first = ch = getchar(); while (ch != '\n' && ch != EOF) From owner-svn-src-stable-10@freebsd.org Wed Jul 19 20:29:09 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2431CD7DA2B; Wed, 19 Jul 2017 20:29:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5B756AD55; Wed, 19 Jul 2017 20:29:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JKT8WD021870; Wed, 19 Jul 2017 20:29:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKT85g021869; Wed, 19 Jul 2017 20:29:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192029.v6JKT85g021869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321244 - stable/10/usr.sbin/cron/cron X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/cron/cron X-SVN-Commit-Revision: 321244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 20:29:09 -0000 Author: ngie Date: Wed Jul 19 20:29:07 2017 New Revision: 321244 URL: https://svnweb.freebsd.org/changeset/base/321244 Log: MFC r269550: r269550 (by peter): Check gethostname(2) return code - but even if it succeeds it may not null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet. Modified: stable/10/usr.sbin/cron/cron/do_command.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/10/usr.sbin/cron/cron/do_command.c Wed Jul 19 20:26:35 2017 (r321243) +++ stable/10/usr.sbin/cron/cron/do_command.c Wed Jul 19 20:29:07 2017 (r321244) @@ -484,14 +484,17 @@ child_process(e, u) auto char mailcmd[MAX_COMMAND]; auto char hostname[MAXHOSTNAMELEN]; - (void) gethostname(hostname, MAXHOSTNAMELEN); + if (gethostname(hostname, MAXHOSTNAMELEN) == -1) + hostname[0] = '\0'; + hostname[sizeof(hostname) - 1] = '\0'; (void) snprintf(mailcmd, sizeof(mailcmd), MAILARGS, MAILCMD); if (!(mail = cron_popen(mailcmd, "w", e))) { warn("%s", MAILCMD); (void) _exit(ERROR_EXIT); } - fprintf(mail, "From: %s (Cron Daemon)\n", usernm); + fprintf(mail, "From: Cron Daemon <%s@%s>\n", + usernm, hostname); fprintf(mail, "To: %s\n", mailto); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), From owner-svn-src-stable-10@freebsd.org Wed Jul 19 20:44:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3B5D7DFE1; Wed, 19 Jul 2017 20:44:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA3496B606; Wed, 19 Jul 2017 20:44:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JKioGh029676; Wed, 19 Jul 2017 20:44:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKioge029674; Wed, 19 Jul 2017 20:44:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192044.v6JKioge029674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321245 - in stable/10: etc/pam.d tools/build/mk X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/pam.d tools/build/mk X-SVN-Commit-Revision: 321245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 20:44:52 -0000 Author: ngie Date: Wed Jul 19 20:44:50 2017 New Revision: 321245 URL: https://svnweb.freebsd.org/changeset/base/321245 Log: MFC r269550: r269550 (by peter): Check gethostname(2) return code - but even if it succeeds it may not null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet. Modified: stable/10/etc/pam.d/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/pam.d/Makefile ============================================================================== --- stable/10/etc/pam.d/Makefile Wed Jul 19 20:29:07 2017 (r321244) +++ stable/10/etc/pam.d/Makefile Wed Jul 19 20:44:50 2017 (r321245) @@ -1,23 +1,34 @@ # $FreeBSD$ +.include + NO_OBJ= FILES= README \ - atrun \ cron \ - ftpd \ imap \ login \ other \ passwd pop3 \ rsh \ sshd su system \ - telnetd \ xdm +.if ${MK_AT} != "no" +FILES+= atrun +.endif + +.if ${MK_FTP} != "no" +FILES+= ftpd +LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp +.endif + +.if ${MK_TELNET} != "no" +FILES+= telnetd +.endif + FILESDIR= /etc/pam.d FILESMODE= 644 FILESMODE_README= 444 -LINKS= ${FILESDIR}/ftpd ${FILESDIR}/ftp .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:29:07 2017 (r321244) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 19 20:44:50 2017 (r321245) @@ -89,6 +89,7 @@ OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz .endif .if ${MK_AT} == no +OLD_FILES+=etc/pam.d/atrun OLD_FILES+=usr/bin/at OLD_FILES+=usr/bin/atq OLD_FILES+=usr/bin/atrm @@ -1063,6 +1064,8 @@ OLD_FILES+=usr/share/man/man8/fmtree.8.gz .if ${MK_FTP} == no OLD_FILES+=etc/ftpusers +OLD_FILES+=etc/pam.d/ftp +OLD_FILES+=etc/pam.d/ftpd OLD_FILES+=etc/rc.d/ftpd OLD_FILES+=usr/bin/ftp OLD_FILES+=usr/bin/gate-ftp @@ -4778,6 +4781,7 @@ OLD_FILES+=usr/share/nls/uk_UA.UTF-8/tcsh.cat .endif .if ${MK_TELNET} == no +OLD_FILES+=etc/pam.d/telnetd OLD_FILES+=usr/bin/telnet OLD_FILES+=usr/libexec/telnetd OLD_FILES+=usr/share/man/man1/telnet.1.gz From owner-svn-src-stable-10@freebsd.org Wed Jul 19 20:58:17 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FE5BD7E3FD; Wed, 19 Jul 2017 20:58:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2056C10C; Wed, 19 Jul 2017 20:58:17 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JKwGO6034521; Wed, 19 Jul 2017 20:58:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JKwGSW034520; Wed, 19 Jul 2017 20:58:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192058.v6JKwGSW034520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 20:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321249 - stable/10/lib/libc/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libc/gen X-SVN-Commit-Revision: 321249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 20:58:17 -0000 Author: ngie Date: Wed Jul 19 20:58:16 2017 New Revision: 321249 URL: https://svnweb.freebsd.org/changeset/base/321249 Log: MFC note: content changes of r317315 were reversed. .Dd is being updated for diff reduction purposes. MFC r317315,r317437: r317315: Note that getpagesize(3) can return -1 on failure r317437 (by kib): getpagesize(3) cannot fail. Modified: stable/10/lib/libc/gen/getpagesize.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getpagesize.3 ============================================================================== --- stable/10/lib/libc/gen/getpagesize.3 Wed Jul 19 20:57:41 2017 (r321248) +++ stable/10/lib/libc/gen/getpagesize.3 Wed Jul 19 20:58:16 2017 (r321249) @@ -28,7 +28,7 @@ .\" @(#)getpagesize.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd April 26, 2017 .Dt GETPAGESIZE 3 .Os .Sh NAME From owner-svn-src-stable-10@freebsd.org Wed Jul 19 21:06:06 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB421D7E66B; Wed, 19 Jul 2017 21:06:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB8E6C6C9; Wed, 19 Jul 2017 21:06:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JL65c6038768; Wed, 19 Jul 2017 21:06:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JL65or038767; Wed, 19 Jul 2017 21:06:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192106.v6JL65or038767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321251 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 321251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 21:06:06 -0000 Author: ngie Date: Wed Jul 19 21:06:05 2017 New Revision: 321251 URL: https://svnweb.freebsd.org/changeset/base/321251 Log: MFC note: only the newsyslog.conf.d change has been backported to unbreak "make distribution" with etc/newsyslog.conf.d/opensm.conf installation. The cron.d and syslog.d changes were omitted by request to avoid churn on ^/stable/{10,11}. Requested by: jhb, peter MFC r318545: Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install` I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file, and continued using it in r318441 and r318443. This will fix the files being handled improperly via installworld, preventing tools like etcupdate, mergemaster, etc from functioning properly when comparing the installed contents on a system vs the contents in a source tree when doing merges. PR: 219404 MFC with: r277541, r318441, r318443 Modified: stable/10/etc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/Makefile ============================================================================== --- stable/10/etc/Makefile Wed Jul 19 20:58:45 2017 (r321250) +++ stable/10/etc/Makefile Wed Jul 19 21:06:05 2017 (r321251) @@ -3,9 +3,6 @@ .include -SUBDIR= \ - newsyslog.conf.d - .if ${MK_SENDMAIL} != "no" SUBDIR+=sendmail .endif @@ -244,6 +241,7 @@ distribution: ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install + ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install .if ${MK_NTP} != "no" ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install .endif From owner-svn-src-stable-10@freebsd.org Wed Jul 19 21:19:30 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 369BED7EAF7; Wed, 19 Jul 2017 21:19:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF6256D256; Wed, 19 Jul 2017 21:19:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6JLJTc4043228; Wed, 19 Jul 2017 21:19:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6JLJT8J043227; Wed, 19 Jul 2017 21:19:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707192119.v6JLJT8J043227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Jul 2017 21:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321255 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 321255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2017 21:19:30 -0000 Author: ngie Date: Wed Jul 19 21:19:28 2017 New Revision: 321255 URL: https://svnweb.freebsd.org/changeset/base/321255 Log: Record-only merge for ^/head@r312419 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable-10@freebsd.org Thu Jul 20 00:33:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A7BD9B2A7; Thu, 20 Jul 2017 00:33:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C303E72AF2; Thu, 20 Jul 2017 00:33:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K0XCvM025226; Thu, 20 Jul 2017 00:33:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0XC9j025225; Thu, 20 Jul 2017 00:33:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200033.v6K0XC9j025225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321260 - stable/10/usr.sbin/periodic X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/usr.sbin/periodic X-SVN-Commit-Revision: 321260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 00:33:14 -0000 Author: ngie Date: Thu Jul 20 00:33:12 2017 New Revision: 321260 URL: https://svnweb.freebsd.org/changeset/base/321260 Log: MFC r320135: periodic(8): delete trailing whitespace Modified: stable/10/usr.sbin/periodic/periodic.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/periodic/periodic.sh ============================================================================== --- stable/10/usr.sbin/periodic/periodic.sh Thu Jul 20 00:33:04 2017 (r321259) +++ stable/10/usr.sbin/periodic/periodic.sh Thu Jul 20 00:33:12 2017 (r321260) @@ -30,7 +30,7 @@ if [ $# -lt 1 ] ; then usage fi -# If possible, check the global system configuration file, +# If possible, check the global system configuration file, # to see if there are additional dirs to check if [ -r /etc/defaults/periodic.conf ]; then . /etc/defaults/periodic.conf @@ -43,7 +43,7 @@ export host # If we were called normally, then create a lock file for each argument # in turn and reinvoke ourselves with the LOCKED argument. This prevents # very long running jobs from being overlapped by another run as this is -# will lead the system running progressivly slower and more and more jobs +# will lead the system running progressivly slower and more and more jobs # are run at once. if [ $1 != "LOCKED" ]; then ret=0 @@ -96,7 +96,7 @@ case $arg in /*) if [ -d "$arg" ]; then dirlist="$arg" else - echo "$0: $arg not found" >&2 + echo "$0: $arg not found" >&2 continue fi ;; From owner-svn-src-stable-10@freebsd.org Thu Jul 20 00:44:03 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59198D9B7B8; Thu, 20 Jul 2017 00:44:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2258E732F1; Thu, 20 Jul 2017 00:44:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K0i2n1029646; Thu, 20 Jul 2017 00:44:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0i1od029640; Thu, 20 Jul 2017 00:44:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200044.v6K0i1od029640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321263 - in stable/10/usr.sbin/newsyslog: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/newsyslog: . tests X-SVN-Commit-Revision: 321263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 00:44:03 -0000 Author: ngie Date: Thu Jul 20 00:44:01 2017 New Revision: 321263 URL: https://svnweb.freebsd.org/changeset/base/321263 Log: MFC r318960,r319545,r319546,r319548,r321261: r318960 (by dab): Add newsyslog capability to write RFC5424 compliant rotation message. This modification adds the capability to newsyslog to write the rotation message in a format that is compliant with RFC5424. This capability is enabled on a per-log file basis through a new value ("T") in the flags field in newsyslog.conf. This is useful on systems that use the RFC5424 format for log files so that the rotation message format matches that of the other log messages. There has been recent mention of adding an RFC5424 compliant mode to syslogd and at least one alternative system log daemon (rsyslogd) that already has the capability to use that format. Relnotes: yes r319545: Don't execute the TODO cases in a subshell This messes up the testcase counter, as seen in bug 219756. PR: 212160, 219756 r319546: Fix the testplan after ^/head@r318960 The number of executed testcases is 128, not 126. MFC with: r318960 r319548: Remove TODO for sub testcases added for bug 212160 On closer inspection, the past failures no longer occur on ^/head. PR: 212160 r321261: Clean up leading whitespace (convert single column spaces to hard tabs) Modified: stable/10/usr.sbin/newsyslog/extern.h stable/10/usr.sbin/newsyslog/newsyslog.8 stable/10/usr.sbin/newsyslog/newsyslog.c stable/10/usr.sbin/newsyslog/newsyslog.conf.5 stable/10/usr.sbin/newsyslog/ptimes.c stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/newsyslog/extern.h ============================================================================== --- stable/10/usr.sbin/newsyslog/extern.h Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/extern.h Thu Jul 20 00:44:01 2017 (r321263) @@ -60,6 +60,8 @@ int ptime_free(struct ptime_data *_ptime); int ptime_relparse(struct ptime_data *_ptime, int _parseopts, time_t _basetime, const char *_str); const char *ptimeget_ctime(const struct ptime_data *_ptime); +char *ptimeget_ctime_rfc5424(const struct ptime_data *_ptime, + char *timebuf, size_t bufsize); double ptimeget_diff(const struct ptime_data *_minuend, const struct ptime_data *_subtrahend); time_t ptimeget_secs(const struct ptime_data *_ptime); Modified: stable/10/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.8 Thu Jul 20 00:44:01 2017 (r321263) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd September 23, 2014 +.Dd May 19, 2017 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -125,7 +125,8 @@ reasons for either trimming that log or skipping it. Cause .Nm not to trim the logs, but to print out what it would do if this option -were not specified. This option implies the +were not specified. +This option implies the .Fl r option. .It Fl r Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Thu Jul 20 00:44:01 2017 (r321263) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -127,6 +128,8 @@ __FBSDID("$FreeBSD$"); #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ #define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ +#define CE_RFC5424 0x0800 /* Use RFC5424 format rotation message */ + #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -241,6 +244,15 @@ static struct ptime_data *timenow; /* The time to use #define DAYTIME_LEN 16 static char daytime[DAYTIME_LEN];/* The current time in human readable form, * used for rotation-tracking messages. */ + +/* Another buffer to hold the current time in RFC5424 format. Fractional + * seconds are allowed by the RFC, but are not included in the + * rotation-tracking messages written by newsyslog and so are not accounted for + * in the length below. + */ +#define DAYTIME_RFC5424_LEN sizeof("YYYY-MM-DDTHH:MM:SS+00:00") +static char daytime_rfc5424[DAYTIME_RFC5424_LEN]; + static char hostname[MAXHOSTNAMELEN]; /* hostname */ static const char *path_syslogpid = _PATH_SYSLOGPID; @@ -624,6 +636,7 @@ parse_args(int argc, char **argv) timenow = ptime_init(NULL); ptimeset_time(timenow, time(NULL)); strlcpy(daytime, ptimeget_ctime(timenow) + 4, DAYTIME_LEN); + ptimeget_ctime_rfc5424(timenow, daytime_rfc5424, DAYTIME_RFC5424_LEN); /* Let's get our hostname */ (void)gethostname(hostname, sizeof(hostname)); @@ -1304,11 +1317,14 @@ no_trimat: case 'r': working->flags |= CE_PID2CMD; break; + case 't': + working->flags |= CE_RFC5424; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; case 'w': - /* Depreciated flag - keep for compatibility purposes */ + /* Deprecated flag - keep for compatibility purposes */ break; case 'x': working->compress = COMPRESS_XZ; @@ -2106,7 +2122,7 @@ save_sigwork(const struct conf_entry *ent) tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - + stmp->sw_runcmd = 0; /* If this is a command to run we just set the flag and run command */ if (ent->flags & CE_PID2CMD) { @@ -2262,15 +2278,34 @@ log_trim(const char *logname, const struct conf_entry xtra = ""; if (log_ent->def_cfg) xtra = " using rule"; - if (log_ent->firstcreate) - fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", - daytime, hostname, (int) getpid(), xtra); - else if (log_ent->r_reason != NULL) - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", - daytime, hostname, (int) getpid(), log_ent->r_reason, xtra); - else - fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", - daytime, hostname, (int) getpid(), xtra); + if (log_ent->flags & CE_RFC5424) { + if (log_ent->firstcreate) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile first created", xtra); + } else if (log_ent->r_reason != NULL) { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", log_ent->r_reason, xtra); + } else { + fprintf(f, "<%d>1 %s %s newsyslog %d - - %s%s\n", + LOG_MAKEPRI(LOG_USER, LOG_INFO), + daytime_rfc5424, hostname, getpid(), + "logfile turned over", xtra); + } + } else { + if (log_ent->firstcreate) + fprintf(f, "%s %s newsyslog[%d]: logfile first created%s\n", + daytime, hostname, getpid(), xtra); + else if (log_ent->r_reason != NULL) + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s%s\n", + daytime, hostname, getpid(), log_ent->r_reason, xtra); + else + fprintf(f, "%s %s newsyslog[%d]: logfile turned over%s\n", + daytime, hostname, getpid(), xtra); + } if (fclose(f) == EOF) err(1, "log_trim: fclose"); return (0); Modified: stable/10/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/newsyslog.conf.5 Thu Jul 20 00:44:01 2017 (r321263) @@ -21,7 +21,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd October 24, 2015 +.Dd May 19, 2017 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -242,7 +242,7 @@ rotate at the first day of every month at midnight (i.e., the start of the day; same as .Li @01T00 ) .It Li $M5D6 -rotate on every 5th day of month at 6:00 +rotate on every fifth day of month at 6:00 (same as .Li @05T06 ) .El @@ -313,6 +313,11 @@ will run shell command defined in .Ar path_to_pid_cmd_file after rotation instead of trying to send signal to a process id stored in the file. +.It Cm T +if this flag is set the informational rotation message written to +the log file will be in the format specified by RFC5424. +Normally, the rotation message is written in the traditional (RFC3164) +syslog format. .It Cm U indicates that the file specified by .Ar path_to_pid_cmd_file @@ -389,6 +394,17 @@ entry: .Xr chown 8 , .Xr newsyslog 8 , .Xr syslogd 8 +.Pp +.Rs +.%A C. Lonvick +.%T The BSD syslog Protocol +.%O RFC3164 +.Re +.Rs +.%A R. Gerhards +.%T The Syslog Protocol +.%O RFC5424 +.Re .Sh HISTORY This manual page first appeared in .Fx 4.10 . Modified: stable/10/usr.sbin/newsyslog/ptimes.c ============================================================================== --- stable/10/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/ptimes.c Thu Jul 20 00:44:01 2017 (r321263) @@ -478,6 +478,75 @@ ptimeget_ctime(const struct ptime_data *ptime) return (ctime(&ptime->tsecs)); } +/* + * Generate a time of day string in an RFC5424 compatible format. Return a + * pointer to the buffer with the timestamp string or NULL if an error. If the + * time is not supplied, cannot be converted to local time, or the resulting + * string would overflow the buffer, the returned string will be the RFC5424 + * NILVALUE. + */ +char * +ptimeget_ctime_rfc5424(const struct ptime_data *ptime, + char *timebuf, size_t bufsize) +{ + static const char NILVALUE[] = {"-"}; /* RFC5424 specified NILVALUE */ + int chars; + struct tm tm; + int tz_hours; + int tz_mins; + long tz_offset; + char tz_sign; + + if (timebuf == NULL) { + return (NULL); + } + + if (bufsize < sizeof(NILVALUE)) { + return (NULL); + } + + /* + * Convert to localtime. RFC5424 mandates the use of the NILVALUE if + * the time cannot be obtained, so use that if there is an error in the + * conversion. + */ + if (ptime == NULL || localtime_r(&(ptime->tsecs), &tm) == NULL) { + strlcpy(timebuf, NILVALUE, bufsize); + return (timebuf); + } + + /* + * Convert the time to a string in RFC5424 format. The conversion + * cannot be done with strftime() because it cannot produce the correct + * timezone offset format. + */ + if (tm.tm_gmtoff < 0) { + tz_sign = '-'; + tz_offset = -tm.tm_gmtoff; + } else { + tz_sign = '+'; + tz_offset = tm.tm_gmtoff; + } + + tz_hours = tz_offset / 3600; + tz_mins = (tz_offset % 3600) / 60; + + chars = snprintf(timebuf, bufsize, + "%04d-%02d-%02d" /* date */ + "T%02d:%02d:%02d" /* time */ + "%c%02d:%02d", /* time zone offset */ + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + tz_sign, tz_hours, tz_mins); + + /* If the timestamp is too big for timebuf, return the NILVALUE. */ + if (chars >= (int)bufsize) { + strlcpy(timebuf, NILVALUE, bufsize); + } + + return (timebuf); +} + double ptimeget_diff(const struct ptime_data *minuend, const struct ptime_data *subtrahend) Modified: stable/10/usr.sbin/newsyslog/tests/legacy_test.sh ============================================================================== --- stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:41:46 2017 (r321262) +++ stable/10/usr.sbin/newsyslog/tests/legacy_test.sh Thu Jul 20 00:44:01 2017 (r321263) @@ -2,11 +2,20 @@ # $FreeBSD$ +# A regular expression matching the format of an RFC-5424 log line header, +# including the timestamp up through the seconds indicator; it does not include +# the (optional) timezone offset. +RFC5424_FMT='^<[0-9][0-9]*>1 [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' + +# A regular expression matching the format of an RFC-3164 (traditional syslog) +# log line header, including the timestamp. +RFC3164_FMT='^[A-Z][a-z]{2} [ 0-9][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}' + COUNT=0 TMPDIR=$(pwd)/work if [ $? -ne 0 ]; then - echo "$0: Can't create temp dir, exiting..." - exit 1 + echo "$0: Can't create temp dir, exiting..." + exit 1 fi # Begin an individual test @@ -89,8 +98,34 @@ ckntfe() fi } +# Verify that the specified file has RFC-5424 rotation messages. +ckrfc5424() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC5424_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} +# Verify that the specified file has RFC-3164 rotation messages. +ckrfc3164() +{ + local lc=$(wc -l $1 | cut -w -f2) + local rc=$(grep -cE "${RFC3164_FMT}" $1) + if [ "$lc" -eq 0 -o "$rc" -eq 0 -o "$lc" -ne "$rc" ] + then + notok + else + ok + fi +} + + # A part of a test succeeds ok() { @@ -368,13 +403,56 @@ tests_time_rotate() { tmpdir_clean } -echo 1..126 +tests_rfc5424() { + ext="$1" + dir="$2" + + if [ -n "$dir" ]; then + newsyslog_args=" -a ${dir}" + name_postfix="${ext} archive dir" + else + newsyslog_args="" + name_postfix="${ext}" + fi + + tmpdir_create + + begin "RFC-5424 - create file ${name_postfix}" -newdir + run_newsyslog -C + ckfe $LOGFNAME + cknt ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + cknt ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc5424 ${LOGFNAME5424} + end + + begin "RFC-5424 - rotate normal 1 ${name_postfix}" + run_newsyslog $newsyslog_args + ckfe ${LOGFNAME} + ckfe ${dir}${LOGFNAME}.0${ext} + ckfe $LOGFNAME5424 + ckfe ${dir}${LOGFNAME5424}.0${ext} + ckrfc3164 ${LOGFNAME} + ckrfc3164 ${dir}${LOGFNAME}.0${ext} + ckrfc5424 ${LOGFNAME5424} + ckrfc5424 ${dir}${LOGFNAME5424}.0${ext} + end + + tmpdir_clean +} + +echo 1..128 mkdir -p ${TMPDIR} cd ${TMPDIR} LOGFNAME=foo.log LOGFPATH=${TMPDIR}/log/${LOGFNAME} +# Log file for RFC-5424 testing +LOGFNAME5424=foo5424.log +LOGFPATH5424=${TMPDIR}/log/${LOGFNAME5424} + # Normal, no archive dir, keep X files echo "$LOGFPATH 640 0 * @T00 NC" > newsyslog.conf tests_normal_rotate_keepn 0 @@ -440,5 +518,10 @@ tests_time_rotate "gz" "${TMPDIR}/alog/" echo "$LOGFPATH 640 3 * @T00 NCJ" > newsyslog.conf tests_time_rotate "bz2" "${TMPDIR}/alog/" + +# RFC-5424; Normal, no archive dir +echo "$LOGFPATH5424 640 3 * @T00 NCT" > newsyslog.conf +echo "$LOGFPATH 640 3 * @T00 NC" >> newsyslog.conf +tests_rfc5424 rm -rf "${TMPDIR}" From owner-svn-src-stable-10@freebsd.org Thu Jul 20 00:48:05 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6621BD9B915; Thu, 20 Jul 2017 00:48:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33F2E73548; Thu, 20 Jul 2017 00:48:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K0m4ck029944; Thu, 20 Jul 2017 00:48:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0m4xw029943; Thu, 20 Jul 2017 00:48:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200048.v6K0m4xw029943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321265 - stable/10/sys/boot/common X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sys/boot/common X-SVN-Commit-Revision: 321265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 00:48:05 -0000 Author: ngie Date: Thu Jul 20 00:48:04 2017 New Revision: 321265 URL: https://svnweb.freebsd.org/changeset/base/321265 Log: MFC r316102: Wrap bootcamp DEBUG statement with curly braces This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined. Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Modified: stable/10/sys/boot/common/part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/part.c ============================================================================== --- stable/10/sys/boot/common/part.c Thu Jul 20 00:47:50 2017 (r321264) +++ stable/10/sys/boot/common/part.c Thu Jul 20 00:48:04 2017 (r321265) @@ -660,8 +660,9 @@ ptable_open(void *dev, off_t sectors, uint16_t sectors if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; DEBUG("Incorrect PMBR, ignore it"); - } else + } else { DEBUG("Bootcamp detected"); + } } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-stable-10@freebsd.org Thu Jul 20 00:52:14 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D290D9BBBA; Thu, 20 Jul 2017 00:52:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8A1073A10; Thu, 20 Jul 2017 00:52:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K0qDCd031659; Thu, 20 Jul 2017 00:52:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K0qCYt031648; Thu, 20 Jul 2017 00:52:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200052.v6K0qCYt031648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 00:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321267 - in stable/10/libexec: atrun ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/libexec: atrun ftpd hyperv mail.local smrsh talkd tcpd telnetd tftp-proxy ypxfr X-SVN-Commit-Revision: 321267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 00:52:14 -0000 Author: ngie Date: Thu Jul 20 00:52:11 2017 New Revision: 321267 URL: https://svnweb.freebsd.org/changeset/base/321267 Log: MFC r314653: libexec: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output Modified: stable/10/libexec/atrun/Makefile stable/10/libexec/ftpd/Makefile stable/10/libexec/hyperv/Makefile stable/10/libexec/mail.local/Makefile stable/10/libexec/smrsh/Makefile stable/10/libexec/talkd/Makefile stable/10/libexec/tcpd/Makefile stable/10/libexec/telnetd/Makefile stable/10/libexec/tftp-proxy/Makefile stable/10/libexec/ypxfr/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/atrun/Makefile ============================================================================== --- stable/10/libexec/atrun/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/atrun/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -MAINSRC=${.CURDIR}/../../usr.bin/at +MAINSRC=${SRCTOP}/usr.bin/at .include "${MAINSRC}/Makefile.inc" Modified: stable/10/libexec/ftpd/Makefile ============================================================================== --- stable/10/libexec/ftpd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/ftpd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -20,10 +20,9 @@ LDADD= -lutil -lcrypt DPADD+= ${LIBOPIE} ${LIBMD} LDADD+= -lopie -lmd -LSDIR= ../../bin/ls -.PATH: ${.CURDIR}/${LSDIR} +.PATH: ${SRCTOP}/bin/ls SRCS+= ls.c cmp.c print.c util.c -CFLAGS+=-Dmain=ls_main -I${.CURDIR}/${LSDIR} +CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls DPADD+= ${LIBM} LDADD+= -lm Modified: stable/10/libexec/hyperv/Makefile ============================================================================== --- stable/10/libexec/hyperv/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/hyperv/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/hyperv/tools/scripts +.PATH: ${SRCTOP}/contrib/hyperv/tools/scripts BINDIR= ${LIBEXECDIR}/hyperv Modified: stable/10/libexec/mail.local/Makefile ============================================================================== --- stable/10/libexec/mail.local/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/mail.local/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 7/19/93 # $FreeBSD$ -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/mail.local PROG= mail.local Modified: stable/10/libexec/smrsh/Makefile ============================================================================== --- stable/10/libexec/smrsh/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/smrsh/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 7/2/95 # $FreeBSD$ -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/smrsh PROG= smrsh Modified: stable/10/libexec/talkd/Makefile ============================================================================== --- stable/10/libexec/talkd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/talkd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -3,8 +3,8 @@ PROG= ntalkd SRCS= talkd.c announce.c process.c table.c print.c ttymsg.c -.PATH: ${.CURDIR}/../../usr.bin/wall +.PATH: ${SRCTOP}/usr.bin/wall MAN= talkd.8 -CFLAGS+=-I${.CURDIR}/../../usr.bin/wall +CFLAGS+=-I${SRCTOP}/usr.bin/wall .include Modified: stable/10/libexec/tcpd/Makefile ============================================================================== --- stable/10/libexec/tcpd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/tcpd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../contrib/tcp_wrappers +.PATH: ${SRCTOP}/contrib/tcp_wrappers PROG= tcpd MAN= tcpd.8 Modified: stable/10/libexec/telnetd/Makefile ============================================================================== --- stable/10/libexec/telnetd/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/telnetd/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -5,7 +5,7 @@ .include -TELNETDIR= ${.CURDIR}/../../contrib/telnet +TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/telnetd PROG= telnetd @@ -27,7 +27,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${TELNETDIR} CFLAGS+= -I${TELNETDIR}/telnet -LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a +LIBTELNET= ${OBJTOP}/lib/libtelnet/libtelnet.a DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} LDADD= -lutil -ltermcap ${LIBTELNET} Modified: stable/10/libexec/tftp-proxy/Makefile ============================================================================== --- stable/10/libexec/tftp-proxy/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/tftp-proxy/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/pf/tftp-proxy +.PATH: ${SRCTOP}/contrib/pf/tftp-proxy PROG= tftp-proxy SRCS= tftp-proxy.c filter.c Modified: stable/10/libexec/ypxfr/Makefile ============================================================================== --- stable/10/libexec/ypxfr/Makefile Thu Jul 20 00:50:01 2017 (r321266) +++ stable/10/libexec/ypxfr/Makefile Thu Jul 20 00:52:11 2017 (r321267) @@ -7,7 +7,7 @@ SRCS= yp_dblookup.c yp_dbwrite.c yp_error.c \ ${GENSRCS} GENSRCS=yp.h yp_clnt.c ypxfr_clnt.c -.PATH: ${.CURDIR}/../../usr.sbin/ypserv +.PATH: ${SRCTOP}/usr.sbin/ypserv MAN= ypxfr.8 @@ -21,7 +21,7 @@ LDADD= -lrpcsvc CLEANFILES= ${GENSRCS} -RPCDIR= ${.CURDIR}/../../include/rpcsvc +RPCDIR= ${SRCTOP}/include/rpcsvc RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C ypxfr_clnt.c: ${RPCDIR}/yp.x From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:01:19 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF18D9BE9A; Thu, 20 Jul 2017 01:01:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE2274072; Thu, 20 Jul 2017 01:01:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K11ION038263; Thu, 20 Jul 2017 01:01:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K11GkV038239; Thu, 20 Jul 2017 01:01:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200101.v6K11GkV038239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321270 - in stable/10/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfc... X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/cddl: lib/drti lib/libavl lib/libctf lib/libdtrace lib/libnvpair lib/libumem lib/libuutil lib/libzfs lib/libzfs_core lib/libzpool sbin/zfs sbin/zpool usr.bin/ctfconvert usr.bin/ctfdump us... X-SVN-Commit-Revision: 321270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:01:20 -0000 Author: ngie Date: Thu Jul 20 01:01:16 2017 New Revision: 321270 URL: https://svnweb.freebsd.org/changeset/base/321270 Log: MFC r314654: cddl: normalize paths using SRCTOP-relative paths or :H when possible This simplifies make logic/output While here, remove bogus CFLAGS which look for headers in cddl/lib/libumem. There aren't any source files there (just Makefiles) Modified: stable/10/cddl/lib/drti/Makefile stable/10/cddl/lib/libavl/Makefile stable/10/cddl/lib/libctf/Makefile stable/10/cddl/lib/libdtrace/Makefile stable/10/cddl/lib/libnvpair/Makefile stable/10/cddl/lib/libumem/Makefile stable/10/cddl/lib/libuutil/Makefile stable/10/cddl/lib/libzfs/Makefile stable/10/cddl/lib/libzfs_core/Makefile stable/10/cddl/lib/libzpool/Makefile stable/10/cddl/sbin/zfs/Makefile stable/10/cddl/sbin/zpool/Makefile stable/10/cddl/usr.bin/ctfconvert/Makefile stable/10/cddl/usr.bin/ctfdump/Makefile stable/10/cddl/usr.bin/ctfmerge/Makefile stable/10/cddl/usr.bin/zinject/Makefile stable/10/cddl/usr.bin/zlook/Makefile stable/10/cddl/usr.bin/zstreamdump/Makefile stable/10/cddl/usr.bin/ztest/Makefile stable/10/cddl/usr.sbin/dtrace/Makefile stable/10/cddl/usr.sbin/lockstat/Makefile stable/10/cddl/usr.sbin/plockstat/Makefile stable/10/cddl/usr.sbin/zdb/Makefile stable/10/cddl/usr.sbin/zhack/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/lib/drti/Makefile ============================================================================== --- stable/10/cddl/lib/drti/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/drti/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common SRCS= drti.c FILES= ${SRCS:R:S/$/.o/g} @@ -12,8 +12,8 @@ CLEANFILES= ${FILES} LIB= drti-dummy INTERNALLIB= -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ Modified: stable/10/cddl/lib/libavl/Makefile ============================================================================== --- stable/10/cddl/lib/libavl/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libavl/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= avl SRCS= avl.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/10/cddl/lib/libctf/Makefile ============================================================================== --- stable/10/cddl/lib/libctf/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libctf/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/ctf -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libctf/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/common/ctf +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/ctf LIB= ctf SRCS= ctf_create.c \ @@ -20,8 +20,8 @@ SRCS= ctf_create.c \ WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/common/ctf \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ Modified: stable/10/cddl/lib/libdtrace/Makefile ============================================================================== --- stable/10/cddl/lib/libdtrace/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libdtrace/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libgen/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common LIB= dtrace SRCS= dt_aggregate.c \ @@ -58,9 +58,9 @@ DSRCS= errno.d \ WARNS?= 1 CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ - -I${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ @@ -69,22 +69,22 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +CFLAGS+= -I${SRCTOP}/sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/i386 +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/x86 .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc .elif ${MACHINE_CPUARCH} == "mips" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/mips +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/mips .elif ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc -.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/powerpc +.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/powerpc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: stable/10/cddl/lib/libnvpair/Makefile ============================================================================== --- stable/10/cddl/lib/libnvpair/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libnvpair/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/nvpair +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/nvpair LIB= nvpair @@ -13,18 +13,18 @@ SRCS= libnvpair.c \ opensolaris_nvpair_alloc_fixed.c WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem # This library uses macros to define fprintf behavior for several object types # The compiler will see the non-string literal arguments to the fprintf calls and -# omit warnings for them. Quiesce these warnings in contrib code: +# omit warnings for them. Quiesce these warnings in contrib code: # # cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format # string is not a string literal (potentially insecure) [-Wformat-security] Modified: stable/10/cddl/lib/libumem/Makefile ============================================================================== --- stable/10/cddl/lib/libumem/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libumem/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +.PATH: ${SRCTOP}/cddl/compat/opensolaris/lib/libumem LIB= umem SRCS= umem.c WARNS?= 3 -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem .include Modified: stable/10/cddl/lib/libuutil/Makefile ============================================================================== --- stable/10/cddl/lib/libuutil/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libuutil/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/avl LIB= uutil SRCS= avl.c \ @@ -17,10 +17,10 @@ SRCS= avl.c \ WARNS?= 1 CFLAGS+= -DNATIVE_BUILD -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head .include Modified: stable/10/cddl/lib/libzfs/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzfs/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ @@ -45,20 +45,19 @@ SRCS+= libzfs_changelist.c \ WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common .include Modified: stable/10/cddl/lib/libzfs_core/Makefile ============================================================================== --- stable/10/cddl/lib/libzfs_core/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzfs_core/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/misc -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +.PATH: ${SRCTOP}/cddl/compat/opensolaris/misc +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs_core DPADD= ${LIBNVPAIR} @@ -19,20 +19,19 @@ SRCS+= libzfs_compat.c WARNS?= 0 CSTD= c99 CFLAGS+= -DZFS_NO_ACL -CFLAGS+= -I${.CURDIR}/../../../sbin/mount -CFLAGS+= -I${.CURDIR}/../../../cddl/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/sbin/mount +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common .include Modified: stable/10/cddl/lib/libzpool/Makefile ============================================================================== --- stable/10/cddl/lib/libzpool/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/lib/libzpool/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,28 +1,28 @@ # $FreeBSD$ -.include "${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/Makefile.files" +.include "${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/Makefile.files" # ZFS_COMMON_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs # ZFS_SHARED_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs # KERNEL_SRCS -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common # LIST_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/os # ATOMIC_SRCS -.if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} +.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S .if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack .endif .else -.PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern +.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c .endif # UNICODE_SRCS -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/unicode +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/unicode LIB= zpool @@ -37,24 +37,23 @@ SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} \ ${UNICODE_SRCS} WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair # XXX: pthread doesn't have mutex_owned() equivalent, so we need to look # into libthr private structures. That's sooo evil, but it's only for # ZFS debugging tools needs. CFLAGS+= -DWANTS_MUTEX_OWNED -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread -CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys -CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include +CFLAGS+= -I${SRCTOP}/lib/libpthread/thread +CFLAGS+= -I${SRCTOP}/lib/libpthread/sys +CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} ${LIBNVPAIR} \ ${LIBAVL} ${LIBUMEM} Modified: stable/10/cddl/sbin/zfs/Makefile ============================================================================== --- stable/10/cddl/sbin/zfs/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/sbin/zfs/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,26 +1,26 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zfs PROG= zfs MAN= zfs.8 SRCS= zfs_main.c zfs_iter.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} Modified: stable/10/cddl/sbin/zpool/Makefile ============================================================================== --- stable/10/cddl/sbin/zpool/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/sbin/zpool/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zpool -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zpool +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs PROG= zpool MAN= zpool.8 zpool-features.7 @@ -10,22 +10,22 @@ SRCS= zpool_main.c zpool_vdev.c zpool_iter.c zpool_uti SRCS+= timestamp.c WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libumem/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/cmd/stat/common DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \ ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} Modified: stable/10/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfconvert/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt DEBUG_FLAGS= -g @@ -27,8 +27,8 @@ SRCS= alist.c \ traverse.c \ util.c -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/10/cddl/usr.bin/ctfdump/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfdump/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/dump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/dump PROG= ctfdump SRCS= dump.c \ @@ -12,8 +12,8 @@ CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/cmd/mdb/tools/common \ - -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ + -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common Modified: stable/10/cddl/usr.bin/ctfmerge/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ctfmerge/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,7 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt PROG= ctfmerge SRCS= alist.c \ @@ -24,8 +24,8 @@ SRCS= alist.c \ WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR} \ -I${OPENSOLARIS_SYS_DISTDIR} \ -I${OPENSOLARIS_USR_DISTDIR}/head \ Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zinject/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,25 +1,24 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zinject +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zinject PROG= zinject SRCS= zinject.c translate.c MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs/ +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} Modified: stable/10/cddl/usr.bin/zlook/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zlook/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zlook/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,25 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zlook +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zlook PROG= zlook MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -#CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -#CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -#CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -#CFLAGS+= -I${.CURDIR}/../../lib/libumem -# -#DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \ -# ${LIBZFS} ${LIBZPOOL} -#LDADD= -lavl -lgeom -lm -lnvpair -lumem -luutil -lzfs -lzpool +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common .include Modified: stable/10/cddl/usr.bin/zstreamdump/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/zstreamdump/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/zstreamdump +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zstreamdump PROG= zstreamdump MAN= zstreamdump.1 WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ ${LIBPTHREAD} ${LIBZ} ${LIBAVL} Modified: stable/10/cddl/usr.bin/ztest/Makefile ============================================================================== --- stable/10/cddl/usr.bin/ztest/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.bin/ztest/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/ztest +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/ztest PROG= ztest MAN= WARNS?= 0 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \ ${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL} Modified: stable/10/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/dtrace/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace PROG= dtrace SRCS= dtrace.c @@ -8,8 +8,8 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ Modified: stable/10/cddl/usr.sbin/lockstat/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/lockstat/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/lockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/lockstat PROG= lockstat NO_MAN= @@ -9,14 +9,14 @@ BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/sys CFLAGS+= -DNEED_ERRLOC -g Modified: stable/10/cddl/usr.sbin/plockstat/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/plockstat/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,22 +1,22 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/plockstat +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/plockstat PROG= plockstat -SRCS= plockstat.c +SRCS= plockstat.c BINDIR?= /usr/sbin WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ + -I${SRCTOP}/cddl/compat/opensolaris/include \ -I${OPENSOLARIS_USR_DISTDIR}/head \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \ -I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -I${OPENSOLARIS_SYS_DISTDIR}/compat \ - -I${.CURDIR}/../../../cddl/lib/libdtrace \ - -I${.CURDIR}/../../../sys + -I${SRCTOP}/cddl/lib/libdtrace \ + -I${SRCTOP}/sys DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF}\ ${LIBELF} ${LIBZ} ${LIBRT} ${LIBRTLD_DB} ${LIBUTIL} Modified: stable/10/cddl/usr.sbin/zdb/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zdb/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/zdb/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zdb +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zdb PROG= zdb MAN= zdb.8 @@ -9,20 +9,19 @@ SRCS= zdb.c zdb_il.c WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} Modified: stable/10/cddl/usr.sbin/zhack/Makefile ============================================================================== --- stable/10/cddl/usr.sbin/zhack/Makefile Thu Jul 20 00:58:19 2017 (r321269) +++ stable/10/cddl/usr.sbin/zhack/Makefile Thu Jul 20 01:01:16 2017 (r321270) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack +.PATH: ${SRCTOP}/cddl/contrib/opensolaris/cmd/zhack PROG= zhack MAN= @@ -8,20 +8,19 @@ MAN= WARNS?= 0 CSTD= c99 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/../../lib/libumem +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libuutil/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \ ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL} From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:02:38 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84AA8D9D0D5; Thu, 20 Jul 2017 01:02:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5266A742F4; Thu, 20 Jul 2017 01:02:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K12bsD038437; Thu, 20 Jul 2017 01:02:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K12bJn038434; Thu, 20 Jul 2017 01:02:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200102.v6K12bJn038434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321272 - in stable/10/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/fifolog: fifolog_create fifolog_reader fifolog_writer X-SVN-Commit-Revision: 321272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:02:38 -0000 Author: ngie Date: Thu Jul 20 01:02:37 2017 New Revision: 321272 URL: https://svnweb.freebsd.org/changeset/base/321272 Log: MFC r314479: Use :H to manipulate .CURDIR-relative paths instead of ../ This simplifies make output Modified: stable/10/usr.sbin/fifolog/fifolog_create/Makefile stable/10/usr.sbin/fifolog/fifolog_reader/Makefile stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/fifolog/fifolog_create/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_create/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_create -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib DPADD= ${LIBFIFOLOG} ${LIBUTIL} LDADD= ${LIBFIFOLOG} -lutil Modified: stable/10/usr.sbin/fifolog/fifolog_reader/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_reader/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_reader -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= Modified: stable/10/usr.sbin/fifolog/fifolog_writer/Makefile ============================================================================== --- stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:02:30 2017 (r321271) +++ stable/10/usr.sbin/fifolog/fifolog_writer/Makefile Thu Jul 20 01:02:37 2017 (r321272) @@ -2,7 +2,7 @@ PROG= fifolog_writer -CFLAGS+= -I${.CURDIR}/../lib +CFLAGS+= -I${.CURDIR:H}/lib MAN= From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:03:51 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB71CD9D1E9; Thu, 20 Jul 2017 01:03:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A425745A7; Thu, 20 Jul 2017 01:03:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K13owq038644; Thu, 20 Jul 2017 01:03:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K13oU0038642; Thu, 20 Jul 2017 01:03:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200103.v6K13oU0038642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321274 - in stable/10/usr.sbin: rpc.lockd rpc.statd X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin: rpc.lockd rpc.statd X-SVN-Commit-Revision: 321274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:03:51 -0000 Author: ngie Date: Thu Jul 20 01:03:50 2017 New Revision: 321274 URL: https://svnweb.freebsd.org/changeset/base/321274 Log: MFC r314454,r314455: r314454: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. r314455: Use .ALLSRC instead of RPCSRC This is a trivial simplification in the Makefile, meant to serve as a good example for what to do with rules like this. Modified: stable/10/usr.sbin/rpc.lockd/Makefile stable/10/usr.sbin/rpc.statd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpc.lockd/Makefile ============================================================================== --- stable/10/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:03:43 2017 (r321273) +++ stable/10/usr.sbin/rpc.lockd/Makefile Thu Jul 20 01:03:50 2017 (r321274) @@ -18,10 +18,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C nlm_prot_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} nlm_prot.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: ${.CURDIR}/test.c cc -o test ${.CURDIR}/test.c -lrpcsvc Modified: stable/10/usr.sbin/rpc.statd/Makefile ============================================================================== --- stable/10/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:03:43 2017 (r321273) +++ stable/10/usr.sbin/rpc.statd/Makefile Thu Jul 20 01:03:50 2017 (r321274) @@ -16,10 +16,10 @@ RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C sm_inter_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${.ALLSRC} sm_inter.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} test: test.c cc -o test test.c -lrpcsvc From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:07:04 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DD8ED9D3C4; Thu, 20 Jul 2017 01:07:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283A774891; Thu, 20 Jul 2017 01:07:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K173XI038912; Thu, 20 Jul 2017 01:07:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K172Qd038901; Thu, 20 Jul 2017 01:07:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200107.v6K172Qd038901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321275 - in stable/10/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/usr.sbin/lpr: chkprintcap filters filters.ru/koi2855 filters.ru/koi2alt lpc lpd lpq lpr lprm lptest pac X-SVN-Commit-Revision: 321275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:07:04 -0000 Author: ngie Date: Thu Jul 20 01:07:02 2017 New Revision: 321275 URL: https://svnweb.freebsd.org/changeset/base/321275 Log: MFC r314475: Simplify idioms in usr.sbin/lpr Makefiles Use :H instead of .CURDIR-relative pathing to simplify make output, etc. Modified: stable/10/usr.sbin/lpr/chkprintcap/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile stable/10/usr.sbin/lpr/filters/Makefile stable/10/usr.sbin/lpr/lpc/Makefile stable/10/usr.sbin/lpr/lpd/Makefile stable/10/usr.sbin/lpr/lpq/Makefile stable/10/usr.sbin/lpr/lpr/Makefile stable/10/usr.sbin/lpr/lprm/Makefile stable/10/usr.sbin/lpr/lptest/Makefile stable/10/usr.sbin/lpr/pac/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/lpr/chkprintcap/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/chkprintcap/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= chkprintcap MAN= chkprintcap.8 SRCS= chkprintcap.c skimprintcap.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters.ru/koi2855/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= koi2855 MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters.ru/koi2alt/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= koi2alt MAN= -CFLAGS+= -I${.CURDIR}/../../common_source +CFLAGS+= -I${.CURDIR:H:H}/common_source .include Modified: stable/10/usr.sbin/lpr/filters/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/filters/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -6,6 +6,6 @@ BINDIR= ${LIBEXECDIR}/lpr PROG= lpf MAN= -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/10/usr.sbin/lpr/lpc/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpc/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= lpc MAN= lpc.8 @@ -9,7 +9,7 @@ SRCS= lpc.c cmds.c cmdtab.c movejobs.c BINGRP= daemon BINMODE= 2555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 0 Modified: stable/10/usr.sbin/lpr/lpd/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpd/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -5,7 +5,7 @@ PROG= lpd MAN= lpd.8 SRCS= lpd.c printjob.c recvjob.c lpdchar.c modes.c -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 1 Modified: stable/10/usr.sbin/lpr/lpq/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpq/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -8,7 +8,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/lpr/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lpr/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -11,7 +11,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source WARNS?= 2 Modified: stable/10/usr.sbin/lpr/lprm/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lprm/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source BINDIR= /usr/bin @@ -10,7 +10,7 @@ BINOWN= root BINGRP= daemon BINMODE= 6555 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} Modified: stable/10/usr.sbin/lpr/lptest/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/lptest/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -3,6 +3,6 @@ PROG= lptest -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source .include Modified: stable/10/usr.sbin/lpr/pac/Makefile ============================================================================== --- stable/10/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:03:50 2017 (r321274) +++ stable/10/usr.sbin/lpr/pac/Makefile Thu Jul 20 01:07:02 2017 (r321275) @@ -1,12 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -.PATH: ${.CURDIR}/../common_source +.PATH: ${.CURDIR:H}/common_source PROG= pac MAN= pac.8 -CFLAGS+= -I${.CURDIR}/../common_source +CFLAGS+= -I${.CURDIR:H}/common_source DPADD= ${LIBLPR} LDADD= ${LIBLPR} From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:12:32 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F1EED9DA22; Thu, 20 Jul 2017 01:12:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 292EB75057; Thu, 20 Jul 2017 01:12:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K1CVRh043075; Thu, 20 Jul 2017 01:12:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1CVKN043074; Thu, 20 Jul 2017 01:12:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200112.v6K1CVKN043074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321279 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 321279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:12:32 -0000 Author: ngie Date: Thu Jul 20 01:12:31 2017 New Revision: 321279 URL: https://svnweb.freebsd.org/changeset/base/321279 Log: MFC r278329: Document WITNESS_COUNT and WITNESS_NO_VNODE Modified: stable/10/share/man/man4/witness.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/witness.4 ============================================================================== --- stable/10/share/man/man4/witness.4 Thu Jul 20 01:11:58 2017 (r321278) +++ stable/10/share/man/man4/witness.4 Thu Jul 20 01:12:31 2017 (r321279) @@ -32,7 +32,9 @@ .Nd lock validation facility .Sh SYNOPSIS .Cd options WITNESS +.Cd options WITNESS_COUNT .Cd options WITNESS_KDB +.Cd options WITNESS_NO_VNODE .Cd options WITNESS_SKIPSPIN .Sh DESCRIPTION The @@ -55,6 +57,28 @@ code also checks various other conditions such as veri does not recurse on a non-recursive lock, or attempt an upgrade on a shared lock held by another thread. If any of these checks fail, then the kernel will panic. +.Pp +The +.Dv WITNESS_COUNT +kernel option controls the maximum number of +.Xr witness 4 +entries that are tracked in the kernel. +The maximum number of entries can be queried via the +.Va debug.witness.count +sysctl. +It can also be set from the +.Xr loader 8 +via the +.Va debug.witness.count +environment variable. +.Pp +The +.Dv WITNESS_NO_VNODE +kernel option tells +.Xr witness 4 +to ignore locking issues between +.Xr vnode 9 +objects. .Pp The flag that controls whether or not the kernel debugger is entered when a lock order violation is detected can be set in a variety of ways. From owner-svn-src-stable-10@freebsd.org Thu Jul 20 01:19:07 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 202A5D9E3A9; Thu, 20 Jul 2017 01:19:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E01FC755F9; Thu, 20 Jul 2017 01:19:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6K1J68Y043391; Thu, 20 Jul 2017 01:19:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6K1J6Nu043390; Thu, 20 Jul 2017 01:19:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707200119.v6K1J6Nu043390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Jul 2017 01:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321281 - stable/10/cddl/usr.sbin/dtrace/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/cddl/usr.sbin/dtrace/tests X-SVN-Commit-Revision: 321281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 01:19:07 -0000 Author: ngie Date: Thu Jul 20 01:19:05 2017 New Revision: 321281 URL: https://svnweb.freebsd.org/changeset/base/321281 Log: MFC r290570: Reduce the Makefile snippet complexity a bit - Set BINDIR to TESTSDIR globally (and subsequently, remove all `${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`) - Set MAN to "" globally, instead of per-PROG Modified: stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 ============================================================================== --- stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Thu Jul 20 01:13:09 2017 (r321280) +++ stable/10/cddl/usr.sbin/dtrace/tests/Makefile.inc1 Thu Jul 20 01:19:05 2017 (r321281) @@ -11,9 +11,6 @@ ${TESTGROUP}= ${TESTFILES} ${TESTGROUP}EXE= ${TESTEXES} ${TESTGROUP}EXEMODE= 0555 -${TESTGROUP}DIR= ${TESTSDIR} -${TESTGROUP}EXEDIR= ${TESTSDIR} - TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh" @@ -32,13 +29,14 @@ CLEANFILES+= ${TESTWRAPPER}.sh PROGS= ${CFILES:T:S/.c$/.exe/g} .for prog in ${PROGS} SRCS.${prog}+= ${prog:S/.exe$/.c/} -BINDIR.${prog}= ${TESTSDIR} -MAN.${prog}= .if exists(${prog:S/^tst.//:S/.exe$/.d/}) SRCS.${prog}+= ${prog:S/^tst.//:S/.exe$/.d/} .endif .endfor + +BINDIR= ${TESTSDIR} +MAN= # Some tests depend on the internals of their corresponding test programs, # so make sure the optimizer doesn't interfere with them. From owner-svn-src-stable-10@freebsd.org Thu Jul 20 11:37:03 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7856BC0A563; Thu, 20 Jul 2017 11:37:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478656796F; Thu, 20 Jul 2017 11:37:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KBb20V095286; Thu, 20 Jul 2017 11:37:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KBb20T095285; Thu, 20 Jul 2017 11:37:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707201137.v6KBb20T095285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Jul 2017 11:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321291 - stable/10/sys/geom X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/geom X-SVN-Commit-Revision: 321291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 11:37:03 -0000 Author: mav Date: Thu Jul 20 11:37:02 2017 New Revision: 321291 URL: https://svnweb.freebsd.org/changeset/base/321291 Log: MFC r320729: Add GEOM::descr attribute for symmetry with GEOM::ident. Modified: stable/10/sys/geom/geom_disk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu Jul 20 11:36:25 2017 (r321290) +++ stable/10/sys/geom/geom_disk.c Thu Jul 20 11:37:02 2017 (r321291) @@ -502,6 +502,8 @@ g_disk_start(struct bio *bp) break; else if (g_handleattr_str(bp, "GEOM::ident", dp->d_ident)) break; + else if (g_handleattr_str(bp, "GEOM::descr", dp->d_descr)) + break; else if (g_handleattr_uint16_t(bp, "GEOM::hba_vendor", dp->d_hba_vendor)) break; From owner-svn-src-stable-10@freebsd.org Thu Jul 20 20:16:19 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1ED7C7F5BF; Thu, 20 Jul 2017 20:16:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95EEA76CD1; Thu, 20 Jul 2017 20:16:19 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6KKGIFD010419; Thu, 20 Jul 2017 20:16:18 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6KKGI8r010411; Thu, 20 Jul 2017 20:16:18 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707202016.v6KKGI8r010411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 20 Jul 2017 20:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321304 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 321304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 20:16:19 -0000 Author: mm Date: Thu Jul 20 20:16:18 2017 New Revision: 321304 URL: https://svnweb.freebsd.org/changeset/base/321304 Log: MFC r320927,320931,320932: Bump libarchive to 3.3.2 Vendor changes: PR #901: don't depend on stdin in a testcase Relnotes: yes Modified: stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/NEWS Thu Jul 20 20:16:18 2017 (r321304) @@ -1,3 +1,5 @@ +Jul 09, 2017: libarchive 3.3.2 released + Mar 16, 2017: NFSv4 ACL support for Linux (librichacl) Feb 26, 2017: libarchive 3.3.1 released Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/archive.h Thu Jul 20 20:16:18 2017 (r321304) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3003001 +#define ARCHIVE_VERSION_NUMBER 3003002 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.3.1" +#define ARCHIVE_VERSION_ONLY_STRING "3.3.2" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Thu Jul 20 20:16:18 2017 (r321304) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3003001 +#define ARCHIVE_VERSION_NUMBER 3003002 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c Thu Jul 20 20:16:18 2017 (r321304) @@ -28,10 +28,12 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_archive_read_close_twice_open_filename) { + const char *filename = "empty.file"; struct archive* a = archive_read_new(); + assertMakeFile(filename, 0644, ""); assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a)); - assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, 0, 0)); + assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, filename, 0)); assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); Modified: stable/10/usr.bin/bsdcat/Makefile ============================================================================== --- stable/10/usr.bin/bsdcat/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/bsdcat/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -6,7 +6,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive _LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive PROG= bsdcat -BSDCAT_VERSION_STRING= 3.3.1 +BSDCAT_VERSION_STRING= 3.3.2 .PATH: ${_LIBARCHIVEDIR}/cat SRCS= bsdcat.c cmdline.c Modified: stable/10/usr.bin/cpio/Makefile ============================================================================== --- stable/10/usr.bin/cpio/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/cpio/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -6,7 +6,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive PROG= bsdcpio -BSDCPIO_VERSION_STRING= 3.3.1 +BSDCPIO_VERSION_STRING= 3.3.2 .PATH: ${LIBARCHIVEDIR}/cpio SRCS= cpio.c cmdline.c Modified: stable/10/usr.bin/tar/Makefile ============================================================================== --- stable/10/usr.bin/tar/Makefile Thu Jul 20 20:15:38 2017 (r321303) +++ stable/10/usr.bin/tar/Makefile Thu Jul 20 20:16:18 2017 (r321304) @@ -4,7 +4,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive PROG= bsdtar -BSDTAR_VERSION_STRING= 3.3.1 +BSDTAR_VERSION_STRING= 3.3.2 .PATH: ${LIBARCHIVEDIR}/tar SRCS= bsdtar.c \ From owner-svn-src-stable-10@freebsd.org Fri Jul 21 17:58:07 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A31ADADA08; Fri, 21 Jul 2017 17:58:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA237DA8B; Fri, 21 Jul 2017 17:58:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6LHw6il046465; Fri, 21 Jul 2017 17:58:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6LHw6jN046464; Fri, 21 Jul 2017 17:58:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707211758.v6LHw6jN046464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 21 Jul 2017 17:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321341 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 321341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jul 2017 17:58:07 -0000 Author: bdrewery Date: Fri Jul 21 17:58:06 2017 New Revision: 321341 URL: https://svnweb.freebsd.org/changeset/base/321341 Log: MFC r320273: Allow ALWAYS_BOOTSTRAP_MAKE to force bmake bootstrapping. Modified: stable/10/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Fri Jul 21 17:57:59 2017 (r321340) +++ stable/10/Makefile Fri Jul 21 17:58:06 2017 (r321341) @@ -156,7 +156,8 @@ HAVE_MAKE= bmake .else HAVE_MAKE= fmake .endif -.if ${HAVE_MAKE} != ${WANT_MAKE} || \ +.if defined(ALWAYS_BOOTSTRAP_MAKE) || \ + ${HAVE_MAKE} != ${WANT_MAKE} || \ (defined(WANT_MAKE_VERSION) && ${MAKE_VERSION} < ${WANT_MAKE_VERSION}) NEED_MAKE_UPGRADE= t .endif From owner-svn-src-stable-10@freebsd.org Sat Jul 22 04:57:52 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF3CC7F36C; Sat, 22 Jul 2017 04:57:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9636BDAB; Sat, 22 Jul 2017 04:57:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6M4vpKi016781; Sat, 22 Jul 2017 04:57:51 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6M4vpAv016779; Sat, 22 Jul 2017 04:57:51 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707220457.v6M4vpAv016779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 04:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321359 - in stable/10/sys: kern vm X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/10/sys: kern vm X-SVN-Commit-Revision: 321359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 04:57:52 -0000 Author: alc Date: Sat Jul 22 04:57:51 2017 New Revision: 321359 URL: https://svnweb.freebsd.org/changeset/base/321359 Log: MFC r320498 Clear the MAP_WIREFUTURE flag on the vm map in exec_new_vmspace() when it recycles the current vm space. Otherwise, an mlockall(MCL_FUTURE) could still be in effect on the process after an execve(2), which violates the specification for mlockall(2). It's pointless for vm_map_stack() to check the MEMLOCK limit. It will never be asked to wire the stack. Moreover, it doesn't even implement wiring of the stack. Modified: stable/10/sys/kern/kern_exec.c stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Sat Jul 22 04:20:08 2017 (r321358) +++ stable/10/sys/kern/kern_exec.c Sat Jul 22 04:57:51 2017 (r321359) @@ -1082,6 +1082,10 @@ exec_new_vmspace(imgp, sv) shmexit(vmspace); pmap_remove_pages(vmspace_pmap(vmspace)); vm_map_remove(map, vm_map_min(map), vm_map_max(map)); + /* An exec terminates mlockall(MCL_FUTURE). */ + vm_map_lock(map); + vm_map_modflags(map, 0, MAP_WIREFUTURE); + vm_map_unlock(map); } else { error = vmspace_exec(p, sv_minuser, sv->sv_maxuser); if (error) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat Jul 22 04:20:08 2017 (r321358) +++ stable/10/sys/vm/vm_map.c Sat Jul 22 04:57:51 2017 (r321359) @@ -3445,27 +3445,25 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c return (vm2); } +/* + * Create a process's stack for exec_new_vmspace(). This function is never + * asked to wire the newly created stack. + */ int vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_prot_t prot, vm_prot_t max, int cow) { vm_size_t growsize, init_ssize; - rlim_t lmemlim, vmemlim; + rlim_t vmemlim; int rv; + MPASS((map->flags & MAP_WIREFUTURE) == 0); growsize = sgrowsiz; init_ssize = (max_ssize < growsize) ? max_ssize : growsize; vm_map_lock(map); PROC_LOCK(curproc); - lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK); vmemlim = lim_cur(curproc, RLIMIT_VMEM); PROC_UNLOCK(curproc); - if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { - rv = KERN_NO_SPACE; - goto out; - } - } /* If we would blow our VMEM resource limit, no go */ if (map->size + init_ssize > vmemlim) { rv = KERN_NO_SPACE; From owner-svn-src-stable-10@freebsd.org Sat Jul 22 05:58:11 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A976CFC733; Sat, 22 Jul 2017 05:58:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 173616D714; Sat, 22 Jul 2017 05:58:11 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6M5wA86040807; Sat, 22 Jul 2017 05:58:10 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6M5wAGu040806; Sat, 22 Jul 2017 05:58:10 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707220558.v6M5wAGu040806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 05:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321361 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 321361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 05:58:11 -0000 Author: alc Date: Sat Jul 22 05:58:10 2017 New Revision: 321361 URL: https://svnweb.freebsd.org/changeset/base/321361 Log: MFC r315621 Use IDX_TO_OFF(), not ptoa(), when converting the difference between two vm_pindex_t's into a vm_ooffset_t. The length given to shm_dotruncate() must never be negative. Assert this. Tidy up a comment. Modified: stable/10/sys/kern/uipc_shm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_shm.c ============================================================================== --- stable/10/sys/kern/uipc_shm.c Sat Jul 22 05:26:29 2017 (r321360) +++ stable/10/sys/kern/uipc_shm.c Sat Jul 22 05:58:10 2017 (r321361) @@ -438,6 +438,7 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) vm_ooffset_t delta; int base, rv; + KASSERT(length >= 0, ("shm_dotruncate: length < 0")); object = shmfd->shm_object; VM_OBJECT_WLOCK(object); if (length == shmfd->shm_size) { @@ -503,7 +504,7 @@ retry: vm_pager_page_unswapped(m); } } - delta = ptoa(object->size - nobjsize); + delta = IDX_TO_OFF(object->size - nobjsize); /* Toss in memory pages. */ if (nobjsize < object->size) @@ -518,8 +519,8 @@ retry: swap_release_by_cred(delta, object->cred); object->charge -= delta; } else { - /* Attempt to reserve the swap */ - delta = ptoa(nobjsize - object->size); + /* Try to reserve additional swap space. */ + delta = IDX_TO_OFF(nobjsize - object->size); if (!swap_reserve_by_cred(delta, object->cred)) { VM_OBJECT_WUNLOCK(object); return (ENOMEM); From owner-svn-src-stable-10@freebsd.org Sat Jul 22 06:40:59 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F7B5CFD23E; Sat, 22 Jul 2017 06:40:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E2076E8C5; Sat, 22 Jul 2017 06:40:59 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6M6ewRJ056939; Sat, 22 Jul 2017 06:40:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6M6ew6N056937; Sat, 22 Jul 2017 06:40:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707220640.v6M6ew6N056937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 06:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321363 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 321363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 06:40:59 -0000 Author: alc Date: Sat Jul 22 06:40:57 2017 New Revision: 321363 URL: https://svnweb.freebsd.org/changeset/base/321363 Log: MFC r320546 When "force" is specified to pmap_invalidate_cache_range(), the given start address is not required to be page aligned. However, the loop within pmap_invalidate_cache_range() that performs the actual cache line invalidations requires that the starting address be truncated to a multiple of the cache line size. This change corrects an error in that truncation. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1807,7 +1807,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned")); Modified: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1245,7 +1245,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned")); From owner-svn-src-stable-10@freebsd.org Sat Jul 22 07:28:46 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11DF7CFDE45; Sat, 22 Jul 2017 07:28:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D48836FD30; Sat, 22 Jul 2017 07:28:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6M7Siqo077385; Sat, 22 Jul 2017 07:28:44 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6M7Sipd077384; Sat, 22 Jul 2017 07:28:44 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707220728.v6M7Sipd077384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 07:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321365 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 321365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 07:28:46 -0000 Author: alc Date: Sat Jul 22 07:28:44 2017 New Revision: 321365 URL: https://svnweb.freebsd.org/changeset/base/321365 Log: MFC r319756 Style and comment fixes Modified: stable/10/sys/sys/blist.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/blist.h ============================================================================== --- stable/10/sys/sys/blist.h Sat Jul 22 07:09:38 2017 (r321364) +++ stable/10/sys/sys/blist.h Sat Jul 22 07:28:44 2017 (r321365) @@ -67,7 +67,7 @@ typedef uint64_t u_daddr_t; /* unsigned disk address * #define SWAPBLK_NONE ((daddr_t)((u_daddr_t)SWAPBLK_MASK + 1))/* flag */ /* - * blmeta and bl_bitmap_t MUST be a power of 2 in size. + * Both blmeta and bmu_bitmap MUST be a power of 2 in size. */ typedef struct blmeta { @@ -91,13 +91,13 @@ typedef struct blist { #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX -extern blist_t blist_create(daddr_t blocks, int flags); -extern void blist_destroy(blist_t blist); -extern daddr_t blist_alloc(blist_t blist, daddr_t count); -extern void blist_free(blist_t blist, daddr_t blkno, daddr_t count); -extern daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count); -extern void blist_print(blist_t blist); -extern void blist_resize(blist_t *pblist, daddr_t count, int freenew, int flags); +daddr_t blist_alloc(blist_t blist, daddr_t count); +blist_t blist_create(daddr_t blocks, int flags); +void blist_destroy(blist_t blist); +daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count); +void blist_free(blist_t blist, daddr_t blkno, daddr_t count); +void blist_print(blist_t blist); +void blist_resize(blist_t *pblist, daddr_t count, int freenew, int flags); #endif /* _SYS_BLIST_H_ */ From owner-svn-src-stable-10@freebsd.org Sat Jul 22 17:49:19 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC6A2DA937F; Sat, 22 Jul 2017 17:49:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88FB4D32; Sat, 22 Jul 2017 17:49:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6MHnIF8035085; Sat, 22 Jul 2017 17:49:18 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6MHnIZA035083; Sat, 22 Jul 2017 17:49:18 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707221749.v6MHnIZA035083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 17:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321375 - in stable/10/sys: kern sys X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/10/sys: kern sys X-SVN-Commit-Revision: 321375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2017 17:49:19 -0000 Author: alc Date: Sat Jul 22 17:49:18 2017 New Revision: 321375 URL: https://svnweb.freebsd.org/changeset/base/321375 Log: MFC r319905 Reduce the frequency of hint updates on allocation without incurring additional allocation overhead. Previously, blst_meta_alloc() updated the hint after every successful allocation. However, these "eager" hint updates are of no actual benefit if, instead, the "lazy" hint update at the start of blst_meta_alloc() is generalized to handle all cases where the number of available blocks is less than the requested allocation. Previously, the lazy hint update at the start of blst_meta_alloc() only handled the ALL-FULL case. (I would also note that this change provides consistency between blist_alloc() and blist_fill() in that their hint maintenance is now entirely lazy.) Eliminate unnecessary checks for terminators in blst_meta_alloc() and blst_meta_fill() when handling ALL-FREE meta nodes. Eliminate the field "bl_free" from struct blist. It is redundant. Unless the entire radix tree is a single leaf, the count of free blocks is stored in the root node. Instead, provide a function blist_avail() for obtaining the number of free blocks. In blst_meta_alloc(), perform a sanity check on the allocation once rather than repeating it in a loop over the meta node's children. In blst_leaf_fill(), use the optimized bitcount*() function instead of a loop to count the blocks being allocated. Add or improve several comments. Address some nearby style errors. Modified: stable/10/sys/kern/subr_blist.c stable/10/sys/sys/blist.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_blist.c ============================================================================== --- stable/10/sys/kern/subr_blist.c Sat Jul 22 17:23:13 2017 (r321374) +++ stable/10/sys/kern/subr_blist.c Sat Jul 22 17:49:18 2017 (r321375) @@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define bitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) @@ -169,7 +170,7 @@ blist_create(daddr_t blocks, int flags) skip = (skip + 1) * BLIST_META_RADIX; } - bl = malloc(sizeof(struct blist), M_SWAP, flags | M_ZERO); + bl = malloc(sizeof(struct blist), M_SWAP, flags); if (bl == NULL) return (NULL); @@ -207,7 +208,7 @@ blist_destroy(blist_t bl) } /* - * blist_alloc() - reserve space in the block bitmap. Return the base + * blist_alloc() - reserve space in the block bitmap. Return the base * of a contiguous region or SWAPBLK_NONE if space could * not be allocated. */ @@ -215,20 +216,34 @@ blist_destroy(blist_t bl) daddr_t blist_alloc(blist_t bl, daddr_t count) { - daddr_t blk = SWAPBLK_NONE; + daddr_t blk; - if (bl) { + if (bl != NULL && count <= bl->bl_root->bm_bighint) { if (bl->bl_radix == BLIST_BMAP_RADIX) blk = blst_leaf_alloc(bl->bl_root, 0, count); else - blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, bl->bl_skip); - if (blk != SWAPBLK_NONE) - bl->bl_free -= count; + blk = blst_meta_alloc(bl->bl_root, 0, count, + bl->bl_radix, bl->bl_skip); + return (blk); } - return(blk); + return (SWAPBLK_NONE); } /* + * blist_avail() - return the number of free blocks. + */ + +daddr_t +blist_avail(blist_t bl) +{ + + if (bl->bl_radix == BLIST_BMAP_RADIX) + return (bitcount64(bl->bl_root->u.bmu_bitmap)); + else + return (bl->bl_root->u.bmu_avail); +} + +/* * blist_free() - free up space in the block bitmap. Return the base * of a contiguous region. Panic if an inconsistancy is * found. @@ -241,8 +256,8 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) if (bl->bl_radix == BLIST_BMAP_RADIX) blst_leaf_free(bl->bl_root, blkno, count); else - blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); - bl->bl_free += count; + blst_meta_free(bl->bl_root, blkno, count, + bl->bl_radix, bl->bl_skip, 0); } } @@ -264,10 +279,9 @@ blist_fill(blist_t bl, daddr_t blkno, daddr_t count) else filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); - bl->bl_free -= filled; - return filled; - } else - return 0; + return (filled); + } + return (0); } /* @@ -417,27 +431,32 @@ blst_meta_alloc( daddr_t radix, int skip ) { + daddr_t r; int i; int next_skip = ((u_int)skip / BLIST_META_RADIX); - if (scan->u.bmu_avail == 0) { + if (scan->u.bmu_avail < count) { /* - * ALL-ALLOCATED special case + * The meta node's hint must be too large if the allocation + * exceeds the number of free blocks. Reduce the hint, and + * return failure. */ - scan->bm_bighint = 0; - return(SWAPBLK_NONE); + scan->bm_bighint = scan->u.bmu_avail; + return (SWAPBLK_NONE); } + /* + * An ALL-FREE meta node requires special handling before allocating + * any of its blocks. + */ if (scan->u.bmu_avail == radix) { radix /= BLIST_META_RADIX; /* - * ALL-FREE special case, initialize uninitialize - * sublevel. + * Reinitialize each of the meta node's children. An ALL-FREE + * meta node cannot have a terminator in any subtree. */ for (i = 1; i <= skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; if (next_skip == 1) { scan[i].u.bmu_bitmap = (u_daddr_t)-1; scan[i].bm_bighint = BLIST_BMAP_RADIX; @@ -450,34 +469,33 @@ blst_meta_alloc( radix /= BLIST_META_RADIX; } + if (count > radix) { + /* + * The allocation exceeds the number of blocks that are + * managed by a subtree of this meta node. + */ + panic("allocation too large"); + } for (i = 1; i <= skip; i += next_skip) { if (count <= scan[i].bm_bighint) { /* - * count fits in object + * The allocation might fit in the i'th subtree. */ - daddr_t r; if (next_skip == 1) { r = blst_leaf_alloc(&scan[i], blk, count); } else { - r = blst_meta_alloc(&scan[i], blk, count, radix, next_skip - 1); + r = blst_meta_alloc(&scan[i], blk, count, + radix, next_skip - 1); } if (r != SWAPBLK_NONE) { scan->u.bmu_avail -= count; - if (scan->bm_bighint > scan->u.bmu_avail) - scan->bm_bighint = scan->u.bmu_avail; - return(r); + return (r); } } else if (scan[i].bm_bighint == (daddr_t)-1) { /* * Terminator */ break; - } else if (count > radix) { - /* - * count does not fit in object even if it were - * complete free. - */ - panic("blist_meta_alloc: allocation too large"); } blk += radix; } @@ -736,18 +754,16 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) { int n = blk & (BLIST_BMAP_RADIX - 1); daddr_t nblks; - u_daddr_t mask, bitmap; + u_daddr_t mask; mask = ((u_daddr_t)-1 << n) & ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); - /* Count the number of blocks we're about to allocate */ - bitmap = scan->u.bmu_bitmap & mask; - for (nblks = 0; bitmap != 0; nblks++) - bitmap &= bitmap - 1; + /* Count the number of blocks that we are allocating. */ + nblks = bitcount64(scan->u.bmu_bitmap & mask); scan->u.bmu_bitmap &= ~mask; - return nblks; + return (nblks); } /* @@ -771,8 +787,13 @@ blst_meta_fill( int next_skip = ((u_int)skip / BLIST_META_RADIX); daddr_t nblks = 0; - if (count > radix) - panic("blist_meta_fill: allocation too large"); + if (count > radix) { + /* + * The allocation exceeds the number of blocks that are + * managed by this meta node. + */ + panic("allocation too large"); + } if (count == radix || scan->u.bmu_avail == 0) { /* * ALL-ALLOCATED special case @@ -783,15 +804,18 @@ blst_meta_fill( return nblks; } + /* + * An ALL-FREE meta node requires special handling before allocating + * any of its blocks. + */ if (scan->u.bmu_avail == radix) { radix /= BLIST_META_RADIX; /* - * ALL-FREE special case, initialize sublevel + * Reinitialize each of the meta node's children. An ALL-FREE + * meta node cannot have a terminator in any subtree. */ for (i = 1; i <= skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; if (next_skip == 1) { scan[i].u.bmu_bitmap = (u_daddr_t)-1; scan[i].bm_bighint = BLIST_BMAP_RADIX; @@ -1020,7 +1044,7 @@ main(int ac, char **av) long long da = 0; long long count = 0; - printf("%lld/%lld/%lld> ", (long long)bl->bl_free, + printf("%lld/%lld/%lld> ", (long long)blist_avail(bl), (long long)size, (long long)bl->bl_radix); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) == NULL) Modified: stable/10/sys/sys/blist.h ============================================================================== --- stable/10/sys/sys/blist.h Sat Jul 22 17:23:13 2017 (r321374) +++ stable/10/sys/sys/blist.h Sat Jul 22 17:49:18 2017 (r321375) @@ -82,7 +82,6 @@ typedef struct blist { daddr_t bl_blocks; /* area of coverage */ daddr_t bl_radix; /* coverage radix */ daddr_t bl_skip; /* starting skip */ - daddr_t bl_free; /* number of free blocks */ blmeta_t *bl_root; /* root of radix tree */ } *blist_t; @@ -92,6 +91,7 @@ typedef struct blist { #define BLIST_MAX_ALLOC BLIST_BMAP_RADIX daddr_t blist_alloc(blist_t blist, daddr_t count); +daddr_t blist_avail(blist_t blist); blist_t blist_create(daddr_t blocks, int flags); void blist_destroy(blist_t blist); daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count);