summaryrefslogtreecommitdiff
path: root/libaio-0.3.109/harness/cases/8.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2009-10-09 18:17:02 +0000
committer <>2013-09-20 15:53:04 +0000
commite6a27c468cae77ce26f6aa924b22bd39055892fe (patch)
tree5799c05ec62d99e582db411ed0fe5ffd2ba519db /libaio-0.3.109/harness/cases/8.t
downloadlibaio-tarball-26f674441b76d6040e66104f7c1d82d18ff0acab.tar.gz
Imported from /home/lorry/working-area/delta_libaio-tarball/libaio_0.3.109.orig.tar.gz.HEADlibaio_0.3.109.origmaster
Diffstat (limited to 'libaio-0.3.109/harness/cases/8.t')
-rw-r--r--libaio-0.3.109/harness/cases/8.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/libaio-0.3.109/harness/cases/8.t b/libaio-0.3.109/harness/cases/8.t
new file mode 100644
index 0000000..e59199f
--- /dev/null
+++ b/libaio-0.3.109/harness/cases/8.t
@@ -0,0 +1,28 @@
+/* 8.t
+- Ditto for the above three tests at the offset maximum (largest
+ possible ext2/3 file size.) (8.t)
+ */
+#include <sys/types.h>
+#include <unistd.h>
+
+long long get_fs_limit(int fd)
+{
+ long long min = 0, max = 9223372036854775807LL;
+ char c = 0;
+
+ while (max - min > 1) {
+ if (pwrite64(fd, &c, 1, (min + max) / 2) == -1)
+ max = (min + max) / 2;
+ else {
+ ftruncate(fd, 0);
+ min = (min + max) / 2;
+ }
+ }
+ return max;
+}
+
+#define SET_RLIMIT(x) do ; while (0)
+#define LIMIT get_fs_limit(rwfd)
+#define FILENAME "testdir.ext2/rwfile"
+
+#include "common-7-8.h"