From nobody@FreeBSD.org  Mon Oct 24 09:07:19 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E4EB106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2011 09:07:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D9748FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2011 09:07:19 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9O97Jns081458
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2011 09:07:19 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p9O97JxF081457;
	Mon, 24 Oct 2011 09:07:19 GMT
	(envelope-from nobody)
Message-Id: <201110240907.p9O97JxF081457@red.freebsd.org>
Date: Mon, 24 Oct 2011 09:07:19 GMT
From: Henning Petersen <henning.petersen@t-online.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Add keyword restrict to glob().
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         161958
>Category:       kern
>Synopsis:       [libc] [patch] Add keyword restrict to glob(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 24 09:10:01 UTC 2011
>Closed-Date:    Sun Jan 08 21:23:53 UTC 2012
>Last-Modified:  Sun Jan 08 21:23:53 UTC 2012
>Originator:     Henning Petersen
>Release:        FreeBSD-current
>Organization:
>Environment:
>Description:
Add keyword restrict to glob().
>How-To-Repeat:

>Fix:
diff -u -r1.28 glob.c
--- lib/libc/gen/glob.c	12 May 2010 17:44:00 -0000	1.28
+++ lib/libc/gen/glob.c	24 Oct 2011 06:33:08 -0000
@@ -163,7 +163,8 @@
 #endif
 
 int
-glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
+glob(const char * __restrict pattern, int flags,
+	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
 {
 	const char *patnext;
 	size_t limit;
@@ -717,7 +718,7 @@
 			free(pglob->gl_pathv);
 			pglob->gl_pathv = NULL;
 		}
-		return(GLOB_NOSPACE);
+		return (GLOB_NOSPACE);
 	}
 
 	if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {


===============================================================================
diff -u -r1.11 glob.h
--- include/glob.h	16 Feb 2010 19:39:50 -0000	1.11
+++ include/glob.h	24 Oct 2011 05:48:35 -0000
@@ -98,7 +98,8 @@
 #endif /* __BSD_VISIBLE */
 
 __BEGIN_DECLS
-int	glob(const char *, int, int (*)(const char *, int), glob_t *);
+int	glob(const char * __restrict, int,
+	int (*)(const char *, int), glob_t * __restrict);
 void	globfree(glob_t *);
 __END_DECLS
 
================================================================================
diff -u -r1.34 glob.3
--- lib/libc/gen/glob.3	15 Feb 2011 20:07:35 -0000	1.34
+++ lib/libc/gen/glob.3	24 Oct 2011 05:50:17 -0000
@@ -42,7 +42,7 @@
 .Sh SYNOPSIS
 .In glob.h
 .Ft int
-.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
+.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob"
 .Ft void
 .Fn globfree "glob_t *pglob"
 .Sh DESCRIPTION




Patch attached with submission follows:

diff -u -r1.28 glob.c
--- lib/libc/gen/glob.c	12 May 2010 17:44:00 -0000	1.28
+++ lib/libc/gen/glob.c	24 Oct 2011 06:33:08 -0000
@@ -163,7 +163,8 @@
 #endif
 
 int
-glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
+glob(const char * __restrict pattern, int flags,
+	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
 {
 	const char *patnext;
 	size_t limit;
@@ -717,7 +718,7 @@
 			free(pglob->gl_pathv);
 			pglob->gl_pathv = NULL;
 		}
-		return(GLOB_NOSPACE);
+		return (GLOB_NOSPACE);
 	}
 
 	if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {


===============================================================================
diff -u -r1.11 glob.h
--- include/glob.h	16 Feb 2010 19:39:50 -0000	1.11
+++ include/glob.h	24 Oct 2011 05:48:35 -0000
@@ -98,7 +98,8 @@
 #endif /* __BSD_VISIBLE */
 
 __BEGIN_DECLS
-int	glob(const char *, int, int (*)(const char *, int), glob_t *);
+int	glob(const char * __restrict, int,
+	int (*)(const char *, int), glob_t * __restrict);
 void	globfree(glob_t *);
 __END_DECLS
 
================================================================================
diff -u -r1.34 glob.3
--- lib/libc/gen/glob.3	15 Feb 2011 20:07:35 -0000	1.34
+++ lib/libc/gen/glob.3	24 Oct 2011 05:50:17 -0000
@@ -42,7 +42,7 @@
 .Sh SYNOPSIS
 .In glob.h
 .Ft int
-.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
+.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob"
 .Ft void
 .Fn globfree "glob_t *pglob"
 .Sh DESCRIPTION




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Thu Dec 15 16:17:08 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161958 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/161958: commit references a PR
Date: Tue, 20 Dec 2011 22:56:22 +0000 (UTC)

 Author: eadler (ports committer)
 Date: Tue Dec 20 22:56:13 2011
 New Revision: 228754
 URL: http://svn.freebsd.org/changeset/base/228754
 
 Log:
   - Add restrict keyword to glob(3)
   
   PR:		kern/161958
   Submitted by:	Henning Petersen <henning.petersen@t-online.de>
   Approved by:	jilles
   MFC after:	3 days
 
 Modified:
   head/include/glob.h
   head/lib/libc/gen/glob.3
   head/lib/libc/gen/glob.c
 
 Modified: head/include/glob.h
 ==============================================================================
 --- head/include/glob.h	Tue Dec 20 22:47:56 2011	(r228753)
 +++ head/include/glob.h	Tue Dec 20 22:56:13 2011	(r228754)
 @@ -98,7 +98,8 @@ typedef struct {
  #endif /* __BSD_VISIBLE */
  
  __BEGIN_DECLS
 -int	glob(const char *, int, int (*)(const char *, int), glob_t *);
 +int	glob(const char * __restrict, int,
 +	int (*)(const char *, int), glob_t * __restrict);
  void	globfree(glob_t *);
  __END_DECLS
  
 
 Modified: head/lib/libc/gen/glob.3
 ==============================================================================
 --- head/lib/libc/gen/glob.3	Tue Dec 20 22:47:56 2011	(r228753)
 +++ head/lib/libc/gen/glob.3	Tue Dec 20 22:56:13 2011	(r228754)
 @@ -30,7 +30,7 @@
  .\"     @(#)glob.3	8.3 (Berkeley) 4/16/94
  .\" $FreeBSD$
  .\"
 -.Dd February 15, 2011
 +.Dd December 20, 2011
  .Dt GLOB 3
  .Os
  .Sh NAME
 @@ -42,7 +42,7 @@
  .Sh SYNOPSIS
  .In glob.h
  .Ft int
 -.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
 +.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob"
  .Ft void
  .Fn globfree "glob_t *pglob"
  .Sh DESCRIPTION
 
 Modified: head/lib/libc/gen/glob.c
 ==============================================================================
 --- head/lib/libc/gen/glob.c	Tue Dec 20 22:47:56 2011	(r228753)
 +++ head/lib/libc/gen/glob.c	Tue Dec 20 22:56:13 2011	(r228754)
 @@ -168,7 +168,8 @@ static void	 qprintf(const char *, Char 
  #endif
  
  int
 -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
 +glob(const char * __restrict pattern, int flags,
 +	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
  {
  	const char *patnext;
  	size_t limit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: eadler 
State-Changed-When: Tue Dec 20 23:16:36 UTC 2011 
State-Changed-Why:  
committed in r228754 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161958 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/161958: commit references a PR
Date: Sun,  8 Jan 2012 21:00:52 +0000 (UTC)

 Author: eadler (ports committer)
 Date: Sun Jan  8 21:00:37 2012
 New Revision: 229823
 URL: http://svn.freebsd.org/changeset/base/229823
 
 Log:
   MFC r228754:
   	 - Add restrict keyword to glob(3)
   
   PR:		kern/161958
   Approved by:	jilles
 
 Modified:
   stable/9/include/glob.h
   stable/9/lib/libc/gen/glob.3
   stable/9/lib/libc/gen/glob.c
 Directory Properties:
   stable/9/include/   (props changed)
   stable/9/lib/libc/   (props changed)
 
 Modified: stable/9/include/glob.h
 ==============================================================================
 --- stable/9/include/glob.h	Sun Jan  8 20:25:29 2012	(r229822)
 +++ stable/9/include/glob.h	Sun Jan  8 21:00:37 2012	(r229823)
 @@ -98,7 +98,8 @@ typedef struct {
  #endif /* __BSD_VISIBLE */
  
  __BEGIN_DECLS
 -int	glob(const char *, int, int (*)(const char *, int), glob_t *);
 +int	glob(const char * __restrict, int,
 +	int (*)(const char *, int), glob_t * __restrict);
  void	globfree(glob_t *);
  __END_DECLS
  
 
 Modified: stable/9/lib/libc/gen/glob.3
 ==============================================================================
 --- stable/9/lib/libc/gen/glob.3	Sun Jan  8 20:25:29 2012	(r229822)
 +++ stable/9/lib/libc/gen/glob.3	Sun Jan  8 21:00:37 2012	(r229823)
 @@ -30,7 +30,7 @@
  .\"     @(#)glob.3	8.3 (Berkeley) 4/16/94
  .\" $FreeBSD$
  .\"
 -.Dd February 15, 2011
 +.Dd December 20, 2011
  .Dt GLOB 3
  .Os
  .Sh NAME
 @@ -42,7 +42,7 @@
  .Sh SYNOPSIS
  .In glob.h
  .Ft int
 -.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
 +.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob"
  .Ft void
  .Fn globfree "glob_t *pglob"
  .Sh DESCRIPTION
 
 Modified: stable/9/lib/libc/gen/glob.c
 ==============================================================================
 --- stable/9/lib/libc/gen/glob.c	Sun Jan  8 20:25:29 2012	(r229822)
 +++ stable/9/lib/libc/gen/glob.c	Sun Jan  8 21:00:37 2012	(r229823)
 @@ -163,7 +163,8 @@ static void	 qprintf(const char *, Char 
  #endif
  
  int
 -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
 +glob(const char * __restrict pattern, int flags,
 +	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
  {
  	const char *patnext;
  	size_t limit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/161958: commit references a PR
Date: Sun,  8 Jan 2012 21:01:30 +0000 (UTC)

 Author: eadler (ports committer)
 Date: Sun Jan  8 21:01:21 2012
 New Revision: 229824
 URL: http://svn.freebsd.org/changeset/base/229824
 
 Log:
   MFC r228754:
   	 - Add restrict keyword to glob(3)
   
   PR:		kern/161958
   Approved by:	jilles
 
 Modified:
   stable/8/include/glob.h
   stable/8/lib/libc/gen/glob.c
 Directory Properties:
   stable/8/include/   (props changed)
   stable/8/lib/libc/   (props changed)
 
 Modified: stable/8/include/glob.h
 ==============================================================================
 --- stable/8/include/glob.h	Sun Jan  8 21:00:37 2012	(r229823)
 +++ stable/8/include/glob.h	Sun Jan  8 21:01:21 2012	(r229824)
 @@ -102,7 +102,8 @@ typedef struct {
  #endif /* __BSD_VISIBLE */
  
  __BEGIN_DECLS
 -int	glob(const char *, int, int (*)(const char *, int), glob_t *);
 +int	glob(const char * __restrict, int,
 +	int (*)(const char *, int), glob_t * __restrict);
  void	globfree(glob_t *);
  __END_DECLS
  
 
 Modified: stable/8/lib/libc/gen/glob.c
 ==============================================================================
 --- stable/8/lib/libc/gen/glob.c	Sun Jan  8 21:00:37 2012	(r229823)
 +++ stable/8/lib/libc/gen/glob.c	Sun Jan  8 21:01:21 2012	(r229824)
 @@ -163,7 +163,8 @@ static void	 qprintf(const char *, Char 
  #endif
  
  int
 -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
 +glob(const char * __restrict pattern, int flags,
 +	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
  {
  	const char *patnext;
  	size_t limit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/161958: commit references a PR
Date: Sun,  8 Jan 2012 21:02:02 +0000 (UTC)

 Author: eadler (ports committer)
 Date: Sun Jan  8 21:01:51 2012
 New Revision: 229825
 URL: http://svn.freebsd.org/changeset/base/229825
 
 Log:
   MFC r228754:
   	 - Add restrict keyword to glob(3)
   
   PR:		kern/161958
   Approved by:	jilles
 
 Modified:
   stable/7/include/glob.h
   stable/7/lib/libc/gen/glob.c
 Directory Properties:
   stable/7/include/   (props changed)
   stable/7/lib/libc/   (props changed)
 
 Modified: stable/7/include/glob.h
 ==============================================================================
 --- stable/7/include/glob.h	Sun Jan  8 21:01:21 2012	(r229824)
 +++ stable/7/include/glob.h	Sun Jan  8 21:01:51 2012	(r229825)
 @@ -102,7 +102,8 @@ typedef struct {
  #endif /* __BSD_VISIBLE */
  
  __BEGIN_DECLS
 -int	glob(const char *, int, int (*)(const char *, int), glob_t *);
 +int	glob(const char * __restrict, int,
 +	int (*)(const char *, int), glob_t * __restrict);
  void	globfree(glob_t *);
  __END_DECLS
  
 
 Modified: stable/7/lib/libc/gen/glob.c
 ==============================================================================
 --- stable/7/lib/libc/gen/glob.c	Sun Jan  8 21:01:21 2012	(r229824)
 +++ stable/7/lib/libc/gen/glob.c	Sun Jan  8 21:01:51 2012	(r229825)
 @@ -163,7 +163,8 @@ static void	 qprintf(const char *, Char 
  #endif
  
  int
 -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
 +glob(const char * __restrict pattern, int flags,
 +	 int (*errfunc)(const char *, int), glob_t * __restrict pglob)
  {
  	const char *patnext;
  	size_t limit;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Sun Jan 8 21:23:52 UTC 2012 
State-Changed-Why:  
MFCed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161958 
>Unformatted:
