summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-20 22:11:46 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-20 22:11:46 -0700
commit0bd20f10ea1884c1118efc19ee6325ad6cce9105 (patch)
tree08ca39c465b8782d6e6062fc32b06e0bbafb8bb6 /compat
parentdd7d0d09765117700db87b4ecf63551dd56a267a (diff)
parentd131b7afea58f47721dafd013ab6aff4adfc42dd (diff)
downloadgit-0bd20f10ea1884c1118efc19ee6325ad6cce9105.tar.gz
Merge branch 'sp/maint-fd-limit' into maint
* sp/maint-fd-limit: sha1_file.c: Don't retain open fds on small packs mingw: add minimum getrlimit() compatibility stub Limit file descriptors used by packs
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.
*/