cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

usage.c (604B)


      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 <stdio.h>
     12#include <stdlib.h>
     13#include <linux/compiler.h>
     14
     15static __noreturn void usage_builtin(const char *err)
     16{
     17	fprintf(stderr, "\n Usage: %s\n", err);
     18	exit(129);
     19}
     20
     21/* If we are in a dlopen()ed .so write to a global variable would segfault
     22 * (ugh), so keep things static. */
     23static void (*usage_routine)(const char *err) __noreturn = usage_builtin;
     24
     25void usage(const char *err)
     26{
     27	usage_routine(err);
     28}