#2038: System.Posix.Resource.setResourceLimit gives "setResourceLimit: invalid
argument (Invalid argument)"
-----------------------------------+----------------------------------------
 Reporter:  slyfox                 |          Owner:         
     Type:  bug                    |         Status:  new    
 Priority:  high                   |      Milestone:  6.8.3  
Component:  libraries/unix         |        Version:  6.8.2  
 Severity:  major                  |     Resolution:         
 Keywords:  regression, ffi, unix  |     Difficulty:  Unknown
 Testcase:                         |   Architecture:  x86    
       Os:  Linux                  |  
-----------------------------------+----------------------------------------
Comment (by slyfox):

 Code like this would look like:
 {{{
 -- strlimit{,64} is taken from C defines
 foreign import ccall unsafe "#hsc2-mega-macro setrlimit" c_setrlimit ::
 CInt -> Ptr RLimit -> IO CInt
 }}}

 Simply grepping by /usr/include got some of funs:
 {{{
 ./unistd.h:#  define lseek lseek64
 ./unistd.h:#   define pread pread64
 ./unistd.h:#   define pwrite pwrite64
 ./unistd.h:#   define truncate truncate64
 ./unistd.h:#   define ftruncate ftruncate64
 ./unistd.h:#   define lockf lockf64

 ./glob.h:# define glob glob64
 ./glob.h:# define globfree globfree64

 ./aio.h:#  define aio_read aio_read64
 ./aio.h:#  define aio_write aio_write64
 ./aio.h:#  define lio_listio lio_listio64
 ./aio.h:#  define aio_error aio_error64
 ./aio.h:#  define aio_return aio_return64
 ./aio.h:#  define aio_cancel aio_cancel64
 ./aio.h:#  define aio_suspend aio_suspend64
 ./aio.h:#  define aio_fsync aio_fsync64

 ./fcntl.h:#  define open open64
 ./fcntl.h:#  define lockf lockf64
 ./fcntl.h:#  define posix_fadvise posix_fadvise64
 ./fcntl.h:#  define posix_fallocate posix_fallocate64

 ./sys/mman.h:#  define mmap mmap64

 ./sys/statvfs.h:#  define statvfs statvfs64
 ./sys/statvfs.h:#  define fstatvfs fstatvfs64
 ./sys/statfs.h:#  define statfs statfs64
 ./sys/statfs.h:#  define fstatfs fstatfs64

 ./dirent.h:#  define readdir readdir64
 ./dirent.h:#   define readdir_r readdir64_r
 ./dirent.h:#   define scandir scandir64

 ./stdlib.h:#   define mkstemp mkstemp64
 }}}

 Is there/can be implemented such functionality hsc2hs?
 Thanks!

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2038#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to