Help me to hack on the task_struct

Matt Young (wz6b@arrl.net)
Thu, 5 Dec 2002 20:10:53 -0800


When hacking with my module code:

I do not get reasonable results when using the "current" macro to access
parts of the task structure.

Things seem to diverge past a thing called rlim in the task_struct..
There are supposedly RLIM_NLIMITS of these rlims.

So I looked through that wonderful cross reference at sourceforge
to discover these defined in resource.h:

#define RLIMIT_CPU 0 /* CPU time in ms */
#define RLIMIT_FSIZE 1 /* Maximum filesize */
#define RLIMIT_DATA 2 /* max data size */
#define RLIMIT_STACK 3 /* max stack size */
#define RLIMIT_CORE 4 /* max core file size */
#define RLIMIT_RSS 5 /* max resident set size */
#define RLIMIT_NPROC 6 /* max number of processes */
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space
*/
#define RLIMIT_AS 9 /* address space limit */
#define RLIMIT_LOCKS 10 /* maximum file locks held */
#define RLIM_NLIMITS 11

Questions:
Why do resource limits happen to count sequencially?

And can I expect the task structure in sched.h to conform to the compiled
kernel?

With my SUSE 8.1 linux. I am using 2.4.19 in my headers and 2.4.19GB in the
runnitg kernel. (Insmod bitches a little)

Any clues are appreciated.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/