Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44995

lookup table of errno macro names for logging

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Internal Code
    • Labels:
      None

      Description

      strerror(EINTR) gives us "Interrupted system call", but sometimes we really want "EINTR".

      This is how the `errno` tool (from moreutils) generates the list of errno values.
      They use $(CC) to scrape <errno.h> to generate their own header table.
      The -dD flag is a debug switch to make gcc retain macro definitions in the -E source.
      errnos.h:

      echo "#include <errno.h>" > dump.c ;
      gcc -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%s},\n", $2, $2 }'
      

       

        Attachments

        1. errnos-mac.h
          2 kB
        2. errnos-linux.h
          3 kB

          Activity

            People

            Assignee:
            backlog-server-devtools DO NOT USE - Backlog - Dev Tools
            Reporter:
            billy.donahue Billy Donahue
            Participants:
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: