This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/6947] New: ulimit(UL_SETFSIZE) at linux does not comply with POSIX
- From: "khoroshilov at linuxtesting dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Oct 2008 18:24:41 -0000
- Subject: [Bug libc/6947] New: ulimit(UL_SETFSIZE) at linux does not comply with POSIX
- Reply-to: sourceware-bugzilla at sourceware dot org
POSIX requirements to ulimit(UL_SETFSIZE) are as follows:
UL_SETFSIZE
Set the file size limit for output operations
of the process to the value of the second argument,
taken as a long, multiplied by 512.
...
The return value shall be the integer part of
the new file size limit divided by 512.
glibc implementation of this function for Linux
libc/sysdeps/unix/sysv/linux/ulimit.c
returns just results of __setrlimit() call, which is 0 in the case of success.
The code demonstrating the problem is below.
#include <ulimit.h>
#include <stdio.h>
int main( int argc, char ** argv )
{
long res;
res=ulimit(UL_GETFSIZE);
printf("Result of ulimit(UL_GETFSIZE): %ld\n", res);
res=ulimit(UL_SETFSIZE, 10000);
printf("Result of ulimit(UL_SETFSIZE, 10000): %ld\n", res);
res=ulimit(UL_GETFSIZE);
printf("Result of ulimit(UL_GETFSIZE): %ld\n", res);
return 0;
}
--
Summary: ulimit(UL_SETFSIZE) at linux does not comply with POSIX
Product: glibc
Version: 2.8
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: khoroshilov at linuxtesting dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6947
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.