sys/param.h: Cleanup.

* Minor tweaks to POSIX sys/param.h for style.

 * Don't redefine alignment macros in BSD sys/param.h even conditionally.
   And add a few more macros from the real BSD sys/param.h, for convenience.
   (Most of these are also declared in musl and glibc's sys/param.h)
This commit is contained in:
Augustin Cavalier
2024-10-14 13:53:54 -04:00
parent e5f515c322
commit 8bacd281ba
2 changed files with 18 additions and 32 deletions
+5 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 Haiku, Inc. All Rights Reserved.
* Copyright 2002-2024, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_PARAM_H
@@ -9,11 +9,13 @@
#include <limits.h>
#define MAXHOSTNAMELEN (256) /* maximum possible length of this machine's hostname */
#define MAXPATHLEN PATH_MAX
#define MAXSYMLINKS SYMLOOP_MAX
#define NOFILE OPEN_MAX
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
@@ -22,12 +24,7 @@
#endif
#define _ALIGNBYTES (sizeof(long) - 1)
#define _ALIGN(p) \
(((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
/* maximum possible length of this machine's hostname */
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 256
#endif
#endif /* _SYS_PARAM_H */