On Wed, Oct 05, 2005 at 03:16:11PM -0300, Christian Willy Asmussen - Young 
Padawan wrote:
> Taciano Tavares wrote:
> 
> >Hy boys,
> >
> >i need to set one quota with 3GB for my "president". I don't know make 
> >it. Somebody can help me?
> >
> >
> >[]s
> >taz
> 
> Sorry taz, qmail uses an "unsigned long" to count the quota in bytes.  
> So the maximum quota that you can have is 2GB - 1 byte;
> 

Actually that's more like 4GB - 1 byte but there are some problems before
you hit that number (other calculations may overflow).

> See the snippet:
> 
> #define GIGA 1073741824
> 
> int main(int argc, char **argv)
> {
>  unsigned long quota = 0;
>  int i;
>  for(i=1; i<3; i++) {
>    quota = GIGA*i;
> 
>    fprintf(stdout, "%d Giga = %ld\n", i, quota);
>    quota--;
>    fprintf(stdout, "%d Giga (- 1byte)= %ld\n", i, quota);
>  }
>  return(0);
> }
> 

unsigned long -> %lu in printf. %ld is signed and so limted
to [-2G:2G-1]

> 
> IT WILL PRINT:
> 
> 1 Giga = 1073741824
> 1 Giga (- 1byte)= 1073741823
> 2 Giga = -2147483648
> 2 Giga (- 1byte)= 2147483647

-- 
:wq Claudio

Reply via email to