mirror of git://git.suckless.org/ubase
Make ubase compile with musl-gcc
This commit is contained in:
parent
5c73758bba
commit
bb10563c7a
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ include config.mk
|
||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
|
|
||||||
HDR = arg.h grabmntinfo.h proc.h util.h
|
HDR = arg.h grabmntinfo.h proc.h reboot.h util.h
|
||||||
LIB = \
|
LIB = \
|
||||||
util/agetcwd.o \
|
util/agetcwd.o \
|
||||||
util/apathmax.o \
|
util/apathmax.o \
|
||||||
|
|
7
chvt.c
7
chvt.c
|
@ -1,5 +1,3 @@
|
||||||
#include <linux/vt.h>
|
|
||||||
#include <linux/kd.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -9,6 +7,11 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#define KDGKBTYPE 0x4B33 /* get keyboard type */
|
||||||
|
|
||||||
|
#define VT_ACTIVATE 0x5606 /* make vt active */
|
||||||
|
#define VT_WAITACTIVE 0x5607 /* wait for vt active */
|
||||||
|
|
||||||
char *vts[] = {
|
char *vts[] = {
|
||||||
"/proc/self/fd/0",
|
"/proc/self/fd/0",
|
||||||
"/dev/console",
|
"/dev/console",
|
||||||
|
|
2
halt.c
2
halt.c
|
@ -1,8 +1,8 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
#include <linux/reboot.h>
|
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "reboot.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
2
reboot.c
2
reboot.c
|
@ -1,8 +1,8 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
#include <linux/reboot.h>
|
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "reboot.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Magic values required to use _reboot() system call.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LINUX_REBOOT_MAGIC1 0xfee1dead
|
||||||
|
#define LINUX_REBOOT_MAGIC2 672274793
|
||||||
|
#define LINUX_REBOOT_MAGIC2A 85072278
|
||||||
|
#define LINUX_REBOOT_MAGIC2B 369367448
|
||||||
|
#define LINUX_REBOOT_MAGIC2C 537993216
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Commands accepted by the _reboot() system call.
|
||||||
|
*
|
||||||
|
* RESTART Restart system using default command and mode.
|
||||||
|
* HALT Stop OS and give system control to ROM monitor, if any.
|
||||||
|
* CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
|
||||||
|
* CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
|
||||||
|
* POWER_OFF Stop OS and remove all power from system, if possible.
|
||||||
|
* RESTART2 Restart system using given command string.
|
||||||
|
* SW_SUSPEND Suspend system using software suspend if compiled in.
|
||||||
|
* KEXEC Restart system using a previously loaded Linux kernel
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LINUX_REBOOT_CMD_RESTART 0x01234567
|
||||||
|
#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
|
||||||
|
#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
|
||||||
|
#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
|
||||||
|
#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
|
||||||
|
#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
|
||||||
|
#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
|
||||||
|
#define LINUX_REBOOT_CMD_KEXEC 0x45584543
|
Loading…
Reference in New Issue