add pipe_size to resource_limit

This commit is contained in:
Doug MacEachern 2005-07-22 02:26:48 +00:00
parent 065cc2937d
commit 4eca5b0aa0
4 changed files with 15 additions and 0 deletions

View File

@ -815,6 +815,12 @@ my %classes = (
{
name => 'file_size_max',
},
{
name => 'pipe_size_max',
},
{
name => 'pipe_size_cur',
},
{
name => 'data_cur',
},

View File

@ -65,6 +65,7 @@ public class Ulimit extends SigarCommandBase {
println("core file size......." + getValue("Core"));
println("data seg size........" + getValue("Data"));
println("file size............" + getValue("FileSize"));
println("pipe size............" + getValue("PipeSize"));
println("max memory size......" + getValue("Memory"));
println("open files..........." + getValue("OpenFiles"));
println("stack size..........." + getValue("Stack"));

View File

@ -168,6 +168,8 @@ typedef struct {
sigar_uint64_t cpu_cur, cpu_max;
/* RLIMIT_FSIZE */
sigar_uint64_t file_size_cur, file_size_max;
/* PIPE_BUF */
sigar_uint64_t pipe_size_cur, pipe_size_max;
/* RLIMIT_DATA */
sigar_uint64_t data_cur, data_max;
/* RLIMIT_STACK */

View File

@ -947,11 +947,14 @@ typedef struct {
#define RLIMIT_NPROC (RLIM_NLIMITS+2)
#endif
#define RLIMIT_PSIZE (RLIM_NLIMITS+3)
static rlimit_field_t sigar_rlimits[] = {
{ RLIMIT_CPU, 1, RlimitOffsets(cpu) },
{ RLIMIT_FSIZE, 1024, RlimitOffsets(file_size) },
{ RLIMIT_DATA, 1024, RlimitOffsets(data) },
{ RLIMIT_STACK, 1024, RlimitOffsets(stack) },
{ RLIMIT_PSIZE, 512, RlimitOffsets(pipe_size) },
{ RLIMIT_CORE, 1024, RlimitOffsets(core) },
{ RLIMIT_RSS, 1024, RlimitOffsets(memory) },
{ RLIMIT_NPROC, 1, RlimitOffsets(processes) },
@ -980,6 +983,9 @@ int sigar_resource_limit_get(sigar_t *sigar,
case RLIMIT_NPROC:
RlimitHS(sysconf(_SC_CHILD_MAX));
break;
case RLIMIT_PSIZE:
RlimitHS(PIPE_BUF/512);
break;
default:
RlimitHS(RLIM_INFINITY);
break;