sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D50483
This commit is contained in:
Konstantin Belousov
2025-05-24 14:10:48 +03:00
parent b9c8a07d4d
commit 98af94cae7
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -292,6 +292,7 @@ typedef __useconds_t useconds_t;
#define _SC_NPROCESSORS_CONF 57
#define _SC_NPROCESSORS_ONLN 58
#define _SC_CPUSET_SIZE 122
#define _SC_UEXTERR_MAXLEN 123 /* user */
#endif
/* Extensions found in Solaris and Linux. */
+3
View File
@@ -34,6 +34,7 @@
#include "namespace.h"
#include <sys/param.h>
#include <sys/exterrvar.h>
#include <sys/time.h>
#include <sys/sysctl.h>
#include <sys/resource.h>
@@ -602,6 +603,8 @@ sysconf(int name)
return (-1);
return ((long)value);
#endif
case _SC_UEXTERR_MAXLEN:
return (UEXTERROR_MAXLEN);
default:
errno = EINVAL;
+2
View File
@@ -26,6 +26,8 @@ struct uexterror {
char msg[128];
};
#define UEXTERROR_MAXLEN 256
#define UEXTERROR_VER 0x10010001
#define EXTERRCTL_ENABLE 1