Document why rlim_t needs to be a signed type.

Define RLIM_INFINITY as INT64_MAX instead of hand-rolling it.

MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2004-11-08 18:05:43 +00:00
parent be9a7a2249
commit de84c3d14f
2 changed files with 4 additions and 2 deletions

View File

@ -49,7 +49,9 @@ typedef int __nl_item;
typedef __uint16_t __nlink_t; /* link count */
typedef __int64_t __off_t; /* file offset */
typedef __int32_t __pid_t; /* process [group] */
typedef __int64_t __rlim_t; /* resource limit (XXX not unsigned) */
typedef __int64_t __rlim_t; /* resource limit - intentionally */
/* signed, because of legacy code */
/* that uses -1 for RLIM_INFINITY */
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */

View File

@ -98,7 +98,7 @@ struct rusage {
#define RLIM_NLIMITS 11 /* number of resource limits */
#define RLIM_INFINITY ((rlim_t)(((u_quad_t)1 << 63) - 1))
#define RLIM_INFINITY ((rlim_t)INT64_MAX)
/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */