imgact_elf.c (f94594b37a145b9b3e9ff31af2cd1dc3de8aa4d4) imgact_elf.c (e6b95927f39018d10fcfc39f8236525c72b84d06)
1/*-
2 * Copyright (c) 2000 David O'Brien
3 * Copyright (c) 1995-1996 Søren Schmidt
4 * Copyright (c) 1996 Peter Wemm
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 1945 unchanged lines hidden (view full) ---

1954CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE);
1955#endif
1956
1957static void
1958note_procstat_vmmap(void *arg, struct sbuf *sb, size_t *sizep)
1959{
1960 struct proc *p;
1961 size_t size;
1/*-
2 * Copyright (c) 2000 David O'Brien
3 * Copyright (c) 1995-1996 Søren Schmidt
4 * Copyright (c) 1996 Peter Wemm
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 1945 unchanged lines hidden (view full) ---

1954CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE);
1955#endif
1956
1957static void
1958note_procstat_vmmap(void *arg, struct sbuf *sb, size_t *sizep)
1959{
1960 struct proc *p;
1961 size_t size;
1962 int structsize;
1962 int structsize, vmmap_flags;
1963
1963
1964 if (coredump_pack_vmmapinfo)
1965 vmmap_flags = KERN_VMMAP_PACK_KINFO;
1966 else
1967 vmmap_flags = 0;
1968
1964 p = (struct proc *)arg;
1969 p = (struct proc *)arg;
1970 structsize = sizeof(struct kinfo_vmentry);
1965 if (sb == NULL) {
1966 size = 0;
1967 sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN);
1968 sbuf_set_drain(sb, sbuf_drain_count, &size);
1969 sbuf_bcat(sb, &structsize, sizeof(structsize));
1970 PROC_LOCK(p);
1971 if (sb == NULL) {
1972 size = 0;
1973 sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN);
1974 sbuf_set_drain(sb, sbuf_drain_count, &size);
1975 sbuf_bcat(sb, &structsize, sizeof(structsize));
1976 PROC_LOCK(p);
1971 kern_proc_vmmap_out(p, sb);
1977 kern_proc_vmmap_out(p, sb, -1, vmmap_flags);
1972 sbuf_finish(sb);
1973 sbuf_delete(sb);
1974 *sizep = size;
1975 } else {
1978 sbuf_finish(sb);
1979 sbuf_delete(sb);
1980 *sizep = size;
1981 } else {
1976 structsize = sizeof(struct kinfo_vmentry);
1977 sbuf_bcat(sb, &structsize, sizeof(structsize));
1978 PROC_LOCK(p);
1982 sbuf_bcat(sb, &structsize, sizeof(structsize));
1983 PROC_LOCK(p);
1979 kern_proc_vmmap_out(p, sb);
1984 kern_proc_vmmap_out(p, sb, *sizep - sizeof(structsize),
1985 vmmap_flags);
1980 }
1981}
1982
1983static void
1984note_procstat_groups(void *arg, struct sbuf *sb, size_t *sizep)
1985{
1986 struct proc *p;
1987 size_t size;

--- 241 unchanged lines hidden ---
1986 }
1987}
1988
1989static void
1990note_procstat_groups(void *arg, struct sbuf *sb, size_t *sizep)
1991{
1992 struct proc *p;
1993 size_t size;

--- 241 unchanged lines hidden ---