File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,38 @@ int test_fstat(char *str, int len)
305
305
return TEST_FAILURE ;
306
306
}
307
307
308
+ int test_lfs (char * str , int len )
309
+ {
310
+ long long fd ;
311
+ long long ret ;
312
+ int result = TEST_FAILURE ;
313
+
314
+ ret = lkl_sys_open ("/largefile" , LKL_O_CREAT | LKL_O_WRONLY , 0 );
315
+ if (ret < 0 ) {
316
+ snprintf (str , len , "open: %s" , lkl_strerror (ret ));
317
+ return TEST_FAILURE ;
318
+ }
319
+ fd = ret ;
320
+
321
+ lkl_loff_t nearly_3gb = (3 * 1024LL * 1024 * 1024 * 1024 ) - 1 ;
322
+
323
+ ret = lkl_sys_pwrite64 (fd , "x" , 1 , nearly_3gb );
324
+ if (ret < 0 ) {
325
+ snprintf (str , len , "pwrite: %s" , lkl_strerror (ret ));
326
+ goto out ;
327
+ }
328
+ snprintf (str , len , "%lld" , ret );
329
+ result = TEST_SUCCESS ;
330
+
331
+ out :
332
+ ret = lkl_sys_close (fd );
333
+ if (ret < 0 ) {
334
+ snprintf (str , len , "close: %s" , lkl_strerror (ret ));
335
+ result = TEST_FAILURE ;
336
+ }
337
+ return result ;
338
+ }
339
+
308
340
int test_mkdir (char * str , int len )
309
341
{
310
342
long ret ;
@@ -932,6 +964,7 @@ int main(int argc, char **argv)
932
964
TEST (lseek );
933
965
TEST (read );
934
966
TEST (fstat );
967
+ TEST (lfs );
935
968
TEST (mkdir );
936
969
TEST (stat );
937
970
#ifndef __MINGW32__
You can’t perform that action at this time.
0 commit comments