VirtualBox

Changeset 44298 in vbox for trunk/src/VBox/Runtime


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

Implemented RTFileSetOwner on non-windows systems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.

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