[CRIU] [PATCH 21/23] restorer: wrapped the syscall sys_setrlimit
Alexander Kartashov
alekskartashov at parallels.com
Mon Jan 14 05:30:57 EST 2013
On 01/14/2013 02:10 PM, Pavel Emelyanov wrote:
> As far as I see from the ARM patch struct krlimir and struct rlimit
> do not differ. What's wrong?
Probably it's a feature of Debian. In the ARM patch i declare
the struct krlimit in the following way:
struct krlimit {
unsigned long rlim_cur;
unsigned long rlim_max;
};
The struct rlimit is declared in the following way in the system headers:
/* Type for resource quantity measurement. */
#ifndef __USE_FILE_OFFSET64
typedef __rlim_t rlim_t;
#else
typedef __rlim64_t rlim_t;
#endif
#ifdef __USE_LARGEFILE64
typedef __rlim64_t rlim64_t;
#endif
struct rlimit
{
/* The current (soft) limit. */
rlim_t rlim_cur;
/* The hard limit. */
rlim_t rlim_max;
};
Since the macro FILE_OFFSET_BITS is 64 the fields cur and lim
becomes 64-bit long that results in a mismatch between the kernel
and user declarations of the struct rlimit in this case.
I tried to remove the macro definition but it only made things worse.
--
Sincerely yours,
Alexander Kartashov
Intern
Core team
www.parallels.com
Skype: aleksandr.kartashov
Email: alekskartashov at parallels.com
More information about the CRIU
mailing list