Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/common/brand/lx/tools/README.md
          +++ new/usr/src/common/brand/lx/tools/README.md
   1    1  # Updating Error Number Translations
   2    2  
   3    3  To create an updated error number translation table, you can use the
   4    4  `gen_errno` tool.  This tool requires, as input:
   5    5  
   6    6  * the illumos native `errno.h` file
   7    7  * a set of foreign operating system `errno.h` files
   8    8  
   9    9  The output is a set of translation table entries suitable for inclusion in a
  10   10  cstyled C array.  The index of the array is the native error number and the
  11   11  value at each index is the translated error number for use with the foreign
  12   12  operating system.
  13   13  
  14   14  ## Example
  15   15  
  16   16  To generate a translation table for the LX Brand, you will require two files
  17   17  from the current Linux source:
  18   18  
  19   19  * `include/uapi/asm-generic/errno-base.h` (low-valued, or base, error numbers)
  20   20  * `include/uapi/asm-generic/errno.h` (extended error numbers)
  21   21  
  22   22  Assuming the files are in the current directory, you should run the tool as
  23   23  follows:
  24   24  
  25   25      $ dmake
  26   26      ...
  27   27      $ ./gen_errno -F errno-base.h -F errno.h \
  28   28                    -N $SRC/uts/common/sys/errno.h
  29   29      0, /*  0: No Error                            */
  30   30      1, /*  1: EPERM       -->   1: EPERM          */
  31   31      2, /*  2: ENOENT      -->   2: ENOENT         */
  32   32      3, /*  3: ESRCH       -->   3: ESRCH          */
  33   33      4, /*  4: EINTR       -->   4: EINTR          */
  34   34      5, /*  5: EIO         -->   5: EIO            */
  35   35      6, /*  6: ENXIO       -->   6: ENXIO          */
  36   36      7, /*  7: E2BIG       -->   7: E2BIG          */
  37   37      ...
  38   38  
  39   39  The output may be used in the `$SRC/common/brand/lx/lx_errno.c` file.
  
    | 
      ↓ open down ↓ | 
    39 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX