/
githubmirror
/
lsof
Обзор
Документация
Войти
/
githubmirror
/
lsof
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.92.1
OLD/main_c.dbg
53 строки
1 KB
Masatake YAMATO
Import the final source tree published by Vic, the original lsof maintainer.
23 июл 2018, 06:45
23 июл 2018, 06:45
8662085
Код
Авторство
О чём код?
char psb[64]; /* DEBUG in main()'s declarations */ (void) snpf(psb, sizeof(psb), "/bin/ps -l -p %d", Mypid); /* DEBUG before the do loop */ DBMon=1; /* DEBUG in the do loop before gather_proc_info() */ system(psb); /* DEBUG in the sleep section after fflush() */ /* start DEBUG section after the end of main() */ int DBMon=0; void * lsofcalloc(char *f, int l, size_t n, size_t s) { #undef calloc void *v; v = (void *)calloc(n, s); if (DBMon) (void) fprintf(stderr, "MEMa %#x %s:%d calloc(%d, %d)\n", v, f, l, n, s); return(v); } void lsoffree(char *f, int l, void *p) { #undef free (void) free(p); if (DBMon) (void) fprintf(stderr, "MEMf %#x %s:%d free\n", p, f, l); } void * lsofmalloc(char *f, int l, size_t s) { #undef malloc void *v; v = (void *)malloc(s); if (DBMon) (void) fprintf(stderr, "MEMa %#x %s:%d malloc(%d)\n", v, f, l, s); return(v); } void * lsofrealloc(char *f, int l, void *p, size_t s) { #undef realloc void *v; v = (void *)realloc(p, s); if (DBMon) (void) fprintf(stderr, "MEMr %#x %#x %s:%d realloc(%d)\n", p, v, f, l, s); return(v); } /* end DEBUG section */