Lines Matching +full:qemu +full:- +full:bundle

25 #include "qemu/osdep.h"
26 #include "qemu/host-utils.h"
43 #include <mach-o/dyld.h>
51 #include "qemu/ctype.h"
52 #include "qemu/cutils.h"
53 #include "qemu/error-report.h"
59 memset(buf + len, pad, buf_size - len); in strpadcpy()
72 if (c == 0 || q >= buf + buf_size - 1) in pstrcpy()
85 pstrcpy(buf + len, buf_size - len, s); in pstrcat()
158 int y = tm->tm_year + 1900, m = tm->tm_mon + 1, d = tm->tm_mday; in mktimegm()
161 y--; in mktimegm()
163 t = 86400ULL * (d + (153 * m - 457) / 5 + 365 * y + y / 4 - y / 100 + in mktimegm()
164 y / 400 - 719469); in mktimegm()
165 t += 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec; in mktimegm()
187 return -1; in suffix_mul()
194 * - 12345 - decimal, scale determined by @default_suffix and @unit
195 * - 12345{bBkKmMgGtTpPeE} - decimal, scale determined by suffix and @unit
196 * - 12345.678{kKmMgGtTpPeE} - decimal, scale determined by suffix, and
198 * - 0x7fEE - hexadecimal, unit determined by @default_suffix
201 * - hex with scaling suffix, such as 0x20M or 0x1p3 (both fail with
202 * -EINVAL), while 0x1b is 27 (not 1 with byte scale)
203 * - octal, such as 08 (parsed as decimal instead)
204 * - binary, such as 0b1000 (parsed as 0b with trailing garbage "1000")
205 * - fractional hex, such as 0x1.8 (parsed as 0 with trailing garbage "x1.8")
206 * - negative values, including -0 (fail with -ERANGE)
207 * - floating point exponents, such as 1e3 (parsed as 1e with trailing
209 * - non-finite values, such as inf or NaN (fail with -EINVAL)
213 * non-zero fraction, then the input must be decimal and there must be
218 * Return -ERANGE on overflow (with *@end advanced), and -EINVAL on
235 if (retval == -ERANGE || !nptr) { in do_strtosz()
246 retval = -EINVAL; in do_strtosz()
283 endptr += tail - copy; in do_strtosz()
285 retval = -ERANGE; in do_strtosz()
290 /* Extract into a 64-bit fixed-point fraction. */ in do_strtosz()
293 retval = -ERANGE; in do_strtosz()
297 } else if (retval == -ERANGE) { in do_strtosz()
302 /* We want non-zero valf for any non-zero fraction */ in do_strtosz()
324 retval = -EINVAL; in do_strtosz()
330 /* Compute exact result: 64.64 x 64.0 -> 128.64 fixed point */ in do_strtosz()
343 retval = -ERANGE; in do_strtosz()
354 retval = -EINVAL; in do_strtosz()
360 if (end && retval == -EINVAL) { in do_strtosz()
409 return -EINVAL; in check_strtox_error()
414 return -EINVAL; in check_strtox_error()
417 return -libc_errno; in check_strtox_error()
430 * @result, and return -EINVAL.
433 * -EINVAL with @result set to the parsed value. This is the case
434 * when the pointer that would be stored in a non-null @endptr points
438 * and return -ERANGE.
441 * and return -ERANGE.
445 * This matches the behavior of strtol() on 32-bit platforms, even on
446 * platforms where long is 64-bits.
460 return -EINVAL; in qemu_strtoi()
487 * @result, and return -EINVAL.
490 * -EINVAL with @result set to the parsed value. This is the case
491 * when the pointer that would be stored in a non-null @endptr points
495 * and return -ERANGE.
501 * @result's type). This matches the behavior of strtoul() on 32-bit
502 * platforms, even on platforms where long is 64-bits.
517 return -EINVAL; in qemu_strtoui()
523 /* Windows returns 1 for negative out-of-range values. */ in qemu_strtoui()
525 *result = -1; in qemu_strtoui()
528 * Note that platforms with 32-bit strtoul only accept input in qemu_strtoui()
529 * in the range [-4294967295, 4294967295]; but we used 64-bit in qemu_strtoui()
530 * strtoull which wraps -18446744073709551615 to 1 instead of in qemu_strtoui()
531 * declaring overflow. So we must check if '-' was parsed, in qemu_strtoui()
534 neg = memchr(nptr, '-', ep - nptr) != NULL; in qemu_strtoui()
536 lresult = -lresult; in qemu_strtoui()
542 *result = neg ? -lresult : lresult; in qemu_strtoui()
558 * @result, and return -EINVAL.
561 * -EINVAL with @result set to the parsed value. This is the case
562 * when the pointer that would be stored in a non-null @endptr points
566 * and return -ERANGE.
569 * and return -ERANGE.
584 return -EINVAL; in qemu_strtol()
602 * @result, and return -EINVAL.
605 * -EINVAL with @result set to the parsed value. This is the case
606 * when the pointer that would be stored in a non-null @endptr points
610 * and return -ERANGE.
629 return -EINVAL; in qemu_strtoul()
634 /* Windows returns 1 for negative out-of-range values. */ in qemu_strtoul()
636 *result = -1; in qemu_strtoul()
658 return -EINVAL; in qemu_strtoi64()
686 return -EINVAL; in qemu_strtou64()
693 /* Windows returns 1 for negative out-of-range values. */ in qemu_strtou64()
695 *result = -1; in qemu_strtou64()
710 * @result, and return -EINVAL.
713 * -EINVAL with @result set to the parsed value. This is the case
714 * when the pointer that would be stored in a non-null @endptr points
717 * If the conversion overflows, store +/-HUGE_VAL in @result, depending
718 * on the sign, and return -ERANGE.
720 * If the conversion underflows, store +/-0.0 in @result, depending on the
721 * sign, and return -ERANGE.
734 return -EINVAL; in qemu_strtod()
746 * that cause ERANGE overflow errors are rejected with -EINVAL as if
748 * any sign. -ERANGE failures for underflow still preserve the parsed
762 ret = -EINVAL; in qemu_strtod_finite()
766 ret = -EINVAL; in qemu_strtod_finite()
797 * '+' or '-', an optional "0x" if @base is 0 or 16, one or more digits.
800 * above, set *@value to 0, *@endptr to @s, and return -EINVAL.
805 * instead causes a result of -EINVAL with *@value of 0.
807 * If the integer is negative, set *@value to 0, and return -ERANGE.
812 * ULLONG_MAX, and return -ERANGE.
824 r = -EINVAL; in parse_uint()
831 r = -errno; in parse_uint()
836 r = -EINVAL; in parse_uint()
844 if (*s == '-') { in parse_uint()
846 r = -ERANGE; in parse_uint()
855 r = -EINVAL; in parse_uint()
889 return -1; in qemu_parse_fd()
896 * Input is limited to 14-bit numbers
920 return -1; in uleb128_decode_small()
988 i = (i - 1) / 10 * 10; in size_to_str()
1020 #if !defined(__clang__) || __has_warning("-Warray-bounds=") in starts_with_prefix()
1021 #pragma GCC diagnostic ignored "-Warray-bounds=" in starts_with_prefix()
1057 len = GetModuleFileName(NULL, buf, sizeof(buf) - 1); in qemu_init_exec_dir()
1063 p = buf + len - 1; in qemu_init_exec_dir()
1065 p--; in qemu_init_exec_dir()
1084 len = readlink("/proc/self/exe", buf, sizeof(buf) - 1); in qemu_init_exec_dir()
1094 static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; in qemu_init_exec_dir()
1096 static int mib[4] = {CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME}; in qemu_init_exec_dir()
1098 size_t len = sizeof(buf) - 1; in qemu_init_exec_dir()
1103 buf[sizeof(buf) - 1] = '\0'; in qemu_init_exec_dir()
1127 buf[sizeof(buf) - 1] = 0; in qemu_init_exec_dir()
1158 g_string_append(result, "/qemu-bundle"); in get_relocated_path()
1159 if (access(result->str, R_OK) == 0) { in get_relocated_path()
1169 char *cursor = result->str + result->len; in get_relocated_path()
1170 g_string_set_size(result, result->len + size); in get_relocated_path()
1204 assert(G_IS_DIR_SEPARATOR(dir[-1])); in get_relocated_path()
1205 g_string_append(result, dir - 1); in get_relocated_path()