Staging
v0.8.1
https://github.com/torvalds/linux
Raw File
Tip revision: 830b3c68c1fb1e9176028d02ef86f3cf76aa2476 authored by Linus Torvalds on 11 December 2022, 22:15:18 UTC
Linux 6.1
Tip revision: 830b3c6
usage.c
// SPDX-License-Identifier: GPL-2.0
/*
 * usage.c
 *
 * Various reporting routines.
 * Originally copied from GIT source.
 *
 * Copyright (C) Linus Torvalds, 2005
 */
#include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include <linux/compiler.h>

static __noreturn void usage_builtin(const char *err)
{
	fprintf(stderr, "\n Usage: %s\n", err);
	exit(129);
}

/* If we are in a dlopen()ed .so write to a global variable would segfault
 * (ugh), so keep things static. */
static void (*usage_routine)(const char *err) __noreturn = usage_builtin;

void usage(const char *err)
{
	usage_routine(err);
}
back to top