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:
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -26,6 +26,8 @@ struct uexterror {
|
||||
char msg[128];
|
||||
};
|
||||
|
||||
#define UEXTERROR_MAXLEN 256
|
||||
|
||||
#define UEXTERROR_VER 0x10010001
|
||||
|
||||
#define EXTERRCTL_ENABLE 1
|
||||
|
||||
Reference in New Issue
Block a user