This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Add _PC_CASE_INSENSITIVE to [f]pathconf


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dda82d1a7be51719013dd2c9d255a2e7790eed53

commit dda82d1a7be51719013dd2c9d255a2e7790eed53
Author: Ken Brown <kbrown@cornell.edu>
Date:   Thu Oct 20 15:35:54 2016 -0400

    Add _PC_CASE_INSENSITIVE to [f]pathconf
    
    Update the getconf utility to support the new flag as well as
    _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY.  These were previously
    unsupported, probably as an oversight.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/include/sys/unistd.h       | 1 +
 winsup/cygwin/fhandler.cc              | 2 ++
 winsup/cygwin/include/cygwin/version.h | 3 ++-
 winsup/cygwin/release/2.6.1            | 2 ++
 winsup/utils/getconf.c                 | 3 +++
 5 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
index 05b4f9d..143147d 100644
--- a/newlib/libc/include/sys/unistd.h
+++ b/newlib/libc/include/sys/unistd.h
@@ -490,6 +490,7 @@ int	_EXFUN(unlinkat, (int, const char *, int));
 #define _PC_POSIX_PERMISSIONS            90
 /* Ask for full POSIX permission support including uid/gid settings. */
 #define _PC_POSIX_SECURITY               91
+#define _PC_CASE_INSENSITIVE             92
 #endif
 
 /*
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index d77ccd3..9ab52ad 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1891,6 +1891,8 @@ fhandler_base::fpathconf (int v)
 	return pc.has_acls () || pc.fs_is_nfs ();
       set_errno (EINVAL);
       break;
+    case _PC_CASE_INSENSITIVE:
+      return !!pc.objcaseinsensitive ();
     default:
       set_errno (EINVAL);
       break;
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 1c1402c..6ba602e 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -469,12 +469,13 @@ details. */
   302: Export nl_langinfo_l.
   303: Export pthread_getname_np, pthread_setname_np.
   304: Export strerror_l, strptime_l, wcsftime_l.
+  305: [f]pathconf flag _PC_CASE_INSENSITIVE added.
 
   Note that we forgot to bump the api for ualarm, strtoll, strtoull,
   sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 304
+#define CYGWIN_VERSION_API_MINOR 305
 
 /* There is also a compatibity version number associated with the shared memory
    regions.  It is incremented when incompatible changes are made to the shared
diff --git a/winsup/cygwin/release/2.6.1 b/winsup/cygwin/release/2.6.1
index 61ce2de..7ced3c4 100644
--- a/winsup/cygwin/release/2.6.1
+++ b/winsup/cygwin/release/2.6.1
@@ -1,6 +1,8 @@
 What's new:
 -----------
 
+- Add _PC_CASE_INSENSITIVE flag to [f]pathconf(3).
+
 
 What changed:
 -------------
diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 8539233..e6b319e 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -186,6 +186,7 @@ static const struct conf_variable conf_table[] =
   { "POSIX2_RE_DUP_MAX",		CONSTANT,	_POSIX2_RE_DUP_MAX	},
 
   /* Variables from fpathconf() */
+  { "CASE_INSENSITIVE",			PATHCONF,	_PC_CASE_INSENSITIVE	},
   { "FILESIZEBITS",			PATHCONF,	_PC_FILESIZEBITS	},
   { "LINK_MAX",				PATHCONF,	_PC_LINK_MAX		},
   { "MAX_CANON",			PATHCONF,	_PC_MAX_CANON		},
@@ -195,10 +196,12 @@ static const struct conf_variable conf_table[] =
   { "PIPE_BUF",				PATHCONF,	_PC_PIPE_BUF		},
   { "POSIX2_SYMLINKS",			PATHCONF,	_PC_2_SYMLINKS		},
   { "POSIX_ALLOC_SIZE_MIN",		PATHCONF,	_PC_ALLOC_SIZE_MIN	},
+  { "POSIX_PERMISSIONS",		PATHCONF,	_PC_POSIX_PERMISSIONS	},
   { "POSIX_REC_INCR_XFER_SIZE",		PATHCONF,	_PC_REC_INCR_XFER_SIZE	},
   { "POSIX_REC_MAX_XFER_SIZE",		PATHCONF,	_PC_REC_MAX_XFER_SIZE	},
   { "POSIX_REC_MIN_XFER_SIZE",		PATHCONF,	_PC_REC_MIN_XFER_SIZE	},
   { "POSIX_REC_XFER_ALIGN",		PATHCONF,	_PC_REC_XFER_ALIGN	},
+  { "POSIX_SECURITY",			PATHCONF,	_PC_POSIX_SECURITY	},
   { "SYMLINK_MAX",			PATHCONF,	_PC_SYMLINK_MAX		},
   { "_POSIX_CHOWN_RESTRICTED",		PATHCONF,	_PC_CHOWN_RESTRICTED	},
   { "_POSIX_NO_TRUNC",			PATHCONF,	_PC_NO_TRUNC		},


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]