From 86e1d4729fea89232dd77d7babb038bc38e9fdd8 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Sat, 4 Jan 2003 01:11:49 +0000 Subject: [PATCH] Rename UL_GETSIZE to UL_GETFSIZE and UL_SETSIZE to UL_SETFSIZE; these are the names required by 1003.1-2001. The old names are retained for source compatibility with FreeBSD 5.0 and will be removed before 6.0. --- include/ulimit.h | 13 +++++++++++-- lib/libc/gen/ulimit.3 | 8 ++++---- lib/libc/gen/ulimit.c | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/ulimit.h b/include/ulimit.h index 049d382d641d..0828fc621c3d 100644 --- a/include/ulimit.h +++ b/include/ulimit.h @@ -31,8 +31,17 @@ #include -#define UL_GETSIZE 1 -#define UL_SETSIZE 2 +#define UL_GETFSIZE 1 +#define UL_SETFSIZE 2 + +#if __BSD_VISIBLE +/* + * The "F" was mistakenly omitted from the macro names in FreeBSD 5.0. + * Do not use these names; they will be removed before 6.0. + */ +#define UL_GETSIZE UL_GETFSIZE +#define UL_SETSIZE UL_SETFSIZE +#endif __BEGIN_DECLS long ulimit(int, ...); diff --git a/lib/libc/gen/ulimit.3 b/lib/libc/gen/ulimit.3 index c5030a5da62e..e4c2d769323c 100644 --- a/lib/libc/gen/ulimit.3 +++ b/lib/libc/gen/ulimit.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 8, 2002 +.Dd January 4, 2003 .Dt ULIMIT 3 .Os .Sh NAME @@ -43,11 +43,11 @@ Currently this is limited to the maximum file size. The .Fa cmd argument is one of the following: -.Bl -tag -width ".Dv UL_GETSIZE" -.It Dv UL_GETSIZE +.Bl -tag -width ".Dv UL_GETFSIZE" +.It Dv UL_GETFSIZE will return the maximum file size in units of 512 blocks of the current process. -.It Dv UL_SETSIZE +.It Dv UL_SETFSIZE will attempt to set the maximum file size of the current process and its children with the second argument expressed as a long. .El diff --git a/lib/libc/gen/ulimit.c b/lib/libc/gen/ulimit.c index 158b6a369432..e1bc02066209 100644 --- a/lib/libc/gen/ulimit.c +++ b/lib/libc/gen/ulimit.c @@ -42,14 +42,14 @@ ulimit(int cmd, ...) va_list ap; long arg; - if (cmd == UL_GETSIZE) { + if (cmd == UL_GETFSIZE) { if (getrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); limit.rlim_cur /= 512; if (limit.rlim_cur > LONG_MAX) return (LONG_MAX); return ((long)limit.rlim_cur); - } else if (cmd == UL_SETSIZE) { + } else if (cmd == UL_SETFSIZE) { va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap);