1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #include <features.h>
- #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
- #undef _FILE_OFFSET_BITS
- #define _FILE_OFFSET_BITS 64
- #endif
- #ifndef __USE_LARGEFILE64
- # define __USE_LARGEFILE64 1
- #endif
- #ifdef __USE_FILE_OFFSET64
- # undef __USE_FILE_OFFSET64
- #endif
- #include <sys/types.h>
- #include <sys/resource.h>
- #if defined __UCLIBC_HAS_LFS__
- int getrlimit64 (__rlimit_resource_t resource, struct rlimit64 *rlimits)
- {
- struct rlimit rlimits32;
- if (getrlimit (resource, &rlimits32) < 0)
- return -1;
- if (rlimits32.rlim_cur == RLIM_INFINITY)
- rlimits->rlim_cur = RLIM64_INFINITY;
- else
- rlimits->rlim_cur = rlimits32.rlim_cur;
- if (rlimits32.rlim_max == RLIM_INFINITY)
- rlimits->rlim_max = RLIM64_INFINITY;
- else
- rlimits->rlim_max = rlimits32.rlim_max;
- return 0;
- }
- #endif
|