File: vmcp.h

package info (click to toggle)
s390-tools 2.35.0-3
  • links: PTS
  • area: main
  • in suites: forky
  • size: 12,248 kB
  • sloc: ansic: 184,236; sh: 12,152; cpp: 4,954; makefile: 2,763; perl: 2,519; asm: 1,085; python: 697; xml: 29
file content (52 lines) | stat: -rw-r--r-- 1,322 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * vmcp - z/VM CP command library
 *
 * Copyright IBM Corp. 2005, 2018
 *
 * s390-tools is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef LIB_VMCP_H
#define LIB_VMCP_H

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#define	VMCP_DEVICE_NODE	"/dev/vmcp"	/* VMCP device name */
#define	VMCP_DEFAULT_BUFSZ	0x4000		/* VMCP default buffer size */

/*
 * Error codes returned by vmcp() function. This enables the caller
 * to emit a detailed error message on the type of failure.
 */
#define	VMCP_SUCCESS	0	/* VMCP operation completed successfully */
#define	VMCP_ERR_OPEN		(-1)	/* Error Open of VMCP device */
#define	VMCP_ERR_SETBUF		(-2)	/* Error VMCP_SETBUF ioctl */
#define	VMCP_ERR_READ		(-3)	/* Error VMCP read system call */
#define	VMCP_ERR_GETCODE	(-4)	/* Error VMCP_GETCODE ioctl */
#define	VMCP_ERR_GETSIZE	(-5)	/* Error VMCP_GETSIZE ioctl */
#define	VMCP_ERR_TOOSMALL	(-6)	/* Error VMCP buffer too small for
					 * response
					 */
#define	VMCP_ERR_WRITE		(-7)	/* Error VMCP write system call */

struct vmcp_parm {
	const char *cpcmd;
	unsigned int buffer_size;
	bool do_upper;
	int cprc;
	char *response;
	unsigned int response_size;
};

int vmcp(struct vmcp_parm *cp);

#ifdef __cplusplus
}
#endif

#endif