summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2011-02-28 22:13:22 +0100
committerJunio C Hamano <gitster@pobox.com>2011-03-02 11:24:20 -0800
commit38abd9b8b4e11aa0b4cdaa5c7b44e0c0ad06820b (patch)
tree7a9cf773a06ac50878f84191c4e43c830834cd11 /compat
parentc7934306d1504325d26950f35759ad478772e9c3 (diff)
downloadgit-38abd9b8b4e11aa0b4cdaa5c7b44e0c0ad06820b.tar.gz
mingw: add minimum getrlimit() compatibility stub
We don't have getrlimit on Windows :( Limit of 2048 taken from MSDN: http://msdn.microsoft.com/en-us/library/6e3b887c(v=vs.71).aspx Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index cafc1eb08a..14211c6214 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -233,6 +233,22 @@ int mingw_getpagesize(void);
#define getpagesize mingw_getpagesize
#endif
+struct rlimit {
+ unsigned int rlim_cur;
+};
+#define RLIMIT_NOFILE 0
+
+static inline int getrlimit(int resource, struct rlimit *rlp)
+{
+ if (resource != RLIMIT_NOFILE) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ rlp->rlim_cur = 2048;
+ return 0;
+}
+
/* Use mingw_lstat() instead of lstat()/stat() and
* mingw_fstat() instead of fstat() on Windows.
*/