VirtualBox

Changeset 61084 in vbox for trunk


Ignore:
Timestamp:
May 20, 2016 8:48:52 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107351
Message:

Main/PerformanceSolaris.cpp: fix struct version incompatibilities between Solaris versions by reading what we need (S10 has a struct with about 350 bytes, and S11.3 already has 440, with several increases for various S11 versions)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp

    r48020 r61084  
    77
    88/*
    9  * Copyright (C) 2008-2013 Oracle Corporation
     9 * Copyright (C) 2008-2016 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    306306    if (h != -1)
    307307    {
    308         if (read(h, &psinfo, sizeof(psinfo)) == sizeof(psinfo))
     308        /* psinfo_t keeps growing, so only read what we need to maximize
     309         * cross-version compatibility. The structures are compatible. */
     310        ssize_t cb = RT_OFFSETOF(psinfo_t, pr_rssize) + RT_SIZEOFMEMB(psinfo_t, pr_rssize);
     311        AssertCompile(RT_OFFSETOF(psinfo_t, pr_rssize) > RT_OFFSETOF(psinfo_t, pr_pid));
     312        if (read(h, &psinfo, cb) == cb)
    309313        {
    310314            Assert((pid_t)process == psinfo.pr_pid);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette