lkml.org 
[lkml]   [2018]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 36/38] vfs: Add a sample program for the new mount API [ver #10]
On Mon 2018-07-30 16:33:15, David Howells wrote:
> Pavel Machek <pavel@ucw.cz> wrote:
>
> > Well, I guess errors should have numbers, and catalog explaining what
> > error means what. That way userspace can translate, and it is what we
> > do with errno.
> >
> > I believe numbers are best. If you hate numbers, you can still use
> > strings, as long as you can enumerate them in docs (but it will be
> > strange design).
>
> Simply returning error numbers is *not* sufficient. The messages need to be
> parameterised.

Still userland needs a way to understand the errors.

One way is to pass ( "not enough pixie dust (%d too short) on device
%s in %s", 123, "foo", "warddrobe" ). But if you pass it as one
string, it becomes hard / impossible to parse. (For example if device
is named "foo in bar".)

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-07-30 19:31    [W:0.264 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site