Ticket #7773: 0001-Add-an-errno-symbol-eNOTSUP.patch

File 0001-Add-an-errno-symbol-eNOTSUP.patch, 4.6 KB (added by PHO, 13 months ago)
  • Foreign/C/Error.hs

    From 1bfb4049a0c4fbea018c7f184700791b87a3c64d Mon Sep 17 00:00:00 2001
    From: PHO <pho@cielonegro.org>
    Date: Mon, 18 Mar 2013 14:31:03 +0900
    Subject: [PATCH] Add an errno symbol: eNOTSUP
    
    ENOTSUP is a standard errno defined by IEEE Std 1003.1.
    See: http://pubs.opengroup.org/onlinepubs/000095399/basedefs/errno.h.html
    ---
     Foreign/C/Error.hs | 6 ++++--
     configure.ac       | 2 +-
     2 files changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs
    index 4d33262..41bdc6b 100644
    a b module Foreign.C.Error ( 
    3434  eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,  
    3535  eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,  
    3636  eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,  
    37   eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTTY, eNXIO,  
     37  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,  
    3838  eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,  
    3939  ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,  
    4040  eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,  
    eOK, e2BIG, eACCES, eADDRINUSE, eADDRNOTAVAIL, eADV, eAFNOSUPPORT, eAGAIN, 
    141141  eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,  
    142142  eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,  
    143143  eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,  
    144   eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTTY, eNXIO,  
     144  eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,  
    145145  eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,  
    146146  ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,  
    147147  eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,  
    eNOTCONN = Errno (CONST_ENOTCONN) 
    218218eNOTDIR         = Errno (CONST_ENOTDIR) 
    219219eNOTEMPTY       = Errno (CONST_ENOTEMPTY) 
    220220eNOTSOCK        = Errno (CONST_ENOTSOCK) 
     221eNOTSUP         = Errno (CONST_ENOTSUP) 
    221222eNOTTY          = Errno (CONST_ENOTTY) 
    222223eNXIO           = Errno (CONST_ENXIO) 
    223224eOPNOTSUPP      = Errno (CONST_EOPNOTSUPP) 
    errnoToIOError loc errno maybeHdl maybeName = unsafePerformIO $ do 
    551552        | errno == eNOTDIR         = InappropriateType 
    552553        | errno == eNOTEMPTY       = UnsatisfiedConstraints 
    553554        | errno == eNOTSOCK        = InvalidArgument 
     555        | errno == eNOTSUP         = UnsupportedOperation 
    554556        | errno == eNOTTY          = IllegalOperation 
    555557        | errno == eNXIO           = NoSuchThing 
    556558        | errno == eOPNOTSUPP      = UnsupportedOperation 
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 7553a7a..b7f843f 100644
    a b FPTOOLS_CHECK_HTYPE(intmax_t) 
    139139FPTOOLS_CHECK_HTYPE(uintmax_t) 
    140140 
    141141# test errno values 
    142 FP_CHECK_CONSTS([E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR], [#include <stdio.h> 
     142FP_CHECK_CONSTS([E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTSUP ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV ENOCIGAR], [#include <stdio.h> 
    143143#include <errno.h>]) 
    144144 
    145145# we need SIGINT in TopHandler.lhs