This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6947] New: ulimit(UL_SETFSIZE) at linux does not comply with POSIX


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]