MCPcopy Index your code
hub / github.com/RsyncProject/rsync / write_longint

Function write_longint

io.c:2222–2240  ·  view source on GitHub ↗

* Note: int64 may actually be a 32-bit type if ./configure couldn't find any * 64-bit types on this platform. */

Source from the content-addressed store, hash-verified

2220 * 64-bit types on this platform.
2221 */
2222void write_longint(int f, int64 x)
2223{
2224 char b[12], * const s = b+4;
2225
2226 SIVAL(s, 0, x);
2227 if (x <= 0x7FFFFFFF && x >= 0) {
2228 write_buf(f, s, 4);
2229 return;
2230 }
2231
2232#if SIZEOF_INT64 < 8
2233 rprintf(FERROR, "Integer overflow: attempted 64-bit offset\n");
2234 exit_cleanup(RERR_UNSUPPORTED);
2235#else
2236 memset(b, 0xFF, 4);
2237 SIVAL(s, 4, x >> 32);
2238 write_buf(f, b, 12);
2239#endif
2240}
2241
2242void write_bigbuf(int f, const char *buf, size_t len)
2243{

Callers 2

write_varlong30Function · 0.85
send_file_entryFunction · 0.85

Calls 3

SIVALFunction · 0.85
write_bufFunction · 0.85
rprintfFunction · 0.70

Tested by

no test coverage detected