MCPcopy Create free account
hub / github.com/F-Stack/f-stack / write_buffer

Function write_buffer

freebsd/mips/mips/minidump_machdep.c:117–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117static int
118write_buffer(struct dumperinfo *di, char *ptr, size_t sz)
119{
120 size_t len;
121 int error, c;
122 u_int maxdumpsz;
123
124 maxdumpsz = di->maxiosize;
125
126 if (maxdumpsz == 0) /* seatbelt */
127 maxdumpsz = PAGE_SIZE;
128
129 error = 0;
130
131 while (sz) {
132 len = min(maxdumpsz, sz);
133 counter += len;
134 progress -= len;
135
136 if (counter >> 22) {
137 report_progress(progress, dumpsize);
138 counter &= (1<<22) - 1;
139 }
140
141 wdog_kern_pat(WD_LASTVAL);
142
143 if (ptr) {
144 error = dump_append(di, ptr, 0, len);
145 if (error)
146 return (error);
147 ptr += len;
148 sz -= len;
149 } else {
150 panic("pa is not supported");
151 }
152
153 /* Check for user abort. */
154 c = cncheckc();
155 if (c == 0x03)
156 return (ECANCELED);
157 if (c != -1)
158 printf(" (CTRL-C to abort) ");
159 }
160
161 return (0);
162}
163
164int
165minidumpsys(struct dumperinfo *di)

Callers 1

minidumpsysFunction · 0.85

Calls 6

minFunction · 0.85
dump_appendFunction · 0.85
cncheckcFunction · 0.85
report_progressFunction · 0.70
panicFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected