1833091 Members
3206 Online
110050 Solutions
New Discussion

Re: setrlimit64()

 
Tony LeBlanc
New Member

setrlimit64()

I am compiling some code that uses setrlimit64() to set a filesize limit greater than 2GB but the limit is not being set.

Can someone please explain??

The system is running in 64-bit mode.

-Tony
4 REPLIES 4
harry d brown jr
Honored Contributor

Re: setrlimit64()

Tony,

Does the location of the file accept files greater than 2GB (largefiles)?

live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: setrlimit64()

First of all, are you checking the result of your setrlimit64 call? If it is non-zero, you need to check errno. You may not have permission to increase this limit. Also, are largefiles enabled in the filesystem?
If it ain't broke, I can fix that.
Tony LeBlanc
New Member

Re: setrlimit64()

The return value of the call is 0. The file system is an nfs mount wich can handle large files.

I don't think the filesystem should matter here, I am just trying to set a limit, not actualy create a large file.

Here is my compile string:

cc -g -D_LARGEFILE64_SOURCE

-Tony
A. Clay Stephenson
Acclaimed Contributor

Re: setrlimit64()

Okay, I assume that you are doing a setrlimit() followed by a getrlimit() to check the values. Bear in mind that the setrlimit() system call using RLIMIT_FSIZE only applies to UNIX 95 code; I think that is also true of the setrlimit64() system call.
If it ain't broke, I can fix that.