Mail Archives: djgpp-workers/2013/01/27/10:02:28
While I was trying to port latest sed, I have noted that djgpp's resource.h
does not provide rlim_t. An inspection of other resource.h files shows that
this typedef should be an unsigned long but djgpp uses long. I was not able
to figure out why djgpp's implementation uses long. Anyway a typedef of
rlim_t is required to be able to compile certain sources.
Suggestions concerning this issue are welcome.
Regards,
Juan M. Guerrero
diff -aprNU5 djgpp.orig/include/sys/resource.h djgpp/include/sys/resource.h
--- djgpp.orig/include/sys/resource.h 2012-09-23 07:49:18 +0000
+++ djgpp/include/sys/resource.h 2013-01-27 15:43:56 +0000
@@ -54,13 +54,15 @@ struct rusage {
#define RLIMIT_NOFILE 8 /* number of open files */
#define RLIM_NLIMITS 9 /* number of resource limits */
#define RLIM_INFINITY ((long) ((1UL << 31) - 1UL))
+typedef long rlim_t;
+
struct rlimit {
- long rlim_cur; /* current (soft) limit */
- long rlim_max; /* maximum value for rlim_cur */
+ rlim_t rlim_cur; /* current (soft) limit */
+ rlim_t rlim_max; /* maximum value for rlim_cur */
};
int getrusage(int _who, struct rusage *_rusage);
int getrlimit(int _rltype, struct rlimit *_rlimit);
int setrlimit(int _rltype, const struct rlimit *_rlimit);
diff -aprNU5 djgpp.orig/src/libc/compat/sys/resource/gtrlimit.txh djgpp/src/libc/compat/sys/resource/gtrlimit.txh
--- djgpp.orig/src/libc/compat/sys/resource/gtrlimit.txh 2003-02-07 18:13:52 +0000
+++ djgpp/src/libc/compat/sys/resource/gtrlimit.txh 2013-01-27 15:45:42 +0000
@@ -15,12 +15,12 @@ This function gets the resource limit sp
stores it in the buffer pointed to by @var{rlimitp}. The @code{rlimit}
structure is defined on @file{sys/resource.h} as follows:
@example
struct rlimit @{
- long rlim_cur; /* current (soft) limit */
- long rlim_max; /* maximum value for rlim_cur */
+ rlim_t rlim_cur; /* current (soft) limit */
+ rlim_t rlim_max; /* maximum value for rlim_cur */
@};
@end example
The following resource types can be passed in @var{rltype}:
- Raw text -