1
/* ``The contents of this file are subject to the Erlang Public License,
2
* Version 1.1, (the "License"); you may not use this file except in
3
* compliance with the License. You should have received a copy of the
4
* Erlang Public License along with this software. If not, it can be
5
* retrieved via the world wide web at http://www.erlang.org/.
7
* Software distributed under the License is distributed on an "AS IS"
8
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
* the License for the specific language governing rights and limitations
12
* The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
* Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
* AB. All Rights Reserved.''
20
* Author: Rickard Green
22
* Description: Driver that fakes driver version 1.0 and tests
23
* driver_system_info().
27
#include "sys_info_drv_impl.h"
29
#define SYS_INFO_DRV_MAJOR_VSN 1
30
#define SYS_INFO_DRV_MINOR_VSN 0
31
#define SYS_INFO_DRV_NAME_STR "sys_info_1_0_drv"
32
#define SYS_INFO_DRV_NAME sys_info_1_0_drv
33
#define SYS_INFO_DRV_LAST_FIELD smp_support
35
#define SYS_INFO_DRV_RES_FORMAT "ok: " \
36
"drv_drv_vsn=%d.%d " \
37
"emu_drv_vsn=%d.%d " \
45
sys_info_drv_max_res_len(ErlDrvSysInfo *sip)
47
size_t slen = strlen(SYS_INFO_DRV_RES_FORMAT) + 1;
48
slen += 2*20; /* drv_drv_vsn */
49
slen += 2*20; /* emu_drv_vsn */
50
slen += strlen(sip->erts_version) + 1;
51
slen += strlen(sip->otp_release) + 1;
52
slen += 5; /* threads */
58
sys_info_drv_sprintf_sys_info(ErlDrvSysInfo *sip, char *str)
61
SYS_INFO_DRV_RES_FORMAT,
62
SYS_INFO_DRV_MAJOR_VSN,
63
SYS_INFO_DRV_MINOR_VSN,
64
sip->driver_major_version,
65
sip->driver_minor_version,
68
sip->thread_support ? "true" : "false",
69
sip->smp_support ? "true" : "false");
72
#include "sys_info_drv_impl.c"