[openbeos] resource.h, rlimit, rusage

  • From: "Andrew Bachmann" <shatty@xxxxxxxxxxxxx>
  • To: "openbeos" <openbeos@xxxxxxxxxxxxx>
  • Date: Mon, 15 Sep 2003 22:19:43 -0700 PDT

Hello all,

In my somewhat recent header wanderings I noticed that we have a resource.h in 
private/kernel.  
This header is entirely compatible and suitable for usage as the posix 
sys/resource.h header.  No 
changes to the header need to be made, although the header should have some 
additions to be 
R5 & posix compatible.  These are the additions:

1. add #include <sys/time.h>
2. add struct rusage
3. add getrusage prototype

It's my understanding that getrusage is public R5 and so we support it.  
However, I realize that 
this support will likely require kernel support, and a new syscall. (?)  None 
of our current source 
exercises rusage functionality. (unsurprisingly)

I have been building with a modified and relocated resource.h for some time.  
Here's my 
proposal:

1. make the above additions to a copy of our resource.h
2. check it in at current/headers/posix/sys/resource.h
3. remove the existing current/headers/private/kernel/resource.h

Are there any comments or objections?  BTW, the free bsd rusage has a lot more 
fields than the 
R5 rusage struct does.  The R5 rusage struct contains only those mandated by 
the posix spec, and 
those are the only ones I was planning to add. (ru_utime, ru_stime)

Andrew


Other related posts: