view rvinterf/include/ffserr.h @ 465:003e48f8ebe1

rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel I generally don't use NULL and use plain 0 instead, based on a "NULL considered harmful" discussion on the classiccmp mailing list many aeons ago (I couldn't find it, and I reason that it must have been 2005 or earlier), but a recent complaint by a packager sent me searching, and I found this: https://ewontfix.com/11/ While I don't give a @#$% about "modern" systems and code-nazi tools, I realized that passing a plain 0 as a pointer sentinel in execl is wrong because it will break on systems where pointers are longer than the plain int type. Again, I don't give a @#$% about the abomination of x86_64 and the like, but if anyone ever manages to port my code to something like a PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0 as a function argument where a pointer is expected most definitely won't work: if the most natural stack slot and SP alignment unit is 16 bits, fitting an int, with longs and pointers taking up two such slots, then the call stack will be totally wrong with a plain 0 passed for a pointer. Casting the 0 to (char *) ought to be the most kosher solution for the most retro systems possible.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Feb 2019 00:00:19 +0000
parents e7502631a0f9
children
line wrap: on
line source

/*
 * FFS error codes as returned in TMFFS2 response byte packets:
 * these are positive, whereas the ones in the gsm-fw code
 * are negative.
 */

enum TMFFS_ERRORS {
    TMFFS_ERR_NODEVICE    = 1,  /* flash device unknown */
    TMFFS_ERR_CORRUPTED   = 2,  /* filesystem corrupted!? */
    TMFFS_ERR_NOPREFORMAT = 3,  /* ffs not preformatted */
    TMFFS_ERR_NOFORMAT    = 4,  /* ffs not formatted */
    TMFFS_ERR_BADFORMAT   = 5,  /* incompatible ffs version, re-format needed */
    TMFFS_ERR_MAGIC       = 6,  /* bad magic */
    TMFFS_ERR_AGAIN       = 7,  /* not ready, try again later */
    TMFFS_ERR_NOSYS       = 8,  /* function not implemented */
    TMFFS_ERR_DRIVER      = 9,  /* ffs device driver error */

    TMFFS_ERR_NOSPACE     = 10, /* out of data space */
    TMFFS_ERR_FSFULL      = 11, /* file system full, no free inodes */
    TMFFS_ERR_BADNAME     = 12, /* bad filename */
    TMFFS_ERR_NOTFOUND    = 13, /* object not found */
    TMFFS_ERR_EXISTS      = 14, /* object exists */
    TMFFS_ERR_ACCESS      = 15, /* access permission violation */
    TMFFS_ERR_NAMETOOLONG = 16, /* filename too long */
    TMFFS_ERR_INVALID     = 17, /* invalid argument */
    TMFFS_ERR_DIRNOTEMPTY = 18, /* directory not empty */
    TMFFS_ERR_NOTADIR     = 19, /* object is not a directory */
    TMFFS_ERR_SPARE       = 20, /* SPARE */
    TMFFS_ERR_FILETOOBIG  = 21, /* file too big */
    TMFFS_ERR_NOTAFILE    = 22, /* object is not a file */
    TMFFS_ERR_PATHTOODEEP = 23, /* path too deep */

    TMFFS_ERR_NUMFD       = 24, /* Max number of open files reached */
    TMFFS_ERR_BADFD       = 25, /* Bad file descriptor */
    TMFFS_ERR_BADOP       = 26, /* Bad operation */
    TMFFS_ERR_LOCKED      = 27, /* The file is locked */

    TMFFS_ERR_TOOBIG      = 30, /* too big (tmffs buffer overflow) */
    TMFFS_ERR_MEMORY      = 31, /* out of memory */
    TMFFS_ERR_MSGSEND     = 32, /* message send failed */

    /* debug errors - ??? */

    TMFFS_ERR_SIBLINGLOOP = 40, /* directory sibling loop */
    TMFFS_ERR_NOBLOCKS    = 41, /* No more blocks!? */
    TMFFS_ERR_DBR         = 42, /* Data reclaim did not finish!? */
    TMFFS_ERR_RECLAIMLOOP = 43  /* Data reclaim loop */
};