From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 11 17:07:29 2014 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDAF7B65; Tue, 11 Feb 2014 17:07:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9915F178A; Tue, 11 Feb 2014 17:07:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1BH7Tf8090129; Tue, 11 Feb 2014 17:07:29 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1BH7T4B090127; Tue, 11 Feb 2014 17:07:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402111707.s1BH7T4B090127@svn.freebsd.org> From: Peter Wemm Date: Tue, 11 Feb 2014 17:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r261775 - stable/8/usr.bin/uname X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 17:07:29 -0000 Author: peter Date: Tue Feb 11 17:07:28 2014 New Revision: 261775 URL: http://svnweb.freebsd.org/changeset/base/261775 Log: MFC r256557 - kernel and userland osreldate helpers. Modified: stable/8/usr.bin/uname/uname.1 stable/8/usr.bin/uname/uname.c Modified: stable/8/usr.bin/uname/uname.1 ============================================================================== --- stable/8/usr.bin/uname/uname.1 Tue Feb 11 15:38:29 2014 (r261774) +++ stable/8/usr.bin/uname/uname.1 Tue Feb 11 17:07:28 2014 (r261775) @@ -32,7 +32,7 @@ .\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd February 11, 2014 .Dt UNAME 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd display information about the system .Sh SYNOPSIS .Nm -.Op Fl aimnoprsv +.Op Fl aiKmnoprsUv .Sh DESCRIPTION The .Nm @@ -59,6 +59,10 @@ and were specified. .It Fl i Write the kernel ident to standard output. +.It Fl K +Write the +.Fx +version of the kernel. .It Fl m Write the type of the current hardware platform to standard output. .It Fl n @@ -74,6 +78,10 @@ Write the current release level of the o to standard output. .It Fl s Write the name of the operating system implementation to standard output. +.It Fl U +Write the +.Fx +version of the user environment. .It Fl v Write the version level of this release of the operating system to standard output. @@ -83,6 +91,14 @@ If the .Fl a flag is specified, or multiple flags are specified, all output is written on a single line, separated by spaces. +.Pp +The +.Fl K +and +.Fl U +flags are intended to be used for fine grain differentiation of incremental +.Fx +development and user visible changes. .Sh ENVIRONMENT An environment variable composed of the string .Ev UNAME_ @@ -95,6 +111,8 @@ of the environment variable. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO +.Xr feature_present 3 , +.Xr getosreldate 3 , .Xr sysctl 3 , .Xr uname 3 , .Xr sysctl 8 @@ -108,3 +126,11 @@ specification. The .Nm command appeared in PWB UNIX. +.Pp +The +.Fl K +and +.Fl U +extension flags were first released in +.Fx 10.0 +and then ported back to older stable branches. Modified: stable/8/usr.bin/uname/uname.c ============================================================================== --- stable/8/usr.bin/uname/uname.c Tue Feb 11 15:38:29 2014 (r261774) +++ stable/8/usr.bin/uname/uname.c Tue Feb 11 17:07:28 2014 (r261775) @@ -54,6 +54,8 @@ static const char sccsid[] = "@(#)uname. #include #include +#include + #define MFLAG 0x01 #define NFLAG 0x02 #define PFLAG 0x04 @@ -61,9 +63,12 @@ static const char sccsid[] = "@(#)uname. #define SFLAG 0x10 #define VFLAG 0x20 #define IFLAG 0x40 +#define UFLAG 0x80 +#define KFLAG 0x100 typedef void (*get_t)(void); -get_t get_ident, get_platform, get_hostname, get_arch, get_release, get_sysname, get_version; +get_t get_ident, get_platform, get_hostname, get_arch, + get_release, get_sysname, get_kernvers, get_uservers, get_version; void native_ident(void); void native_platform(void); @@ -72,11 +77,13 @@ void native_arch(void); void native_release(void); void native_sysname(void); void native_version(void); +void native_kernvers(void); +void native_uservers(void); void print_uname(u_int); void setup_get(void); void usage(void); -char *ident, *platform, *hostname, *arch, *release, *sysname, *version; +char *ident, *platform, *hostname, *arch, *release, *sysname, *version, *kernvers, *uservers; int space; int @@ -88,7 +95,7 @@ main(int argc, char *argv[]) setup_get(); flags = 0; - while ((ch = getopt(argc, argv, "aimnoprsv")) != -1) + while ((ch = getopt(argc, argv, "aiKmnoprsUv")) != -1) switch(ch) { case 'a': flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG); @@ -96,6 +103,9 @@ main(int argc, char *argv[]) case 'i': flags |= IFLAG; break; + case 'K': + flags |= KFLAG; + break; case 'm': flags |= MFLAG; break; @@ -112,6 +122,9 @@ main(int argc, char *argv[]) case 'o': flags |= SFLAG; break; + case 'U': + flags |= UFLAG; + break; case 'v': flags |= VFLAG; break; @@ -152,6 +165,8 @@ setup_get(void) CHECK_ENV("m", platform); CHECK_ENV("p", arch); CHECK_ENV("i", ident); + CHECK_ENV("K", kernvers); + CHECK_ENV("U", uservers); } #define PRINT_FLAG(flags,flag,var) \ @@ -175,6 +190,8 @@ print_uname(u_int flags) PRINT_FLAG(flags, MFLAG, platform); PRINT_FLAG(flags, PFLAG, arch); PRINT_FLAG(flags, IFLAG, ident); + PRINT_FLAG(flags, KFLAG, kernvers); + PRINT_FLAG(flags, UFLAG, uservers); printf("\n"); } @@ -243,8 +260,26 @@ NATIVE_SYSCTLNAME_GET(ident, "kern.ident } NATIVE_SET; void +native_uservers(void) +{ + static char buf[128]; + + snprintf(buf, sizeof(buf), "%d", __FreeBSD_version); + uservers = buf; +} + +void +native_kernvers(void) +{ + static char buf[128]; + + snprintf(buf, sizeof(buf), "%d", getosreldate()); + kernvers = buf; +} + +void usage(void) { - fprintf(stderr, "usage: uname [-aimnoprsv]\n"); + fprintf(stderr, "usage: uname [-aiKmnoprsUv]\n"); exit(1); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 13 04:55:46 2014 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CCEE93C; Thu, 13 Feb 2014 04:55:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 874741749; Thu, 13 Feb 2014 04:55:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1D4tk8f074169; Thu, 13 Feb 2014 04:55:46 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1D4tkiD074168; Thu, 13 Feb 2014 04:55:46 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402130455.s1D4tkiD074168@svn.freebsd.org> From: Mark Johnston Date: Thu, 13 Feb 2014 04:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r261822 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Feb 2014 04:55:46 -0000 Author: markj Date: Thu Feb 13 04:55:46 2014 New Revision: 261822 URL: http://svnweb.freebsd.org/changeset/base/261822 Log: MFC r257600: Initialize the struct tm before handing it to strptime(3). Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Thu Feb 13 04:55:18 2014 (r261821) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Thu Feb 13 04:55:46 2014 (r261822) @@ -1486,6 +1486,7 @@ validate_old_timelog(int fd, const struc &dp->d_name[logfname_len]); return (0); } + memset(tm, 0, sizeof(*tm)); if ((s = strptime(&dp->d_name[logfname_len + 1], timefnamefmt, tm)) == NULL) { /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 14 08:26:06 2014 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D90D233; Fri, 14 Feb 2014 08:26:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7685B1C48; Fri, 14 Feb 2014 08:26:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1E8Q6Ux026528; Fri, 14 Feb 2014 08:26:06 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1E8Q62D026527; Fri, 14 Feb 2014 08:26:06 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402140826.s1E8Q62D026527@svn.freebsd.org> From: Christian Brueffer Date: Fri, 14 Feb 2014 08:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r261878 - stable/8/share/man/man4 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Feb 2014 08:26:06 -0000 Author: brueffer Date: Fri Feb 14 08:26:05 2014 New Revision: 261878 URL: http://svnweb.freebsd.org/changeset/base/261878 Log: MFC: r261584 In IPv6 code examples, use the correct v6 socket. Modified: stable/8/share/man/man4/multicast.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/multicast.4 ============================================================================== --- stable/8/share/man/man4/multicast.4 Fri Feb 14 08:22:57 2014 (r261877) +++ stable/8/share/man/man4/multicast.4 Fri Feb 14 08:26:05 2014 (r261878) @@ -326,7 +326,7 @@ mc.mf6cc_parent = iif_index; for (i = 0; i < maxvifs; i++) if (oifs_ttl[i] > 0) IF_SET(i, &mc.mf6cc_ifset); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_ADD_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_ADD_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp @@ -365,7 +365,7 @@ struct mf6cctl mc; memset(&mc, 0, sizeof(mc)); memcpy(&mc.mf6cc_origin, &source_addr, sizeof(mc.mf6cc_origin)); memcpy(&mc.mf6cc_mcastgrp, &group_addr, sizeof(mf6cc_mcastgrp)); -setsockopt(mrouter_s4, IPPROTO_IPV6, MRT6_DEL_MFC, +setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_DEL_MFC, (void *)&mc, sizeof(mc)); .Ed .Pp