[DTrace-devel] [PATCH 6/7] Use symbol name for 'not supported' error codes

Eugene Loh eugene.loh at oracle.com
Tue Dec 6 22:24:07 UTC 2022


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

Extremely minor comments:

*)  The commit message could point out that more uses of ENOTSUPP will 
arise.

*)  port.h has a block comment before each set of defines, so one before 
the new define might make sense.

*)  The #define indentation style (indenting the "define") is okay but a 
change of style for port.h.

On 12/6/22 16:50, Kris Van Hees via DTrace-devel wrote:
> The kernel uprobes implementation uses ENOTSUPP to indicate that a
> uprobe could not be enabled, but this error code is not listed with
> a symbolic name in userspace header files.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>   include/port.h       | 4 ++++
>   libdtrace/dt_error.c | 3 ++-
>   2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/include/port.h b/include/port.h
> index 50f81871..64983ac0 100644
> --- a/include/port.h
> +++ b/include/port.h
> @@ -90,4 +90,8 @@ int close_range(unsigned int first, unsigned int last, unsigned int flags);
>   #define R_BPF_64_32		10
>   #endif
>   
> +#ifndef ENOTSUPP
> +# define ENOTSUPP		524	/* Operation is not supported */
> +#endif
> +
>   #endif
> diff --git a/libdtrace/dt_error.c b/libdtrace/dt_error.c
> index 576b1199..383e0cde 100644
> --- a/libdtrace/dt_error.c
> +++ b/libdtrace/dt_error.c
> @@ -7,6 +7,7 @@
>   
>   #include <string.h>
>   #include <dt_impl.h>
> +#include <port.h>
>   
>   static const struct {
>   	int err;
> @@ -119,7 +120,7 @@ dtrace_errmsg(dtrace_hdl_t *dtp, int error)
>   				return _dt_errlist[i].msg;
>   		}
>   		str = NULL;
> -	} else if (error == 524) {	/* ENOTSUPP */
> +	} else if (error == ENOTSUPP) {
>   		/*
>   		 * This is an error code that is supposedly specific to NFSv3.
>   		 * It is not expected to be known to userspace - except that



More information about the DTrace-devel mailing list