Re: No human readable message with g_vfs

From: Bakul Shah <bakul_at_bitblocks.com>
Date: Mon, 03 Jan 2011 11:53:50 -0800
On Mon, 03 Jan 2011 22:21:51 +0300 Anonymous <swell.k_at_gmail.com>  wrote:
> Bakul Shah <bakul_at_bitblocks.com> writes:
> 
> > On Mon, 03 Jan 2011 21:20:42 +0300 Anonymous <swell.k_at_gmail.com>  wrote:
> >>=20
> >> Do you mean perror(1)?
> >>=20
> >>   $ perror 5
> >>   Input/output error
> >
> > I prefer mine:
> >
> > $ errno () { grep "^#.*\\<$*\\>" /usr/include/sys/errno.h }
> > $ errno 5
> > #define EIO             5               /* Input/output error */
> > $ errno EIO
> > #define EIO             5               /* Input/output error */
> 
> perror(1) displays localized messages
> 
>   $ LANG=3Dja_JP.UTF-8 perror 5
>   =E5=85=A5=E5=87=BA=E5=8A=9B=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=A7=E3=81=99
> 
>   $ LANG=3Duk_UA.UTF-8 perror 5
>   =D0=9F=D0=BE=D0=BC=D0=B8=D0=BB=D0=BA=D0=B0 =D0=B2=D0=B2=D0=BE=D0=B4=D1=83=
> -=D0=B2=D0=B8=D0=B2=D0=BE=D0=B4=D1=83

Yes, definitely useful. Perhaps strerror would be a better name?

> but I have to agree that knowing errno macro is useful

And you can use grep tricks :-)

$ errno '[dD]evice'
#define ENXIO           6               /* Device not configured */
#define ENOTBLK         15              /* Block device required */
#define EBUSY           16              /* Device busy */
#define EXDEV           18              /* Cross-device link */
#define ENODEV          19              /* Operation not supported by device */
#define ENOTTY          25              /* Inappropriate ioctl for device */
#define ENOSPC          28              /* No space left on device */
Received on Mon Jan 03 2011 - 19:01:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:10 UTC