> Date: Mon, 10 Apr 2017 23:21:43 +1000
> From: Jonathan Gray <[email protected]>
> 
> On Mon, Apr 10, 2017 at 03:03:10PM +0200, Jeremie Courreges-Anglas wrote:
> > 
> > We have a bunch of patches in ports to deal with EPROTO and EBADMSG not
> > being defined.  It would be nice to get rid of those.  The diff below
> > also adds the also missing ENOTRECOVERABLE and EOWNERDEAD.
> > 
> > Thoughts?
> > 
> > (Dunno if there is a point describing verbosely what those new errno
> > values mean on other systems...)
> 
> I sent a mail around last year for the posix errnos we lack.
> Still waiting for a libc major crank which adding errnos requires
> as the size of sys_errmsg changes.

This version is obviously better ;).  But it is probably good to wait
a bit longer before we crank the libc major.

> ---
>
> We are missing a few errnos mentioned in posix 2013.
> Excluding the reserved and streams/obsolete ones there is
> 
> EBADMSG               Bad message
> ENOTRECOVERABLE       State not recoverable
> EOWNERDEAD    Previous owner died
> EPROTO                Protocol error
> 
> Index: sys/sys/errno.h
> ===================================================================
> RCS file: /cvs/src/sys/sys/errno.h,v
> retrieving revision 1.24
> diff -u -p -r1.24 errno.h
> --- sys/sys/errno.h   24 Oct 2015 10:42:02 -0000      1.24
> +++ sys/sys/errno.h   2 Sep 2016 13:51:36 -0000
> @@ -167,8 +167,12 @@
>  #define EIDRM                89      /* Identifier removed */
>  #define ENOMSG               90      /* No message of desired type */
>  #define ENOTSUP              91      /* Not supported */
> +#define EBADMSG              92      /* Bad message */
> +#define ENOTRECOVERABLE      93      /* State not recoverable */
> +#define EOWNERDEAD   94      /* Previous owner died */
> +#define EPROTO               95      /* Protocol error */
>  #if __BSD_VISIBLE
> -#define ELAST                91      /* Must be equal largest errno */
> +#define ELAST                95      /* Must be equal largest errno */
>  #endif /* __BSD_VISIBLE */
>  
>  #ifdef _KERNEL
> Index: lib/libc/gen/errlist.c
> ===================================================================
> RCS file: /cvs/src/lib/libc/gen/errlist.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 errlist.c
> --- lib/libc/gen/errlist.c    24 Oct 2015 10:42:02 -0000      1.18
> +++ lib/libc/gen/errlist.c    2 Sep 2016 13:51:36 -0000
> @@ -142,6 +142,10 @@ const char *const sys_errlist[] = {
>       "Identifier removed",                   /* 89 - EIDRM */
>       "No message of desired type",           /* 90 - ENOMSG */
>       "Not supported",                        /* 91 - ENOTSUP */
> +     "Bad message",                          /* 92 - EBADMSG */
> +     "State not recoverable",                /* 93 - ENOTRECOVERABLE */
> +     "Previous owner died",                  /* 94 - EOWNERDEAD */
> +     "Protocol error",                       /* 95 - EPROTO */
>  };
>  const int sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] };
>  #if 0
> Index: sys/dev/pci/drm/drm_linux.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/drm/drm_linux.h,v
> retrieving revision 1.47
> diff -u -p -r1.47 drm_linux.h
> --- sys/dev/pci/drm/drm_linux.h       5 Apr 2016 20:44:03 -0000       1.47
> +++ sys/dev/pci/drm/drm_linux.h       2 Sep 2016 13:51:36 -0000
> @@ -87,7 +87,6 @@ typedef off_t loff_t;
>  #define ERESTARTSYS  EINTR
>  #define ETIME                ETIMEDOUT
>  #define EREMOTEIO    EIO
> -#define EPROTO               EIO
>  #define ENOTSUPP     ENOTSUP
>  
>  #define KERN_INFO
> 
> 

Reply via email to