There's no easy way in telling the ulimit settings of "other" processes. The following patch publishes the ulimimit settings in /proc//ulimit --- linux/fs/proc/base.c.ulimit Sat Jul 7 11:37:38 2001 +++ linux/fs/proc/base.c Thu Jul 12 18:25:17 2001 @@ -39,6 +39,7 @@ int proc_pid_status(struct task_struct*,char*); int proc_pid_statm(struct task_struct*,char*); int proc_pid_cpu(struct task_struct*,char*); +int proc_pid_ulimit(struct task_struct*,char*); static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt) { @@ -520,6 +521,7 @@ PROC_PID_STATM, PROC_PID_MAPS, PROC_PID_CPU, + PROC_PID_ULIMIT, PROC_PID_FD_DIR = 0x8000, /* 0x8000-0xffff */ }; @@ -539,6 +541,7 @@ E(PROC_PID_CWD, "cwd", S_IFLNK|S_IRWXUGO), E(PROC_PID_ROOT, "root", S_IFLNK|S_IRWXUGO), E(PROC_PID_EXE, "exe", S_IFLNK|S_IRWXUGO), + E(PROC_PID_ULIMIT, "ulimit", S_IFREG|S_IRUGO), {0,0,NULL,0} }; #undef E @@ -883,6 +886,10 @@ case PROC_PID_MEM: inode->i_op = &proc_mem_inode_operations; inode->i_fop = &proc_mem_operations; + break; + case PROC_PID_ULIMIT: + inode->i_fop = &proc_info_file_operations; + inode->u.proc_i.op.proc_read = proc_pid_ulimit; break; default: printk("procfs: impossible type (%d)",p->type); --- linux/fs/proc/array.c.ulimit Sat Jul 7 11:37:38 2001 +++ linux/fs/proc/array.c Fri Jul 13 00:48:23 2001 @@ -36,6 +36,8 @@ * of forissier patch in 2.1.78 by * Hans Marcus * + * fokkensr@vertis.nl: added /proc//ulimit + * * aeb@cwi.nl : /proc/partitions * * @@ -70,6 +72,7 @@ #include #include #include +#include #include #include @@ -506,6 +509,28 @@ return sprintf(buffer,"%d %d %d %d %d %d %d\n", size, resident, share, trs, lrs, drs, dt); } + +static int sprintf_rlim (unsigned long rlim, char delim, char * buffer) +{ + if (rlim == RLIM_INFINITY) { + return sprintf (buffer, "unlimited%c", delim); + } else { + return sprintf (buffer, "%lu%c", rlim, delim); + } +} + +int proc_pid_ulimit(struct task_struct *task, char * buffer) +{ + int i, len; + + for (i = 0, len = 0 ; i < RLIM_NLIMITS; i++) { + len += sprintf (buffer + len, "%d: ", i); + len += sprintf_rlim (task->rlim[i].rlim_cur, ' ', buffer + len); + len += sprintf_rlim (task->rlim[i].rlim_max, '\n',buffer + len); + } + return len; +} + /* * The way we support synthetic files > 4K