/* See LICENSE file for copyright and license details. */ #include "../libsyscalls.h" #include #include #include #include #if defined(__clang__) # pragma clang diagnostic ignored "-Wunsafe-buffer-usage" /* clang is just being silly */ #endif int main(int argc, char **argv) { int os, arch, width; unsigned alignment = 0; enum libsyscalls_error err; if (argc != 6) { fprintf(stderr, "usage error\n"); return 3; } os = atoi(argv[1]); arch = atoi(argv[2]); width = atoi(argv[3]); err = libsyscalls_get_integer_alignment((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, (unsigned)width, &alignment); if (err) { fprintf(stderr, "get-integer-alignment %s %s %s: ", argv[4], argv[5], argv[3]); libsyscalls_perror(NULL, err); return 1; } printf("%u\n", alignment); if (fflush(stdout) || fclose(stdout)) { perror(NULL); return 1; } return 0; }