1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * usage.c 4 * 5 * Various reporting routines. 6 * Originally copied from GIT source. 7 * 8 * Copyright (C) Linus Torvalds, 2005 9 */ 10 #include "util.h" 11 #include "debug.h" 12 #include <stdio.h> 13 #include <stdlib.h> 14 #include <linux/compiler.h> 15 16 static __noreturn void usage_builtin(const char *err) 17 { 18 fprintf(stderr, "\n Usage: %s\n", err); 19 exit(129); 20 } 21 22 /* If we are in a dlopen()ed .so write to a global variable would segfault 23 * (ugh), so keep things static. */ 24 static void (*usage_routine)(const char *err) __noreturn = usage_builtin; 25 26 void usage(const char *err) 27 { 28 usage_routine(err); 29 } 30