VirtualBox

Changeset 44298 in vbox


Ignore:
Timestamp:
Jan 15, 2013 2:54:18 PM (12 years ago)
Author:
vboxsync
Message:

Implemented RTFileSetOwner on non-windows systems.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r44278 r44298  
    510510# define RTFileSetForceFlags                            RT_MANGLER(RTFileSetForceFlags)
    511511# define RTFileSetMode                                  RT_MANGLER(RTFileSetMode)
     512# define RTFileSetOwner                                 RT_MANGLER(RTFileSetOwner)
    512513# define RTFileSetSize                                  RT_MANGLER(RTFileSetSize)
    513514# define RTFileSetTimes                                 RT_MANGLER(RTFileSetTimes)
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r43363 r44298  
    712712
    713713
     714RTDECL(int) RTFileSetOwner(RTFILE hFile, uint32_t uid, uint32_t gid)
     715{
     716    uid_t uidNative = uid != NIL_RTUID ? (uid_t)uid : (uid_t)-1;
     717    AssertReturn(uid == uidNative, VERR_INVALID_PARAMETER);
     718    gid_t gidNative = gid != NIL_RTGID ? (gid_t)gid : (gid_t)-1;
     719    AssertReturn(gid == gidNative, VERR_INVALID_PARAMETER);
     720
     721    if (fchown(RTFileToNative(hFile), uidNative, gidNative))
     722        return RTErrConvertFromErrno(errno);
     723    return VINF_SUCCESS;
     724}
     725
     726
    714727RTR3DECL(int) RTFileRename(const char *pszSrc, const char *pszDst, unsigned fRename)
    715728{
Note: See TracChangeset for help on using the changeset viewer.

© 2023 Oracle
ContactPrivacy policyTerms of Use