[WISHLIST] Provide a utility that interprets POSIX errno's

Bug #612267 reported by Dustin Kirkland 
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-meta (Ubuntu)
Invalid
Wishlist
Dustin Kirkland 
ubuntu-dev-tools (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Many a kernel or systems programmer will recall debugging some code and trying to interpret the returned error number.

This is quite easy to do programmatically in any one of a number of ways. It would be really simple and incredibly useful to bundle one of these and drop it into /usr/bin/errno on Ubuntu systems, such that users could run "errno 36", or "errno EPERM" and have the utility interpret common POSIX error numbers.

There are a number of ways that this can be done. Perhaps easiest is grepping /usr/include/asm-generic/errno*.h (which is why this bug is filed against the linux-meta package). I'll attach a shell script that does this.

Alternatively, perl and python could be used to do this too (courtesy of Kees Cook):
 perl -MPOSIX -e 'print strerror('$1'),"\n";'
or
 python -c 'import os;print os.strerror('$1');'

This is a wishlist bug that we upload one of these solutions to /usr/bin. If I could get a +1 from a member of the Ubuntu kernel team, I'll gladly commit a fix.

Changed in linux-meta (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Undecided → Wishlist
milestone: none → ubuntu-10.10-beta
status: New → Triaged
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Fixes in branch:
 * lp:~kirkland/+junk/612267

Added an initial cut at the script, licensed GPLv2 like the rest of the package. Also added a manpage. This script should be functional enough to get us started. It may need some tweaks and improvements.

:-Dustin

Changed in linux-meta (Ubuntu):
status: Triaged → Invalid
Changed in ubuntu-dev-tools (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Benjamin Drung (bdrung) wrote :

I don't think that ubuntu-dev-tools is the right package for the errno tool. errno is not related to _Ubuntu_ development. It's related to developing in general.

Revision history for this message
Kees Cook (kees) wrote :

Plenty of stuff in ubuntu-dev-tools is generally useful stuff. Until another place is found, this seems totally fine to me.

Benjamin Drung (bdrung)
Changed in ubuntu-dev-tools (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

For the record, folks at the derivatives round table at DebConf were unhappy about the bloat of ubuntu-dev-tools, and we agreed that we would try harder to put things in more appropriate places rather than just dropping them into ubuntu-dev-tools. I'd appreciate it if people tried to be a bit more disciplined about this in future.

Revision history for this message
Benjamin Drung (bdrung) wrote :

My opinion is that the script should be where the corresponding header files are.

Thierry Carrez (ttx)
Changed in linux-meta (Ubuntu):
milestone: ubuntu-10.10-beta → none
Revision history for this message
Matt Zimmerman (mdz) wrote :

I originally suggested putting this in the linux source package, to be included in linux-tools. Is there any reason not to do that?

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 612267] Re: [WISHLIST] Provide a utility that interprets POSIX errno's

I started a branch that did this at lp:~kirkland/+junk/612267. I
didn't see any other utilities installed by linux-tools, and only the
"perf" tool installed by linux-tools-common. errno seemed slightly
out of place.

Revision history for this message
Benjamin Drung (bdrung) wrote :

linux-tools is definitively a better place for the script. One point of critique could be, that it's not installed on a standard system, but that applies to ubuntu-dev-tools too.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Any reason for not putting it into linux-headers-*?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-dev-tools - 0.103

---------------
ubuntu-dev-tools (0.103) experimental; urgency=low

  [ Benjamin Drung ]
  * sponsor-patch:
    - Fix NameError: global name 'debdiff_filename' is not defined.
    - Add --workdir parameter to set the working directory.
  * ubuntutools/update_maintainer.py: Fix failure if debian/control.in is a
    directory.

  [ Luca Falavigna ]
  * debian/control:
    - Add Benjamin Drung to Uploaders.
    - Add DM-Upload-Allowed field, this way Benjamin can upload new
      versions on his own.
  * ubuntutools/misc.py:
    - Use output of dpkg --print-architecture command to correctly display
      platform architecture (Closes: #594424).

  [ Siegfried-Angel Gevatter Pujals ]
  * pbuilder-dist:
     - Do not show a warning when "experimental" is used; there is no
       debootstrap file for it but it should just work anyway.
     - Wrap any extra (user) arguments appended to the pbuilder command with
       quotation marks, when needed (LP: #398989).
  * bash_completion/pbuilder-dist:
     - Enable auto-completion for "pbuilder-experimental".
  * doc/pbuilder-dist.1:
     - Move the documentation for --main-only (previously "mainonly") and
       --debug-echo to a new Options section.

  [ Stefano Rivera ]
  * Add manpages for sponsor-patch and import-bug-from-debian.
  * hugdaylist, manage-credentials, massfile, merge-changelog,
    ubuntutools/requestsync/common.py: Some pyflakes-induced cleanup.
  * ubuntutools/lp/libsupport.py: Support production API URLs in
    translate_web_api.

ubuntu-dev-tools (0.102) experimental; urgency=low

  [ Dustin Kirkland ]
  * errno, doc/errno.1, debian/control, debian/copyright, setup.py:
    - add an errno utility, LP: #612267

  [ Kees Cook ]
  * mk-sbuild: update examples to include "-A".

  [ Benjamin Drung ]
  * suspicious-source: whitelist font source formats. Thanks to Nicolas
    Spalinger for the patch (LP: #365147).
  * Update the man page of suspicious-source to match the rewrite.
  * syncpackage:
    - Don't upload orig tarball if not needed.
    - Print error message if the download fails (LP: #639899).
    - Check if the specified Debian component is valid (LP: #639896).
  * update-maintainer: Don't change the Maintainer field if the email is set
    to a @lists.ubuntu.com address.
  * sponsor-patch: New script to download a patch from a Launchpad bug, patch
    the source package, build, check and uploads it (to Ubuntu or a PPA).
  * wrap-and-sort: New script to wrap long lines and sort items in packaging
    files.

  [ Stefano Rivera ]
  * update-maintainer: Correctly update the Maintainer field to the new Ubuntu
    Developers address (instead of the calling user) when the package is not
    in Debian.

  [ Iain Lane ]
  * all: Use production API rather than edge by default. Should be more
    reliable and was advised by lifeless (LP team).

  [ Michael Bienia ]
  * Add 'natty' to recognized names and make it the default.

  [ Colin Watson ]
  * Fix NAME section of lp-set-dup(1).
  * lp-list-bugs: New tool.
 -- Benjamin Drung <email address hidden> Fri, 24 Sep 2010 16:01:03 +0000

Changed in ubuntu-dev-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.