Changeset 1645 for zzuf


Ignore:
Timestamp:
Jan 10, 2007, 6:31:58 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Removed brk/sbrk, they're so outdated and useless.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/doc/zzuf.1

    r1641 r1645  
    291291Memory management:
    292292\fBmmap\fR(), \fBmunmap\fR(), \fBmalloc\fR(), \fBcalloc\fR(), \fBvalloc\fR(),
    293 \fBfree\fR(), \fBmemalign\fR(), \fBposix_memalign\fR(), \fBbrk\fR(),
    294 \fBsbrk\fR()
     293\fBfree\fR(), \fBmemalign\fR(), \fBposix_memalign\fR()
    295294.TP
    296295Linux-specific:
  • zzuf/trunk/src/load-mem.c

    r1644 r1645  
    5454#include "fd.h"
    5555
     56/* TODO: mremap, maybe brk/sbrk */
     57
    5658/* Library functions that we divert */
    5759static void *  (*calloc_orig)   (size_t nmemb, size_t size);
     
    6769#endif
    6870static void *  (*realloc_orig)  (void *ptr, size_t size);
    69 static int     (*brk_orig)      (void *end_data_segment);
    70 static void *  (*sbrk_orig)     (intptr_t increment);
    7171
    7272static void *  (*mmap_orig)     (void *start, size_t length, int prot,
    7373                                 int flags, int fd, off_t offset);
    74 /* TODO */
    75 /* static void *  (*mremap_orig)   (void *old_address, size_t old_size,
    76                                  size_t new_size, int flags); */
    7774#ifdef HAVE_MMAP64
    7875static void *  (*mmap64_orig)   (void *start, size_t length, int prot,
     
    9996    LOADSYM(posix_memalign);
    10097#endif
    101     LOADSYM(brk);
    102     LOADSYM(sbrk);
    10398
    10499    LOADSYM(mmap);
     
    202197}
    203198#endif
    204 
    205 int brk(void *end_data_segment)
    206 {
    207     int ret;
    208     if(!_zz_ready)
    209         LOADSYM(brk);
    210     ret = brk_orig(end_data_segment);
    211     if(ret == -1 && _zz_memory && errno == ENOMEM)
    212         raise(SIGKILL);
    213     return ret;
    214 }
    215 
    216 void *sbrk(intptr_t increment)
    217 {
    218     void *ret;
    219     if(!_zz_ready)
    220         LOADSYM(sbrk);
    221     ret = sbrk_orig(increment);
    222     if(ret == (void *)-1 && _zz_memory && errno == ENOMEM)
    223         raise(SIGKILL);
    224     return ret;
    225 }
    226199
    227200/* Table used for mmap() and munmap() */
Note: See TracChangeset for help on using the changeset viewer.