~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to erts/emulator/test/driver_SUITE_data/sys_info_prev_drv.c

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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/.
 
6
 *
 
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
 
10
 * under the License.
 
11
 *
 
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.''
 
15
 *
 
16
 *     $Id$
 
17
 */
 
18
 
 
19
/*
 
20
 * Author: Rickard Green
 
21
 *
 
22
 * Description: Driver that fakes driver version 2.0 and tests
 
23
 *              driver_system_info().
 
24
 *
 
25
 */
 
26
 
 
27
#include "sys_info_drv_impl.h"
 
28
 
 
29
#define SYS_INFO_DRV_MAJOR_VSN          2
 
30
#define SYS_INFO_DRV_MINOR_VSN          0
 
31
#define SYS_INFO_DRV_NAME_STR           "sys_info_prev_drv"
 
32
#define SYS_INFO_DRV_NAME               sys_info_prev_drv
 
33
#define SYS_INFO_DRV_LAST_FIELD         scheduler_threads
 
34
#define ERL_DRV_SYS_INFO_SIZE           sizeof(ErlDrvSysInfo)
 
35
 
 
36
#define SYS_INFO_DRV_RES_FORMAT "ok: "  \
 
37
  "drv_drv_vsn=%d.%d "                  \
 
38
  "emu_drv_vsn=%d.%d "                  \
 
39
  "erts_vsn=%s "                        \
 
40
  "otp_vsn=%s "                         \
 
41
  "thread=%s "                          \
 
42
  "smp=%s "                             \
 
43
  "async_thrs=%d "                      \
 
44
  "sched_thrs=%d"
 
45
 
 
46
static size_t
 
47
sys_info_drv_max_res_len(ErlDrvSysInfo *sip)
 
48
{
 
49
    size_t slen = strlen(SYS_INFO_DRV_RES_FORMAT) + 1;
 
50
    slen += 2*20;       /* drv_drv_vsn */
 
51
    slen += 2*20;       /* emu_drv_vsn */
 
52
    slen += strlen(sip->erts_version) + 1;
 
53
    slen += strlen(sip->otp_release) + 1;
 
54
    slen += 5;          /* threads */
 
55
    slen += 5;          /* smp */
 
56
    slen += 20;         /* async_thrs */
 
57
    slen += 20;         /* sched_thrs */
 
58
    return slen;
 
59
}
 
60
 
 
61
static size_t
 
62
sys_info_drv_sprintf_sys_info(ErlDrvSysInfo *sip, char *str)
 
63
{
 
64
    return sprintf(str,
 
65
                   SYS_INFO_DRV_RES_FORMAT,
 
66
                   SYS_INFO_DRV_MAJOR_VSN,
 
67
                   SYS_INFO_DRV_MINOR_VSN,
 
68
                   sip->driver_major_version,
 
69
                   sip->driver_minor_version,
 
70
                   sip->erts_version,
 
71
                   sip->otp_release,
 
72
                   sip->thread_support ? "true" : "false",
 
73
                   sip->smp_support ? "true" : "false",
 
74
                   sip->async_threads,
 
75
                   sip->scheduler_threads);
 
76
}
 
77
 
 
78
#include "sys_info_drv_impl.c"