CVS commit: src/lib/libc/sys

2014-03-28 Thread Arnaud Degroote
Module Name:src
Committed By:   degroote
Date:   Fri Mar 28 15:03:41 UTC 2014

Modified Files:
src/lib/libc/sys: clock_settime.2

Log Message:
Document a bit CLOCK_VIRTUAL and CLOCK_PROF


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/sys/clock_settime.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/clock_settime.2
diff -u src/lib/libc/sys/clock_settime.2:1.20 src/lib/libc/sys/clock_settime.2:1.21
--- src/lib/libc/sys/clock_settime.2:1.20	Wed Mar 11 13:39:14 2009
+++ src/lib/libc/sys/clock_settime.2	Fri Mar 28 15:03:41 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: clock_settime.2,v 1.20 2009/03/11 13:39:14 joerg Exp $
+.\ $NetBSD: clock_settime.2,v 1.21 2014/03/28 15:03:41 degroote Exp $
 .\
 .\ Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -105,6 +105,20 @@ error if it's the clock specified in a c
 .Fn clock_settime .
 The origin of the clock is unspecified.
 .Pp
+A
+.Fa clock_id
+of
+.Dv CLOCK_VIRTUAL
+identifies a clock that increments only when the CPU is running in
+user mode on behalf of the calling process.
+.Pp
+A
+.Fa clock_id
+of
+.Dv CLOCK_PROF
+identifies a clock that increments when the CPU is running in user 
+or kernel mode on behalf of the calling process.
+.Pp
 If the calling user is not the super-user, then the
 .Fn clock_settime
 function in the standard C library will try to use the



CVS commit: src/sbin/ifconfig

2014-01-07 Thread Arnaud Degroote
Module Name:src
Committed By:   degroote
Date:   Tue Jan  7 20:25:24 UTC 2014

Modified Files:
src/sbin/ifconfig: ieee80211.c ifconfig.8

Log Message:
Before scanning, check if the card is up. If it is not the case, exit
with some useful error message. Add some note about this fact in the man
page too.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/ifconfig/ieee80211.c
cvs rdiff -u -r1.105 -r1.106 src/sbin/ifconfig/ifconfig.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/ieee80211.c
diff -u src/sbin/ifconfig/ieee80211.c:1.25 src/sbin/ifconfig/ieee80211.c:1.26
--- src/sbin/ifconfig/ieee80211.c:1.25	Mon Dec 13 17:35:08 2010
+++ src/sbin/ifconfig/ieee80211.c	Tue Jan  7 20:25:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211.c,v 1.25 2010/12/13 17:35:08 pooka Exp $	*/
+/*	$NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ieee80211.c,v 1.25 2010/12/13 17:35:08 pooka Exp $);
+__RCSID($NetBSD: ieee80211.c,v 1.26 2014/01/07 20:25:24 degroote Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -463,8 +463,19 @@ setifpowersavesleep(prop_dictionary_t en
 static int
 scan_exec(prop_dictionary_t env, prop_dictionary_t oenv)
 {
+	struct ifreq ifr;
+
+	if (direct_ioctl(env, SIOCGIFFLAGS, ifr) == -1) {
+		perror(ioctl(SIOCGIFFLAGS);
+		return -1;
+	}
+
+	if ((ifr.ifr_flags  IFF_UP) == 0) 
+		errx(EXIT_FAILURE, The interface must be up before scanning.);
+
 	scan_and_wait(env);
 	list_scan(env);
+
 	return 0;
 }
 

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.105 src/sbin/ifconfig/ifconfig.8:1.106
--- src/sbin/ifconfig/ifconfig.8:1.105	Sat Nov  9 13:10:35 2013
+++ src/sbin/ifconfig/ifconfig.8	Tue Jan  7 20:25:24 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: ifconfig.8,v 1.105 2013/11/09 13:10:35 kefren Exp $
+.\	$NetBSD: ifconfig.8,v 1.106 2014/01/07 20:25:24 degroote Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -503,6 +503,7 @@ The
 flag may be used to display long SSIDs.
 .Fl v
 also causes received information elements to be displayed symbolically.
+The interface must be up before any scanning operation.
 Only the super-user can use this command.
 .It Cm tunnel Ar src_addr Ns Oo Ar ,src_port Oc Ar dest_addr Ns Oo Ar ,dest_port
 .Oc



CVS commit: src/sys/netipsec

2013-12-24 Thread Arnaud Degroote
Module Name:src
Committed By:   degroote
Date:   Tue Dec 24 13:57:06 UTC 2013

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
fix a typo in the log ouput of ipsec4_get_policy


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/netipsec/ipsec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.60 src/sys/netipsec/ipsec.c:1.61
--- src/sys/netipsec/ipsec.c:1.60	Sat Jun  8 13:50:22 2013
+++ src/sys/netipsec/ipsec.c	Tue Dec 24 13:57:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.60 2013/06/08 13:50:22 rmind Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.61 2013/12/24 13:57:06 degroote Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipsec.c,v 1.60 2013/06/08 13:50:22 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipsec.c,v 1.61 2013/12/24 13:57:06 degroote Exp $);
 
 /*
  * IPsec controller part.
@@ -1611,7 +1611,7 @@ ipsec4_get_policy(struct inpcb *inp, con
 		policy = inp-inp_sp-sp_out;
 		break;
 	default:
-		ipseclog((LOG_ERR, ipsec4_set_policy: invalid direction=%u\n,
+		ipseclog((LOG_ERR, ipsec4_get_policy: invalid direction=%u\n,
 			xpl-sadb_x_policy_dir));
 		return EINVAL;
 	}



CVS commit: src/include

2013-11-21 Thread Arnaud Degroote
Module Name:src
Committed By:   degroote
Date:   Thu Nov 21 09:09:53 UTC 2013

Modified Files:
src/include: wchar.h

Log Message:
Expose properly vfwscanf and friends for POSIX_SOURCE = 200112L


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/include/wchar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/wchar.h
diff -u src/include/wchar.h:1.39 src/include/wchar.h:1.40
--- src/include/wchar.h:1.39	Mon Aug 19 08:03:33 2013
+++ src/include/wchar.h	Thu Nov 21 09:09:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar.h,v 1.39 2013/08/19 08:03:33 joerg Exp $	*/
+/*	$NetBSD: wchar.h,v 1.40 2013/11/21 09:09:52 degroote Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -145,7 +145,8 @@ long int wcstol(const wchar_t * __restri
 double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
 
 #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0)  199901L || \
-defined(_NETBSD_SOURCE)
+defined(_NETBSD_SOURCE) || \
+	(_POSIX_C_SOURCE - 0) = 200112L || (_XOPEN_SOURCE - 0) = 600
 float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
 long double wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
 
@@ -181,7 +182,8 @@ int vwprintf(const wchar_t * __restrict,
 int wprintf(const wchar_t * __restrict, ...);
 int wscanf(const wchar_t * __restrict, ...);
 #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0)  199901L || \
-defined(_NETBSD_SOURCE)
+defined(_NETBSD_SOURCE) || \
+	(_POSIX_C_SOURCE - 0) = 200112L || (_XOPEN_SOURCE - 0) = 600
 int vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list);
 int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
 __va_list);