VirtualBox

Changeset 60393 in vbox for trunk


Ignore:
Timestamp:
Apr 8, 2016 9:47:08 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106479
Message:

Runtime/linux/sysfs: Fixes, implement two forgotten methods

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/linux/sysfs.h

    r60390 r60393  
    364364 * @param   ...         Format args.
    365365 */
    366 RTDECL(int) RTLinuxSysFsReadStrFile(char *pszBuf, size_t cchBuf, size_t *pcchWritten, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5);
     366RTDECL(int) RTLinuxSysFsWriteStrFile(const char *pszBuf, size_t cchBuf, size_t *pcchWritten, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5);
    367367
    368368/**
  • trunk/src/VBox/Runtime/r3/linux/sysfs.cpp

    r60390 r60393  
    394394    }
    395395
    396     int rc = RTLinuxSysFsOpenV(&hFile, pszFormat, va);
     396    int rc = RTLinuxSysFsOpenExV(&hFile, RTFILE_O_OPEN | RTFILE_O_WRITE | RTFILE_O_DENY_NONE, pszFormat, va);
    397397    if (RT_SUCCESS(rc))
    398398    {
     
    518518
    519519
     520RTDECL(int) RTLinuxSysFsWriteStrFileV(const char *pszBuf, size_t cchBuf, size_t *pcchWritten, const char *pszFormat, va_list va)
     521{
     522    RTFILE hFile;
     523
     524    AssertPtrReturn(pszBuf, VERR_INVALID_POINTER);
     525
     526    int rc = RTLinuxSysFsOpenExV(&hFile, RTFILE_O_OPEN | RTFILE_O_WRITE | RTFILE_O_DENY_NONE, pszFormat, va);
     527    if (RT_SUCCESS(rc))
     528    {
     529        rc = RTLinuxSysFsWriteStr(hFile, pszBuf, cchBuf, pcchWritten);
     530        RTFileClose(hFile);
     531    }
     532    return rc;
     533}
     534
     535
     536RTDECL(int) RTLinuxSysFsWriteStrFile(const char *pszBuf, size_t cchBuf, size_t *pcchWritten, const char *pszFormat, ...)
     537{
     538    va_list va;
     539    va_start(va, pszFormat);
     540    int rc = RTLinuxSysFsWriteStrFileV(pszBuf, cchBuf, pcchWritten, pszFormat, va);
     541    va_end(va);
     542    return rc;
     543}
     544
    520545RTDECL(int) RTLinuxSysFsGetLinkDestV(char *pszBuf, size_t cchBuf, size_t *pchBuf, const char *pszFormat, va_list va)
    521546{
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