diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-12 18:56:08 -0700 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-12 18:56:08 -0700 |
commit | 8a29509dd9aa179bfe4ef96d49d72f6816ec878f (patch) | |
tree | 3adc134bbc346804b13acf375b1dfa287225ea44 /libio/libioP.h | |
parent | 84895dca70f972df3842fb88f7b33b5d695cc599 (diff) | |
download | glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.zip glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.gz glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.bz2 |
Fix BZ #16734 -- fopen calls mmap to allocate its buffer
Diffstat (limited to 'libio/libioP.h')
-rw-r--r-- | libio/libioP.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/libio/libioP.h b/libio/libioP.h index 0f16e2d..36170ea 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -760,46 +760,6 @@ extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int) # define munmap __munmap # define ftruncate __ftruncate # endif - -# define ROUND_TO_PAGE(_S) \ - (((_S) + EXEC_PAGESIZE - 1) & ~(EXEC_PAGESIZE - 1)) - -# define FREE_BUF(_B, _S) \ - munmap ((_B), ROUND_TO_PAGE (_S)) -# define ALLOC_BUF(_B, _S, _R) \ - do { \ - (_B) = (char *) mmap (0, ROUND_TO_PAGE (_S), \ - PROT_READ | PROT_WRITE, \ - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \ - if ((_B) == (char *) MAP_FAILED) \ - return (_R); \ - } while (0) -# define ALLOC_WBUF(_B, _S, _R) \ - do { \ - (_B) = (wchar_t *) mmap (0, ROUND_TO_PAGE (_S), \ - PROT_READ | PROT_WRITE, \ - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \ - if ((_B) == (wchar_t *) MAP_FAILED) \ - return (_R); \ - } while (0) - -#else /* _G_HAVE_MMAP */ - -# define FREE_BUF(_B, _S) \ - free(_B) -# define ALLOC_BUF(_B, _S, _R) \ - do { \ - (_B) = (char*)malloc(_S); \ - if ((_B) == NULL) \ - return (_R); \ - } while (0) -# define ALLOC_WBUF(_B, _S, _R) \ - do { \ - (_B) = (wchar_t *)malloc(_S); \ - if ((_B) == NULL) \ - return (_R); \ - } while (0) - #endif /* _G_HAVE_MMAP */ #ifndef OS_FSTAT |